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 asource
Path
.boolean
When true, the extension is appended to the directory.void
setDerivePath
(DerivePath derivePath) Called as a delegate to provide asource
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
-
Constructor Details
-
CollapseFileName
public CollapseFileName()
-
-
Method Details
-
deriveFrom
Description copied from class:DerivePath
Derives a new path from an existing path.- Specified by:
deriveFrom
in 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 asource
Path
. -
setDerivePath
Called as a delegate to provide asource
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.
-