@Test public void openResourceStream_FROM_FILE() throws IOException { URL resourceUrl = ResourceUtilsTest.class.getClassLoader().getResource("pl/edu/icm/cermine/tools/resourceFile.txt"); InputStream inputStream = ResourceUtils.openResourceStream(resourceUrl.getPath()); assertResourceContent(inputStream); }
public static InputStream openResourceStream(String resourcePath) throws IOException { if (StringUtils.startsWith(resourcePath, CLASSPATH_RESOURCE_PREFIX)) { InputStream inputStream = ResourceUtils.class.getResourceAsStream(resourcePath.substring(CLASSPATH_RESOURCE_PREFIX.length())); return inputStream; } return new FileInputStream(resourcePath); }
ResourceUtils { public static InputStream openResourceStream(String resourcePath) throws IOException { if (StringUtils.startsWith(resourcePath, CLASSPATH_RESOURCE_PREFIX)) { InputStream inputStream = ResourceUtils.class.getResourceAsStream(resourcePath.substring(CLASSPATH_RESOURCE_PREFIX.length())); return inputStream; } return new FileInputStream(resourcePath); } }
ResourceUtils { public static InputStream openResourceStream(String resourcePath) throws IOException { if (StringUtils.startsWith(resourcePath, CLASSPATH_RESOURCE_PREFIX)) { InputStream inputStream = ResourceUtils.class.getResourceAsStream(resourcePath.substring(CLASSPATH_RESOURCE_PREFIX.length())); return inputStream; } return new FileInputStream(resourcePath); }  }
ResourceUtils { public static InputStream openResourceStream(String resourcePath) throws IOException { if (StringUtils.startsWith(resourcePath, CLASSPATH_RESOURCE_PREFIX)) { InputStream inputStream = ResourceUtils.class.getResourceAsStream(resourcePath.substring(CLASSPATH_RESOURCE_PREFIX.length())); return inputStream; } return new FileInputStream(resourcePath); }  static InputStream openResourceStream(String resourcePath); }
ResourceUtils { public static InputStream openResourceStream(String resourcePath) throws IOException { if (StringUtils.startsWith(resourcePath, CLASSPATH_RESOURCE_PREFIX)) { InputStream inputStream = ResourceUtils.class.getResourceAsStream(resourcePath.substring(CLASSPATH_RESOURCE_PREFIX.length())); return inputStream; } return new FileInputStream(resourcePath); }  static InputStream openResourceStream(String resourcePath);  }