Class SpecificPathList


public class SpecificPathList extends FilesProvider
A specific list of paths which form the input.

If no paths are specified in the bean, then can be read from the Input-Context

If none are available in the Input-Context, then either the fallback is called if it exists, or an error is thrown

Author:
Owen Feehan
  • Constructor Details

    • SpecificPathList

      public SpecificPathList(List<String> listPaths)
      Creates by reusing an existing list.
      Parameters:
      listPaths - the list of paths to reuse.
    • SpecificPathList

      public SpecificPathList(StringList listPaths)
      Creates by reusing an existing list.
      Parameters:
      listPaths - the list of paths to reuse.
    • SpecificPathList

      public SpecificPathList()
  • Method Details

    • createWithEmptyList

      public static SpecificPathList createWithEmptyList()
      Factory method for creating the class with an empty list of paths.
      Returns:
      a newly created list that is empty.
    • 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.
    • getListPaths

      public StringList getListPaths()
      If specified, this forms the list of paths which is provided as input.

      If not, then the input-context is asked. If still not, then the fallback.

      If a list is specified, than the input-directory is derived from the maximally common root of all the files, if it exists.

    • setListPaths

      public void setListPaths(StringList listPaths)
      If specified, this forms the list of paths which is provided as input.

      If not, then the input-context is asked. If still not, then the fallback.

      If a list is specified, than the input-directory is derived from the maximally common root of all the files, if it exists.

    • getFallback

      public FilesProvider getFallback()
      If no paths can be found either from listPaths or the input-context, then the fallback is called if exists, otherwise an error is thrown
    • setFallback

      public void setFallback(FilesProvider fallback)
      If no paths can be found either from listPaths or the input-context, then the fallback is called if exists, otherwise an error is thrown