@Test public void should_list_file_in_sip_directory() throws IOException { Path sipDirectory = generateThreeZipFileSipWithSubDirectory(); Path reportDirectory = temporaryFolder.newFolder().toPath(); PerformanceService performanceService = new PerformanceService(ingestClientFactory, adminClientFactory, sipDirectory, reportDirectory, UserInterfaceTransactionManager.getInstance()); List<Path> files = performanceService.listSipDirectory(); assertThat(files).hasSize(3); }
List<Path> listSipDirectory() throws IOException { List<Path> paths = new ArrayList<>(); Files.walkFileTree(sipDirectory, new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { if (file.toString().toLowerCase().endsWith("zip")) { paths.add(sipDirectory.relativize(file)); } return FileVisitResult.CONTINUE; } }); return paths; }
PerformanceService { List<Path> listSipDirectory() throws IOException { List<Path> paths = new ArrayList<>(); Files.walkFileTree(sipDirectory, new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { if (file.toString().toLowerCase().endsWith("zip")) { paths.add(sipDirectory.relativize(file)); } return FileVisitResult.CONTINUE; } }); return paths; } }
PerformanceService { List<Path> listSipDirectory() throws IOException { List<Path> paths = new ArrayList<>(); Files.walkFileTree(sipDirectory, new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { if (file.toString().toLowerCase().endsWith("zip")) { paths.add(sipDirectory.relativize(file)); } return FileVisitResult.CONTINUE; } }); return paths; } PerformanceService(Path sipDirectory, Path performanceReportDirectory);   PerformanceService(IngestExternalClientFactory ingestClientFactory,
        AdminExternalClientFactory adminClientFactory, Path sipDirectory,
        Path performanceReportDirectory, UserInterfaceTransactionManager userInterfaceTransactionManager); }
PerformanceService { List<Path> listSipDirectory() throws IOException { List<Path> paths = new ArrayList<>(); Files.walkFileTree(sipDirectory, new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { if (file.toString().toLowerCase().endsWith("zip")) { paths.add(sipDirectory.relativize(file)); } return FileVisitResult.CONTINUE; } }); return paths; } PerformanceService(Path sipDirectory, Path performanceReportDirectory);   PerformanceService(IngestExternalClientFactory ingestClientFactory,
        AdminExternalClientFactory adminClientFactory, Path sipDirectory,
        Path performanceReportDirectory, UserInterfaceTransactionManager userInterfaceTransactionManager);  }
PerformanceService { List<Path> listSipDirectory() throws IOException { List<Path> paths = new ArrayList<>(); Files.walkFileTree(sipDirectory, new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { if (file.toString().toLowerCase().endsWith("zip")) { paths.add(sipDirectory.relativize(file)); } return FileVisitResult.CONTINUE; } }); return paths; } PerformanceService(Path sipDirectory, Path performanceReportDirectory);   PerformanceService(IngestExternalClientFactory ingestClientFactory,
        AdminExternalClientFactory adminClientFactory, Path sipDirectory,
        Path performanceReportDirectory, UserInterfaceTransactionManager userInterfaceTransactionManager);   }