Class PreserveName
Copies files to maintain the same relative-path from the destination file to the
destination-directory, as existed from the source file to the source-directory.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbeforeCopying
(Path destinationDirectory, List<FileWithDirectoryInput> inputs) To be called once before any calls toCopyFilesNaming.destinationPath(File, DirectoryWithPrefix, int, CopyContext)
.destinationPathRelative
(File file, DirectoryWithPrefix outputTarget, int iter, 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.CopyFilesNaming
destinationPath
Methods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Constructor Details
-
PreserveName
public PreserveName()
-
-
Method Details
-
beforeCopying
Description copied from class:CopyFilesNaming
To be called once before any calls toCopyFilesNaming.destinationPath(File, DirectoryWithPrefix, int, CopyContext)
.- Overrides:
beforeCopying
in classCopyFilesNamingWithoutSharedState
- Parameters:
destinationDirectory
- the directory to which files are copied.inputs
- the total number of files to copy.
-
destinationPathRelative
public Optional<Path> destinationPathRelative(File file, DirectoryWithPrefix outputTarget, int iter, 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 outputtingiter
- 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
-