automate fat docker
This commit is contained in:
@@ -125,9 +125,7 @@ public class AppConfig {
|
||||
public Predicate<Path> processPDFOnlyFilter() {
|
||||
return path -> {
|
||||
if (Files.isDirectory(path)) {
|
||||
return !path.toString()
|
||||
.contains(
|
||||
"processing");
|
||||
return !path.toString().contains("processing");
|
||||
} else {
|
||||
String fileName = path.getFileName().toString();
|
||||
return fileName.endsWith(".pdf");
|
||||
|
||||
@@ -139,7 +139,11 @@ public class PipelineDirectoryProcessor {
|
||||
throws IOException {
|
||||
try (Stream<Path> paths = Files.list(dir)) {
|
||||
if ("automated".equals(operation.getParameters().get("fileInput"))) {
|
||||
return paths.filter(path -> !Files.isDirectory(path) && !path.equals(jsonFile) && fileMonitor.isFileReadyForProcessing(path))
|
||||
return paths.filter(
|
||||
path ->
|
||||
!Files.isDirectory(path)
|
||||
&& !path.equals(jsonFile)
|
||||
&& fileMonitor.isFileReadyForProcessing(path))
|
||||
.map(Path::toFile)
|
||||
.toArray(File[]::new);
|
||||
} else {
|
||||
|
||||
@@ -29,7 +29,8 @@ public class FileMonitor {
|
||||
|
||||
/**
|
||||
* @param rootDirectory the root directory to monitor
|
||||
* @param pathFilter the filter to apply to the paths, return true if the path should be monitored, false otherwise
|
||||
* @param pathFilter the filter to apply to the paths, return true if the path should be
|
||||
* monitored, false otherwise
|
||||
*/
|
||||
@Autowired
|
||||
public FileMonitor(
|
||||
|
||||
Reference in New Issue
Block a user