@Test(dataProvider = "invalid_paths") public void ensure_assets_are_rejected(String path) throws IOException { ContextAssetRequestHandler handler = new ContextAssetRequestHandler(null, null); assertFalse(handler.handleAssetRequest(null, null, "fake-checksum/" + path), "Handler should return false for invalid path."); }
public boolean handleAssetRequest(Request request, Response response, String extraPath) throws IOException { ChecksumPath path = new ChecksumPath(resourceStreamer, null, extraPath); if (illegal.matcher(path.resourcePath).matches()) { return false; } return path.stream(rootContextResource.forFile(path.resourcePath)); }
ContextAssetRequestHandler implements AssetRequestHandler { public boolean handleAssetRequest(Request request, Response response, String extraPath) throws IOException { ChecksumPath path = new ChecksumPath(resourceStreamer, null, extraPath); if (illegal.matcher(path.resourcePath).matches()) { return false; } return path.stream(rootContextResource.forFile(path.resourcePath)); } }
ContextAssetRequestHandler implements AssetRequestHandler { public boolean handleAssetRequest(Request request, Response response, String extraPath) throws IOException { ChecksumPath path = new ChecksumPath(resourceStreamer, null, extraPath); if (illegal.matcher(path.resourcePath).matches()) { return false; } return path.stream(rootContextResource.forFile(path.resourcePath)); } ContextAssetRequestHandler(ResourceStreamer resourceStreamer, Resource rootContextResource); }
ContextAssetRequestHandler implements AssetRequestHandler { public boolean handleAssetRequest(Request request, Response response, String extraPath) throws IOException { ChecksumPath path = new ChecksumPath(resourceStreamer, null, extraPath); if (illegal.matcher(path.resourcePath).matches()) { return false; } return path.stream(rootContextResource.forFile(path.resourcePath)); } ContextAssetRequestHandler(ResourceStreamer resourceStreamer, Resource rootContextResource); boolean handleAssetRequest(Request request, Response response, String extraPath); }
ContextAssetRequestHandler implements AssetRequestHandler { public boolean handleAssetRequest(Request request, Response response, String extraPath) throws IOException { ChecksumPath path = new ChecksumPath(resourceStreamer, null, extraPath); if (illegal.matcher(path.resourcePath).matches()) { return false; } return path.stream(rootContextResource.forFile(path.resourcePath)); } ContextAssetRequestHandler(ResourceStreamer resourceStreamer, Resource rootContextResource); boolean handleAssetRequest(Request request, Response response, String extraPath);  }