@Test public void listFilePathsBasedOnGlob() throws IOException { String testGlob = "*.ini"; List<Path> testFilePaths = SystemPropertiesLoader.getFilePaths( Paths.get("src/test/resources/loading_order_inis"), testGlob); assertEquals(testFilePaths.size(), testFilePaths.size()); assertTrue(testFilePaths.containsAll(testFiles)); }
static List<Path> getFilePaths(Path dir, String glob) throws IOException { try (DirectoryStream<Path> dStream = Files.newDirectoryStream(dir, glob)) { List<Path> filePaths = new ArrayList<>(); dStream.forEach(filePaths::add); return filePaths; } }
SystemPropertiesLoader { static List<Path> getFilePaths(Path dir, String glob) throws IOException { try (DirectoryStream<Path> dStream = Files.newDirectoryStream(dir, glob)) { List<Path> filePaths = new ArrayList<>(); dStream.forEach(filePaths::add); return filePaths; } } }
SystemPropertiesLoader { static List<Path> getFilePaths(Path dir, String glob) throws IOException { try (DirectoryStream<Path> dStream = Files.newDirectoryStream(dir, glob)) { List<Path> filePaths = new ArrayList<>(); dStream.forEach(filePaths::add); return filePaths; } } protected  SystemPropertiesLoader(String prefix); }
SystemPropertiesLoader { static List<Path> getFilePaths(Path dir, String glob) throws IOException { try (DirectoryStream<Path> dStream = Files.newDirectoryStream(dir, glob)) { List<Path> filePaths = new ArrayList<>(); dStream.forEach(filePaths::add); return filePaths; } } protected  SystemPropertiesLoader(String prefix); static SystemPropertiesLoader create(); static SystemPropertiesLoader create(String prefix); SystemPropertiesLoader withCommon(); SystemPropertiesLoader withoutOverrides(); SystemPropertiesLoader withLocal(); SystemPropertiesLoader withAddOn(); SystemPropertiesLoader withCommonAndLocal(); SystemPropertiesLoader with(String fileName,
            String... sectionNames); SystemPropertiesLoader withLocalOptional(String fileName,
                                       String... sectionNames); SystemPropertiesLoader withAtLeastOneOf(String... filePaths); void load(); }
SystemPropertiesLoader { static List<Path> getFilePaths(Path dir, String glob) throws IOException { try (DirectoryStream<Path> dStream = Files.newDirectoryStream(dir, glob)) { List<Path> filePaths = new ArrayList<>(); dStream.forEach(filePaths::add); return filePaths; } } protected  SystemPropertiesLoader(String prefix); static SystemPropertiesLoader create(); static SystemPropertiesLoader create(String prefix); SystemPropertiesLoader withCommon(); SystemPropertiesLoader withoutOverrides(); SystemPropertiesLoader withLocal(); SystemPropertiesLoader withAddOn(); SystemPropertiesLoader withCommonAndLocal(); SystemPropertiesLoader with(String fileName,
            String... sectionNames); SystemPropertiesLoader withLocalOptional(String fileName,
                                       String... sectionNames); SystemPropertiesLoader withAtLeastOneOf(String... filePaths); void load();  }