public class OutputPrefixWithExtension extends CopyFilesNamingWithoutSharedState
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.
Constructor and Description |
---|
OutputPrefixWithExtension() |
Modifier and Type | Method and Description |
---|---|
Optional<Path> |
destinationPathRelative(File file,
DirectoryWithPrefix outputTarget,
int index,
CopyContext<NoSharedState> context)
Calculates the relative-output path (to be appended to destDir)
|
beforeCopying
destinationPath
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
public Optional<Path> destinationPathRelative(File file, DirectoryWithPrefix outputTarget, int index, CopyContext<NoSharedState> context) throws OutputWriteFailedException
CopyFilesNaming
destinationPathRelative
in class CopyFilesNaming<NoSharedState>
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 copyingOutputWriteFailedException
Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.