Class FileNamer

Direct Known Subclasses:
FileNamerIndependent, IfRelativeToDirectory, PatternSpan, RemoveExtension, SubsetRangeIfRequested

public abstract class FileNamer extends AnchorBean<FileNamer>
Associates a name (a compact unique identifier) with a file.

The operation can be processed on a single file or a collection of files.

Author:
Owen Feehan
  • Constructor Details

    • FileNamer

      public FileNamer()
  • Method Details

    • deriveName

      public NamedFile deriveName(File file, FileNamerContext context)
      A name for a file.
      Parameters:
      file - the file to extract a name for.
      context - additional context for naming.
      Returns:
      the file combined with an extracted name.
    • deriveName

      public abstract List<NamedFile> deriveName(List<File> files, FileNamerContext context)
      Derives a list of names (associated with each file) for some files.
      Parameters:
      files - the files to describe.
      context - additional context for naming.
      Returns:
      a list of identical size and order to files, corresponding to the file the extracted name.
    • deriveNameUnique

      public List<NamedFile> deriveNameUnique(List<File> files, FileNamerContext context) throws InputReadFailedException
      Like deriveName(List, FileNamerContext) but checks that the final list of named-files all have unique names.
      Parameters:
      files - the files to describe.
      context - additional context for naming.
      Returns:
      a list of identical size and order to files, corresponding to the file the extracted name.
      Throws:
      InputReadFailedException - if more than one NamedFile have the same name