@Test public void testReadClasspathFileResource() throws Exception { try (var fr = new ConfigResource("classpath: assertThat(fr, notNullValue()); } }
public InputStream getInputStream() { final String[] split = sourceURI.split(SEPARATOR); if (split.length != 2) { throw new IllegalArgumentException(sourceURI + " is invalid path. The path should follow " + "scheme: } var sourceType = split[0].toUpperCase(); var pathToSource = split[1]; switch (Type.valueOf(sourceType)) { case CLASSPATH: return classpathResourcePointer.apply(pathToSource); case FILE: return fileResourcePointer.apply(pathToSource); default: throw new UnsupportedOperationException("Rhino knows only about classpath files or" + " files on file system."); } }
ConfigResource { public InputStream getInputStream() { final String[] split = sourceURI.split(SEPARATOR); if (split.length != 2) { throw new IllegalArgumentException(sourceURI + " is invalid path. The path should follow " + "scheme: } var sourceType = split[0].toUpperCase(); var pathToSource = split[1]; switch (Type.valueOf(sourceType)) { case CLASSPATH: return classpathResourcePointer.apply(pathToSource); case FILE: return fileResourcePointer.apply(pathToSource); default: throw new UnsupportedOperationException("Rhino knows only about classpath files or" + " files on file system."); } } }
ConfigResource { public InputStream getInputStream() { final String[] split = sourceURI.split(SEPARATOR); if (split.length != 2) { throw new IllegalArgumentException(sourceURI + " is invalid path. The path should follow " + "scheme: } var sourceType = split[0].toUpperCase(); var pathToSource = split[1]; switch (Type.valueOf(sourceType)) { case CLASSPATH: return classpathResourcePointer.apply(pathToSource); case FILE: return fileResourcePointer.apply(pathToSource); default: throw new UnsupportedOperationException("Rhino knows only about classpath files or" + " files on file system."); } } ConfigResource(String sourceURI); }
ConfigResource { public InputStream getInputStream() { final String[] split = sourceURI.split(SEPARATOR); if (split.length != 2) { throw new IllegalArgumentException(sourceURI + " is invalid path. The path should follow " + "scheme: } var sourceType = split[0].toUpperCase(); var pathToSource = split[1]; switch (Type.valueOf(sourceType)) { case CLASSPATH: return classpathResourcePointer.apply(pathToSource); case FILE: return fileResourcePointer.apply(pathToSource); default: throw new UnsupportedOperationException("Rhino knows only about classpath files or" + " files on file system."); } } ConfigResource(String sourceURI); InputStream getInputStream(); }
ConfigResource { public InputStream getInputStream() { final String[] split = sourceURI.split(SEPARATOR); if (split.length != 2) { throw new IllegalArgumentException(sourceURI + " is invalid path. The path should follow " + "scheme: } var sourceType = split[0].toUpperCase(); var pathToSource = split[1]; switch (Type.valueOf(sourceType)) { case CLASSPATH: return classpathResourcePointer.apply(pathToSource); case FILE: return fileResourcePointer.apply(pathToSource); default: throw new UnsupportedOperationException("Rhino knows only about classpath files or" + " files on file system."); } } ConfigResource(String sourceURI); InputStream getInputStream();  }