Class PatternSpan
Finds a pattern in the file-path, and uses a portion of the file-path in that pattern to form the
name.
The portion used spans from the first variable to the last-variable in the pattern, including any non-variable portions of the file-path.
In the special case that a single file is passed, its filename is extracted without any extension.
- 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.boolean
Iff true, a case sensitive search is used to match patterns.void
setCaseSensitive
(boolean caseSensitive) Iff true, a case sensitive search is used to match patterns.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
-
PatternSpan
public PatternSpan()
-
-
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.
-
isCaseSensitive
public boolean isCaseSensitive()Iff true, a case sensitive search is used to match patterns. -
setCaseSensitive
public void setCaseSensitive(boolean caseSensitive) Iff true, a case sensitive search is used to match patterns.
-