Class CopyFilesNaming<T>

Object
AnchorBean<CopyFilesNaming<T>>
CopyFilesNaming<T>
Type Parameters:
T - shared-state
Direct Known Subclasses:
Anonymize, ClusterByTimestamp, CopyFilesNamingWithoutSharedState

public abstract class CopyFilesNaming<T> extends AnchorBean<CopyFilesNaming<T>>
How an output name (and path) is selected for an input file when copying.
Author:
Owen Feehan
  • Constructor Details

    • CopyFilesNaming

      public CopyFilesNaming()
  • Method Details

    • beforeCopying

      public abstract T beforeCopying(Path destinationDirectory, List<FileWithDirectoryInput> inputs) throws OperationFailedException
      Parameters:
      destinationDirectory - the directory to which files are copied.
      inputs - the total number of files to copy.
      Throws:
      OperationFailedException
    • destinationPath

      public Optional<Path> destinationPath(File file, DirectoryWithPrefix outputTarget, int index, CopyContext<T> context) throws OutputWriteFailedException
      Returns the output path (destination to to be copied to) for a given single file.
      Parameters:
      file - file to be copied
      outputTarget - the directory and prefix associated with the file for outputting
      index - an increasing sequence of numbers for each file beginning at 0
      context - the context for the copying
      Returns:
      the absolute-path. if empty, the file should be skipped.
      Throws:
      OutputWriteFailedException
    • destinationPathRelative

      public abstract Optional<Path> destinationPathRelative(File file, DirectoryWithPrefix outputTarget, int index, CopyContext<T> context) throws OutputWriteFailedException
      Calculates the relative-output path (to be appended to destDir)
      Parameters:
      file - file to be copied
      outputTarget - the directory and prefix associated with the file for outputting
      index - an increasing sequence of numbers for each file beginning at 0
      context - the context for the copying
      Returns:
      the relative-path. if empty, the file should be skipped.
      Throws:
      OutputWriteFailedException