@Test public void localJarResourceWithInputStreamFactory() throws URISyntaxException, IOException { URL resource = getClass().getResource("/java/lang/String.class"); AtomicLong counter = new AtomicLong(0); InputStream inputStream = ResourceUtil.asInputStream(resource.toString(), new InputStreamFactory() { @Override public InputStream create(InputStream inStream) throws IOException { return new ProxyInputStream(inStream) { @Override protected void afterRead(int n) throws IOException { counter.addAndGet(n); } }; } }); assertNotNull(inputStream); IOUtils.copy(inputStream, new NullOutputStream()); inputStream.close(); assertThat(counter.get(), greaterThan(100L)); }
public static InputStream asInputStream(String resource) throws IOException { return asInputStream(resource, inStream -> inStream); }
ResourceUtil { public static InputStream asInputStream(String resource) throws IOException { return asInputStream(resource, inStream -> inStream); } }
ResourceUtil { public static InputStream asInputStream(String resource) throws IOException { return asInputStream(resource, inStream -> inStream); }  }
ResourceUtil { public static InputStream asInputStream(String resource) throws IOException { return asInputStream(resource, inStream -> inStream); }  static URI fromShapefileDir(String shapeFile); static URI fromShapefileDir(URI shapeFile); static InputStream asInputStream(String resource); static InputStream asInputStream(String resource, InputStreamFactory factory); static InputStream asInputStream(URI resource, InputStreamFactory factory); static boolean isFileURI(URI resource); static URI getAbsoluteResourceURI(URI context, URI resourceName); }
ResourceUtil { public static InputStream asInputStream(String resource) throws IOException { return asInputStream(resource, inStream -> inStream); }  static URI fromShapefileDir(String shapeFile); static URI fromShapefileDir(URI shapeFile); static InputStream asInputStream(String resource); static InputStream asInputStream(String resource, InputStreamFactory factory); static InputStream asInputStream(URI resource, InputStreamFactory factory); static boolean isFileURI(URI resource); static URI getAbsoluteResourceURI(URI context, URI resourceName); static final String SHAPEFILES_DIR; }