@Test(expected = FileNotFoundException.class) public void testGetFileNotFound() throws FileNotFoundException { PropertiesUtils.findFile("notfoundfilename"); fail(ResourcesPublicUtilTest.EXPECTING_EXCEPTION_FILE_NOT_FOUND_EXCEPTION); }
public static File findFile(String filename) throws FileNotFoundException { File file = new File(filename); try { if (!file.exists()) { file = fileFromConfigFolder(filename); if (!file.exists()) { file = getResourceFile(filename); } } } catch (final FileNotFoundException e) { SysErrLogger.FAKE_LOGGER.ignoreLog(e); throw new FileNotFoundException("File not found: " + filename); } if (!file.exists()) { throw new FileNotFoundException("File not found: " + filename); } return file; }
PropertiesUtils { public static File findFile(String filename) throws FileNotFoundException { File file = new File(filename); try { if (!file.exists()) { file = fileFromConfigFolder(filename); if (!file.exists()) { file = getResourceFile(filename); } } } catch (final FileNotFoundException e) { SysErrLogger.FAKE_LOGGER.ignoreLog(e); throw new FileNotFoundException("File not found: " + filename); } if (!file.exists()) { throw new FileNotFoundException("File not found: " + filename); } return file; } }
PropertiesUtils { public static File findFile(String filename) throws FileNotFoundException { File file = new File(filename); try { if (!file.exists()) { file = fileFromConfigFolder(filename); if (!file.exists()) { file = getResourceFile(filename); } } } catch (final FileNotFoundException e) { SysErrLogger.FAKE_LOGGER.ignoreLog(e); throw new FileNotFoundException("File not found: " + filename); } if (!file.exists()) { throw new FileNotFoundException("File not found: " + filename); } return file; } private  PropertiesUtils(); }
PropertiesUtils { public static File findFile(String filename) throws FileNotFoundException { File file = new File(filename); try { if (!file.exists()) { file = fileFromConfigFolder(filename); if (!file.exists()) { file = getResourceFile(filename); } } } catch (final FileNotFoundException e) { SysErrLogger.FAKE_LOGGER.ignoreLog(e); throw new FileNotFoundException("File not found: " + filename); } if (!file.exists()) { throw new FileNotFoundException("File not found: " + filename); } return file; } private  PropertiesUtils(); static InputStream getConfigAsStream(String resourcesFile); static InputStream getResourceAsStream(String resourcesFile); static File getResourceFile(String resourcesFile); static Path getResourcePath(String resourcesFile); static Stream<String> getResourceListing(Class clazz, String path); static File findFile(String filename); static File fileFromConfigFolder(String subpath); static File fileFromDataFolder(String subpath); static File fileFromTmpFolder(String subpath); static Properties readProperties(File propertiesFile); static C readYaml(File yamlFile, Class<C> clasz); static C readYaml(File yamlFile, TypeReference<C> typeReference); static C readYaml(InputStream yamlInputStream, Class<C> clasz); static C readYaml(Path yamlPath, Class<C> clasz); static void writeYaml(File destination, Object config); static String getResourceAsString(String resourcesFile); }
PropertiesUtils { public static File findFile(String filename) throws FileNotFoundException { File file = new File(filename); try { if (!file.exists()) { file = fileFromConfigFolder(filename); if (!file.exists()) { file = getResourceFile(filename); } } } catch (final FileNotFoundException e) { SysErrLogger.FAKE_LOGGER.ignoreLog(e); throw new FileNotFoundException("File not found: " + filename); } if (!file.exists()) { throw new FileNotFoundException("File not found: " + filename); } return file; } private  PropertiesUtils(); static InputStream getConfigAsStream(String resourcesFile); static InputStream getResourceAsStream(String resourcesFile); static File getResourceFile(String resourcesFile); static Path getResourcePath(String resourcesFile); static Stream<String> getResourceListing(Class clazz, String path); static File findFile(String filename); static File fileFromConfigFolder(String subpath); static File fileFromDataFolder(String subpath); static File fileFromTmpFolder(String subpath); static Properties readProperties(File propertiesFile); static C readYaml(File yamlFile, Class<C> clasz); static C readYaml(File yamlFile, TypeReference<C> typeReference); static C readYaml(InputStream yamlInputStream, Class<C> clasz); static C readYaml(Path yamlPath, Class<C> clasz); static void writeYaml(File destination, Object config); static String getResourceAsString(String resourcesFile);  }