Skip to content

Instantly share code, notes, and snippets.


Ralf Becher ralfbecher

View GitHub Profile
jexp /
Created Apr 24, 2015
Neo4j Server Extension that serves files from a webapp directory of the JAR
public class StaticWebResource {
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();