Class RemoveExtension

Object
org.anchoranalysis.bean.AnchorBean<org.anchoranalysis.io.input.bean.namer.FileNamer>
org.anchoranalysis.io.input.bean.namer.FileNamer
org.anchoranalysis.plugin.io.bean.file.namer.RemoveExtension

public class RemoveExtension
extends org.anchoranalysis.io.input.bean.namer.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()  
    RemoveExtension​(org.anchoranalysis.io.input.bean.namer.FileNamer namer)  
  • Method Summary

    Modifier and Type Method Description
    List<org.anchoranalysis.io.input.file.NamedFile> deriveName​(List<File> files, org.anchoranalysis.io.input.file.FileNamerContext context)  
    org.anchoranalysis.io.input.bean.namer.FileNamer getNamer()  
    boolean isPreserveExtensionIfDuplicate()
    Keeps the extension if the file-name (without the extension) becomes duplicated with another.
    void setNamer​(org.anchoranalysis.io.input.bean.namer.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

  • Method Details

    • deriveName

      public List<org.anchoranalysis.io.input.file.NamedFile> deriveName​(List<File> files, org.anchoranalysis.io.input.file.FileNamerContext context)
      Specified by:
      deriveName in class org.anchoranalysis.io.input.bean.namer.FileNamer
    • getNamer

      public org.anchoranalysis.io.input.bean.namer.FileNamer getNamer()
    • setNamer

      public void setNamer​(org.anchoranalysis.io.input.bean.namer.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.