Skip to content

Commit

Permalink
DD-1492 dd-manage-deposits improvemnets fixes for DD-1419 - Part 2 di…
Browse files Browse the repository at this point in the history
…rectory search depth limit
  • Loading branch information
Ali Sheikhi authored and Ali Sheikhi committed Feb 8, 2024
1 parent 05cc7f4 commit ecc1fef
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ public IngestPathMonitor(List<Path> depositBoxesPaths, DepositStatusUpdater depo
}

private void startMonitors() throws Exception {
IOFileFilter directories = FileFilterUtils.and(FileFilterUtils.directoryFileFilter(), HiddenFileFilter.VISIBLE);
IOFileFilter files = FileFilterUtils.and(FileFilterUtils.fileFileFilter(), FileFilterUtils.nameFileFilter("deposit.properties", IOCase.INSENSITIVE));
IOFileFilter filter = FileFilterUtils.or(directories, files);

log.info("Starting 'IngestPathMonitor', file filter: deposit.properties");
log.info("Starting 'IngestPathMonitor', file filter: deposit.properties, directory depth: only first child of the base folder");

for (Path folder : toMonitorPaths) {
IOFileFilter directories = FileFilterUtils.and(FileFilterUtils.directoryFileFilter(), new DepthFileFilter(folder, 1));
IOFileFilter files = FileFilterUtils.and(FileFilterUtils.fileFileFilter(), FileFilterUtils.nameFileFilter("deposit.properties", IOCase.INSENSITIVE));
IOFileFilter filter = FileFilterUtils.or(directories, files);

FileAlterationObserver observer = new FileAlterationObserver(folder.toFile(), filter);

observer.addListener(this);
Expand Down

0 comments on commit ecc1fef

Please sign in to comment.