diff --git a/src/main/java/nl/knaw/dans/managedeposit/core/service/IngestPathMonitor.java b/src/main/java/nl/knaw/dans/managedeposit/core/service/IngestPathMonitor.java index 179b49e..ea2aa5e 100644 --- a/src/main/java/nl/knaw/dans/managedeposit/core/service/IngestPathMonitor.java +++ b/src/main/java/nl/knaw/dans/managedeposit/core/service/IngestPathMonitor.java @@ -47,13 +47,13 @@ public IngestPathMonitor(List 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);