@Test public void testGetResourceStream_fromJar() throws IOException { System.clearProperty(ResourceHandler.SMOS_DDDB_DIR_PROPERTY_NAME); final InputStream resourceStream = resourceHandler.getResourceStream("bands/AUX_/DFFLAI/DBL_SM_XXXX_AUX_DFFLAI_0200.csv"); assertNotNull(resourceStream); resourceStream.close(); }
InputStream getResourceStream(String path) throws FileNotFoundException { final String dddbDirFromProperty = System.getProperty(SMOS_DDDB_DIR_PROPERTY_NAME); if (StringUtils.isNotNullAndNotEmpty(dddbDirFromProperty)) { final File resourceFile = new File(dddbDirFromProperty, path); if (resourceFile.isFile()) { return new FileInputStream(resourceFile); } } return getClass().getResourceAsStream(path); }
ResourceHandler { InputStream getResourceStream(String path) throws FileNotFoundException { final String dddbDirFromProperty = System.getProperty(SMOS_DDDB_DIR_PROPERTY_NAME); if (StringUtils.isNotNullAndNotEmpty(dddbDirFromProperty)) { final File resourceFile = new File(dddbDirFromProperty, path); if (resourceFile.isFile()) { return new FileInputStream(resourceFile); } } return getClass().getResourceAsStream(path); } }
ResourceHandler { InputStream getResourceStream(String path) throws FileNotFoundException { final String dddbDirFromProperty = System.getProperty(SMOS_DDDB_DIR_PROPERTY_NAME); if (StringUtils.isNotNullAndNotEmpty(dddbDirFromProperty)) { final File resourceFile = new File(dddbDirFromProperty, path); if (resourceFile.isFile()) { return new FileInputStream(resourceFile); } } return getClass().getResourceAsStream(path); }  }
ResourceHandler { InputStream getResourceStream(String path) throws FileNotFoundException { final String dddbDirFromProperty = System.getProperty(SMOS_DDDB_DIR_PROPERTY_NAME); if (StringUtils.isNotNullAndNotEmpty(dddbDirFromProperty)) { final File resourceFile = new File(dddbDirFromProperty, path); if (resourceFile.isFile()) { return new FileInputStream(resourceFile); } } return getClass().getResourceAsStream(path); }   }
ResourceHandler { InputStream getResourceStream(String path) throws FileNotFoundException { final String dddbDirFromProperty = System.getProperty(SMOS_DDDB_DIR_PROPERTY_NAME); if (StringUtils.isNotNullAndNotEmpty(dddbDirFromProperty)) { final File resourceFile = new File(dddbDirFromProperty, path); if (resourceFile.isFile()) { return new FileInputStream(resourceFile); } } return getClass().getResourceAsStream(path); }    }