Class CollapseFileName
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 -
Method Summary
Modifier and TypeMethodDescriptionderiveFrom(Path source, boolean debugMode) Derives a new path from an existing path.Called as a delegate to provide asourcePath.booleanWhen true, the extension is appended to the directory.voidsetDerivePath(DerivePath derivePath) Called as a delegate to provide asourcePath.voidsetKeepExtension(boolean keepExtension) When true, the extension is appended to the directory.Methods inherited from class org.anchoranalysis.io.input.bean.path.DerivePath
deriveFromMethods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Constructor Details
-
CollapseFileName
public CollapseFileName()
-
-
Method Details
-
deriveFrom
Description copied from class:DerivePathDerives a new path from an existing path.- Specified by:
deriveFromin classDerivePath- 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
Called as a delegate to provide asourcePath. -
setDerivePath
Called as a delegate to provide asourcePath. -
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.
-