Class RemoveExtension
Removes extensions from the identifier (but not from the file) and only if the extension
hasn't already been removed upstream.
As an exception, the extension can be retained if there is more than one file with the same identifier.
To check if the extension has already been removed upstream, a check occurs if the path ends with the identifier.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionderiveName
(List<File> files, FileNamerContext context) Derives a list of names (associated with each file) for some files.getNamer()
boolean
Keeps the extension if the file-name (without the extension) becomes duplicated with another.void
void
setPreserveExtensionIfDuplicate
(boolean preserveExtensionIfDuplicate) Keeps the extension if the file-name (without the extension) becomes duplicated with another.Methods inherited from class org.anchoranalysis.io.input.bean.namer.FileNamer
deriveName, deriveNameUnique
Methods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Constructor Details
-
RemoveExtension
-
RemoveExtension
public RemoveExtension()
-
-
Method Details
-
deriveName
Description copied from class:FileNamer
Derives a list of names (associated with each file) for some files.- Specified by:
deriveName
in classFileNamer
- Parameters:
files
- the files to describe.context
- additional context for naming.- Returns:
- a list of identical size and order to files, corresponding to the file the extracted name.
-
getNamer
-
setNamer
-
isPreserveExtensionIfDuplicate
public boolean isPreserveExtensionIfDuplicate()Keeps the extension if the file-name (without the extension) becomes duplicated with another. -
setPreserveExtensionIfDuplicate
public void setPreserveExtensionIfDuplicate(boolean preserveExtensionIfDuplicate) Keeps the extension if the file-name (without the extension) becomes duplicated with another.
-