Class FilesProviderUnary

Direct Known Subclasses:
FilterForExistingFiles, Limit, RandomOrder, RemoveMatching, SortAlphabetically

public abstract class FilesProviderUnary extends FilesProvider
Like FilesProvider but employs a unary operator on a call to an existing FilesProvider.
Author:
Owen Feehan
  • Constructor Details

    • FilesProviderUnary

      public FilesProviderUnary()
  • Method Details

    • create

      public List<File> create(InputManagerParameters parameters) throws FilesProviderException
      Description copied from class: FilesProvider
      Creates or provides a list of files.
      Specified by:
      create in class FilesProvider
      Parameters:
      parameters - parameters influencing how input-files are obtained.
      Returns:
      the list of files from the provider
      Throws:
      FilesProviderException - if list of files cannot be successfully established.
    • rootDirectory

      public Optional<Path> rootDirectory(InputContextParameters inputContext) throws FilesProviderException
      Description copied from class: FilesProvider
      A root directory for these files, if it exists.

      Any file that is part of the collection returned by this provider, must exist inside this directory (either directly or in any nested subdirectories).

      Specified by:
      rootDirectory in class FilesProvider
      Parameters:
      inputContext - the input-context.
      Returns:
      a path to this directory.
      Throws:
      FilesProviderException - if an error occurs establishing the root directory.
    • transform

      protected abstract List<File> transform(List<File> source, boolean debugMode) throws FilesProviderException
      Transform an existing collection of files.

      Note that the incoming collection of files may be modified, and can no longer be used in its original form after this method call.

      Parameters:
      source - the incoming files (which may be consumed and modified).
      debugMode - whether we are executing in debug-mode or not
      Returns:
      the transformed (outgoing) files.
      Throws:
      FilesProviderException - if unable to complete the transform operation successfully.
    • getFiles

      public FilesProvider getFiles()
    • setFiles

      public void setFiles(FilesProvider files)