Class 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 Details

    • CollapseFileName

      public CollapseFileName()
  • Method Details

    • deriveFrom

      public Path deriveFrom(Path source, boolean debugMode) throws DerivePathException
      Description copied from class: DerivePath
      Derives a new path from an existing path.
      Specified by:
      deriveFrom in class DerivePath
      Parameters:
      source - the path to derive from.
      debugMode - true if debug-mode is activated
      Returns:
      the derived path.
      Throws:
      DerivePathException - if anything goes wrong
    • 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.