@Test public void retrieveFiles_ShouldReturnOneEntry_AndIgnoreInvalidDirectories() throws Exception { Path dir1 = createDirectory(inputDir.resolve("1")); createDirectory(inputDir.resolve("inexistent")); candidates = subject.retrieveFiles(); assertThat(candidates).containsKey(dir1); assertThat(candidates.get(dir1)).isEmpty(); assertThat(candidates).hasSize(1); }
@Override public Map<Path, List<Media>> retrieveFiles() { log.info("Scanning for directories in {}", scanConfig.base_input_dir()); return scannerProvider.get() .searchIn(scanConfig.base_input_dir()) .withRecursion(false) .withDirectories(true) .stream() .filter(this::isPriorityDirectory) .peek(path -> log.info("Found input directory: {}", path)) .collect(Collectors.toMap( Function.identity(), this::getListOfMediaFiles)); }
MediaScanServiceImpl implements MediaScanService { @Override public Map<Path, List<Media>> retrieveFiles() { log.info("Scanning for directories in {}", scanConfig.base_input_dir()); return scannerProvider.get() .searchIn(scanConfig.base_input_dir()) .withRecursion(false) .withDirectories(true) .stream() .filter(this::isPriorityDirectory) .peek(path -> log.info("Found input directory: {}", path)) .collect(Collectors.toMap( Function.identity(), this::getListOfMediaFiles)); } }
MediaScanServiceImpl implements MediaScanService { @Override public Map<Path, List<Media>> retrieveFiles() { log.info("Scanning for directories in {}", scanConfig.base_input_dir()); return scannerProvider.get() .searchIn(scanConfig.base_input_dir()) .withRecursion(false) .withDirectories(true) .stream() .filter(this::isPriorityDirectory) .peek(path -> log.info("Found input directory: {}", path)) .collect(Collectors.toMap( Function.identity(), this::getListOfMediaFiles)); } @Inject  MediaScanServiceImpl(MediaScanConfig scanConfig,
                         Provider<FileScanner> scannerProvider); }
MediaScanServiceImpl implements MediaScanService { @Override public Map<Path, List<Media>> retrieveFiles() { log.info("Scanning for directories in {}", scanConfig.base_input_dir()); return scannerProvider.get() .searchIn(scanConfig.base_input_dir()) .withRecursion(false) .withDirectories(true) .stream() .filter(this::isPriorityDirectory) .peek(path -> log.info("Found input directory: {}", path)) .collect(Collectors.toMap( Function.identity(), this::getListOfMediaFiles)); } @Inject  MediaScanServiceImpl(MediaScanConfig scanConfig,
                         Provider<FileScanner> scannerProvider); @Override Map<Path, List<Media>> retrieveFiles(); @Override List<Media> retrieveFilesAsList(); }
MediaScanServiceImpl implements MediaScanService { @Override public Map<Path, List<Media>> retrieveFiles() { log.info("Scanning for directories in {}", scanConfig.base_input_dir()); return scannerProvider.get() .searchIn(scanConfig.base_input_dir()) .withRecursion(false) .withDirectories(true) .stream() .filter(this::isPriorityDirectory) .peek(path -> log.info("Found input directory: {}", path)) .collect(Collectors.toMap( Function.identity(), this::getListOfMediaFiles)); } @Inject  MediaScanServiceImpl(MediaScanConfig scanConfig,
                         Provider<FileScanner> scannerProvider); @Override Map<Path, List<Media>> retrieveFiles(); @Override List<Media> retrieveFilesAsList();  }