@Test public void kaboomWithInputStreamFactory() throws URISyntaxException { URL resource = getClass().getResource("/java/lang/String.class"); try { ResourceUtil.asInputStream(resource.toString(), new InputStreamFactory() { @Override public InputStream create(InputStream inStream) throws IOException { throw new IOException("kaboom!"); } }); fail("expected IOException"); } catch (IOException ex) { assertThat(ex.getCause().getMessage(), is("kaboom!")); } }
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; }