Class RemoveExtension


public class RemoveExtension extends FileNamer
Removes extensions from the identifier (but not from the file) and only if the extension hasn't already been removed upstream.

As an exception, the extension can be retained if there is more than one file with the same identifier.

To check if the extension has already been removed upstream, a check occurs if the path ends with the identifier.

Author:
Owen Feehan
  • Constructor Details

    • RemoveExtension

      public RemoveExtension(FileNamer namer)
    • RemoveExtension

      public RemoveExtension()
  • Method Details

    • deriveName

      public List<NamedFile> deriveName(List<File> files, FileNamerContext context)
      Description copied from class: FileNamer
      Derives a list of names (associated with each file) for some files.
      Specified by:
      deriveName in class FileNamer
      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.
    • getNamer

      public FileNamer getNamer()
    • setNamer

      public void setNamer(FileNamer namer)
    • isPreserveExtensionIfDuplicate

      public boolean isPreserveExtensionIfDuplicate()
      Keeps the extension if the file-name (without the extension) becomes duplicated with another.
    • setPreserveExtensionIfDuplicate

      public void setPreserveExtensionIfDuplicate(boolean preserveExtensionIfDuplicate)
      Keeps the extension if the file-name (without the extension) becomes duplicated with another.