Class RemoveExtension

Object
AnchorBean<FileNamer>
FileNamer
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 Summary

    Constructors
    Constructor
    Description
     
    RemoveExtension(FileNamer namer)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    List<NamedFile>
    deriveName(List<File> files, FileNamerContext context)
     
    FileNamer
     
    boolean
    Keeps the extension if the file-name (without the extension) becomes duplicated with another.
    void
    setNamer(FileNamer namer)
     
    void
    setPreserveExtensionIfDuplicate(boolean preserveExtensionIfDuplicate)
    Keeps the extension if the file-name (without the extension) becomes duplicated with another.

    Methods inherited from class org.anchoranalysis.io.input.bean.namer.FileNamer

    deriveName, deriveNameUnique

    Methods inherited from class org.anchoranalysis.bean.AnchorBean

    checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • RemoveExtension

      public RemoveExtension(FileNamer namer)
    • RemoveExtension

      public RemoveExtension()
  • Method Details

    • deriveName

      public List<NamedFile> deriveName(List<File> files, FileNamerContext context)
      Specified by:
      deriveName in class FileNamer
    • 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.