Class OutputPrefixWithExtension
Object
org.anchoranalysis.bean.AnchorBean<CopyFilesNaming<T>>
org.anchoranalysis.plugin.io.bean.file.copy.naming.CopyFilesNaming<org.anchoranalysis.experiment.task.NoSharedState>
org.anchoranalysis.plugin.io.bean.file.copy.naming.CopyFilesNamingWithoutSharedState
org.anchoranalysis.plugin.io.bean.file.copy.naming.OutputPrefixWithExtension
public class OutputPrefixWithExtension extends CopyFilesNamingWithoutSharedState
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 Constructor Description OutputPrefixWithExtension() -
Method Summary
Modifier and Type Method Description Optional<Path>destinationPathRelative(File file, org.anchoranalysis.io.output.path.prefixer.DirectoryWithPrefix outputTarget, int index, CopyContext<org.anchoranalysis.experiment.task.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
beforeCopyingMethods inherited from class org.anchoranalysis.plugin.io.bean.file.copy.naming.CopyFilesNaming
destinationPath
-
Constructor Details
-
OutputPrefixWithExtension
public OutputPrefixWithExtension()
-
-
Method Details
-
destinationPathRelative
public Optional<Path> destinationPathRelative(File file, org.anchoranalysis.io.output.path.prefixer.DirectoryWithPrefix outputTarget, int index, CopyContext<org.anchoranalysis.experiment.task.NoSharedState> context) throws org.anchoranalysis.io.output.error.OutputWriteFailedExceptionDescription copied from class:CopyFilesNamingCalculates the relative-output path (to be appended to destDir)- Specified by:
destinationPathRelativein classCopyFilesNaming<org.anchoranalysis.experiment.task.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:
org.anchoranalysis.io.output.error.OutputWriteFailedException
-