Skip to content

Instantly share code, notes, and snippets.

Ralf Becher ralfbecher

Block or report user

Report or block ralfbecher

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jexp
jexp / StaticWebResource.java
Created Apr 24, 2015
Neo4j Server Extension that serves files from a webapp directory of the JAR
View StaticWebResource.java
@Path("/")
public class StaticWebResource {
@GET
@Path("{file:(?i).+\\.(png|jpg|jpeg|svg|gif|html?|js|css|txt)}")
public Response file(@PathParam("file") String file) throws IOException {
InputStream fileStream = findFileStream(file);
if (fileStream == null) return Response.status(Response.Status.NOT_FOUND).build();
else return Response.ok(fileStream, mediaType(file)).build();
}
You can’t perform that action at this time.