Class DirectoryStructure


public class DirectoryStructure extends PathPrefixerAvoidResolve
Reuses the directories between a path and its root to form the output - and also the filename.

e.g. for a path=

/a/b/c/d/e.tif
and root=
/a/b
then the prefix would be
c/d/e/
Author:
Owen Feehan
  • Constructor Details

    • DirectoryStructure

      public DirectoryStructure()
  • Method Details

    • outFilePrefixFromPath

      public DirectoryWithPrefix outFilePrefixFromPath(NamedPath path, Path root, PathPrefixerContext context) throws PathPrefixerException
      Description copied from class: PathPrefixerAvoidResolve
      Determines the out-file prefix from a path.
      Specified by:
      outFilePrefixFromPath in class PathPrefixerAvoidResolve
      Parameters:
      path - path to calculate prefix from with associated descriptive-name
      root - root of prefix
      context - the path-prefixer context.
      Returns:
      folder/filename for prefixing.
      Throws:
      PathPrefixerException - if a prefix cannot be successfully derived.
    • isIncludeDirectories

      public boolean isIncludeDirectories()
      If false, the folders are ignored, and only the file-name is used in the output
    • setIncludeDirectories

      public void setIncludeDirectories(boolean includeDirectories)
      If false, the folders are ignored, and only the file-name is used in the output
    • getPrefixToRemove

      public String getPrefixToRemove()
    • setPrefixToRemove

      public void setPrefixToRemove(String prefixToRemove)