Class FileNamer
- Direct Known Subclasses:
FileNamerIndependent
,IfRelativeToDirectory
,PatternSpan
,RemoveExtension
,SubsetRangeIfRequested
Associates a name (a compact unique identifier) with a file.
The operation can be processed on a single file or a collection of files.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionderiveName
(File file, FileNamerContext context) A name for a file.deriveName
(List<File> files, FileNamerContext context) Derives a list of names (associated with each file) for some files.deriveNameUnique
(List<File> files, FileNamerContext context) LikederiveName(List, FileNamerContext)
but checks that the final list of named-files all have unique names.Methods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Constructor Details
-
FileNamer
public FileNamer()
-
-
Method Details
-
deriveName
A name for a file.- Parameters:
file
- the file to extract a name for.context
- additional context for naming.- Returns:
- the file combined with an extracted name.
-
deriveName
Derives a list of names (associated with each file) for some files.- 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.
-
deriveNameUnique
public List<NamedFile> deriveNameUnique(List<File> files, FileNamerContext context) throws InputReadFailedException LikederiveName(List, FileNamerContext)
but checks that the final list of named-files all have unique names.- 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.
- Throws:
InputReadFailedException
- if more than oneNamedFile
have the same name
-