Class LastDirectories

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

public class LastDirectories
extends org.anchoranalysis.io.input.bean.namer.FileNamerIndependent
Derives a name by taking the filename together with optionally several subdirectories names.

The subdirectory names to use are limited by a certain number, working backwards from the filename to the file-system root.

Author:
Owen Feehan
  • Constructor Summary

    Constructors 
    Constructor Description
    LastDirectories()  
    LastDirectories​(int numberSubdirectories)
    Creates for a particular number of subdirectories.
  • Method Summary

    Modifier and Type Method Description
    void checkMisconfigured​(org.anchoranalysis.bean.BeanInstanceMap defaultInstances)  
    protected String deriveName​(File file, Optional<Path> inputDirectory, int index)  
    int getNumberSubdirectories()
    How many directories to include in the name.
    int getSkipNumberSubdirectories()
    Initially skip this number of directories before including them in the description.
    boolean isRemoveExtensionInDescription()
    Whether to remove the file-extension from the filename.
    boolean isSkipFileName()
    Iff true the filename is not considered, only the subdirectories.
    void setNumberSubdirectories​(int numberSubdirectories)
    How many directories to include in the name.
    void setRemoveExtensionInDescription​(boolean removeExtensionInDescription)
    Whether to remove the file-extension from the filename.
    void setSkipFileName​(boolean skipFileName)
    Iff true the filename is not considered, only the subdirectories.
    void setSkipNumberSubdirectories​(int skipNumberSubdirectories)
    Initially skip this number of directories before including them in the description.

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

    deriveName

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

    deriveName, deriveNameUnique

    Methods inherited from class org.anchoranalysis.bean.AnchorBean

    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

    • LastDirectories

      public LastDirectories​(int numberSubdirectories)
      Creates for a particular number of subdirectories.
      Parameters:
      numberSubdirectories - the number of subdirectories
    • LastDirectories

      public LastDirectories()
  • Method Details

    • checkMisconfigured

      public void checkMisconfigured​(org.anchoranalysis.bean.BeanInstanceMap defaultInstances) throws org.anchoranalysis.bean.exception.BeanMisconfiguredException
      Overrides:
      checkMisconfigured in class org.anchoranalysis.bean.AnchorBean<org.anchoranalysis.io.input.bean.namer.FileNamer>
      Throws:
      org.anchoranalysis.bean.exception.BeanMisconfiguredException
    • deriveName

      protected String deriveName​(File file, Optional<Path> inputDirectory, int index)
      Specified by:
      deriveName in class org.anchoranalysis.io.input.bean.namer.FileNamerIndependent
    • getNumberSubdirectories

      public int getNumberSubdirectories()
      How many directories to include in the name.

      This refers to the last-most sub-directories i.e. working backwards from the filename to the file-system root.

    • setNumberSubdirectories

      public void setNumberSubdirectories​(int numberSubdirectories)
      How many directories to include in the name.

      This refers to the last-most sub-directories i.e. working backwards from the filename to the file-system root.

    • isRemoveExtensionInDescription

      public boolean isRemoveExtensionInDescription()
      Whether to remove the file-extension from the filename.
    • setRemoveExtensionInDescription

      public void setRemoveExtensionInDescription​(boolean removeExtensionInDescription)
      Whether to remove the file-extension from the filename.
    • getSkipNumberSubdirectories

      public int getSkipNumberSubdirectories()
      Initially skip this number of directories before including them in the description.

      This refers to the last-most directories i.e. working backwards from the filename to the file-system root.

    • setSkipNumberSubdirectories

      public void setSkipNumberSubdirectories​(int skipNumberSubdirectories)
      Initially skip this number of directories before including them in the description.

      This refers to the last-most directories i.e. working backwards from the filename to the file-system root.

    • isSkipFileName

      public boolean isSkipFileName()
      Iff true the filename is not considered, only the subdirectories.
    • setSkipFileName

      public void setSkipFileName​(boolean skipFileName)
      Iff true the filename is not considered, only the subdirectories.