Class FileProcessingTask

All Implemented Interfaces:
Serializable, Future<Void>

public class FileProcessingTask extends RecursiveAction

Parallel File Processing (Fork/Join)

Demonstrates the divide-and-conquer pattern utilizing Java's RecursiveAction. It recursively splits a list of files into smaller sub-tasks until they hit the defined threshold, allowing the ForkJoinPool to process the I/O workload in parallel.

Modernization Note: Utilizes NIO.2 (Path, Files) for robust and efficient filesystem traversal.

Author:
vicegd
See Also:
  • Constructor Details

    • FileProcessingTask

      public FileProcessingTask(Path directory)
      Root Constructor: Initializes the task by scanning the target directory.

      Utilizes Java Streams to efficiently filter and collect regular files, ignoring sub-directories.

      Parameters:
      directory - The root directory to scan.
  • Method Details