Class CollapseFileName

Object
AnchorBean<DerivePath>
DerivePath
CollapseFileName

public class CollapseFileName extends DerivePath
Removes the file-name from a path, but keeps the directories and preserves the file-extension.

Specifically, a file-path of form somedirectory/somename.ext and converts to somedirectory.ext.

Author:
Owen Feehan
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    deriveFrom(Path source, boolean debugMode)
     
    DerivePath
    Called as a delegate to provide a source Path.
    boolean
    When true, the extension is appended to the directory.
    void
    setDerivePath(DerivePath derivePath)
    Called as a delegate to provide a source Path.
    void
    setKeepExtension(boolean keepExtension)
    When true, the extension is appended to the directory.

    Methods inherited from class org.anchoranalysis.io.input.bean.path.DerivePath

    deriveFrom

    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

    • CollapseFileName

      public CollapseFileName()
  • Method Details

    • deriveFrom

      public Path deriveFrom(Path source, boolean debugMode) throws DerivePathException
      Specified by:
      deriveFrom in class DerivePath
      Throws:
      DerivePathException
    • getDerivePath

      public DerivePath getDerivePath()
      Called as a delegate to provide a source Path.
    • setDerivePath

      public void setDerivePath(DerivePath derivePath)
      Called as a delegate to provide a source Path.
    • isKeepExtension

      public boolean isKeepExtension()
      When true, the extension is appended to the directory.
    • setKeepExtension

      public void setKeepExtension(boolean keepExtension)
      When true, the extension is appended to the directory.