Class OutputPrefixWithExtension
Copies files using whatever prefix is assigned to an input by the
OutputManager
as the
file-name, adding the same extension as the source file.
An extension is added, based on whatever extension already exists on the file.
The prefix must be guaranteed to be unique for each file copied. This is not actively checked.
The prefix is usually derived from the name of the input file relative to the input-directory,
so behavior is often similar to PreserveName
. However, other naming-schemes are also
possible e.g. assigning a sequence of numbers to each input.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondestinationPathRelative
(File file, DirectoryWithPrefix outputTarget, int index, CopyContext<NoSharedState> context) Calculates the relative-output path (to be appended to destDir)Methods inherited from class org.anchoranalysis.plugin.io.bean.file.copy.naming.CopyFilesNamingWithoutSharedState
beforeCopying
Methods inherited from class org.anchoranalysis.plugin.io.bean.file.copy.naming.CopyFilesNaming
destinationPath
Methods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Constructor Details
-
OutputPrefixWithExtension
public OutputPrefixWithExtension()
-
-
Method Details
-
destinationPathRelative
public Optional<Path> destinationPathRelative(File file, DirectoryWithPrefix outputTarget, int index, CopyContext<NoSharedState> context) throws OutputWriteFailedException Description copied from class:CopyFilesNaming
Calculates the relative-output path (to be appended to destDir)- Specified by:
destinationPathRelative
in classCopyFilesNaming<NoSharedState>
- Parameters:
file
- file to be copiedoutputTarget
- the directory and prefix associated with the file for outputtingindex
- an increasing sequence of numbers for each file beginning at 0context
- the context for the copying- Returns:
- the relative-path. if empty, the file should be skipped.
- Throws:
OutputWriteFailedException
-