Class CopyFilesNaming<T>

Object
org.anchoranalysis.bean.AnchorBean<CopyFilesNaming<T>>
org.anchoranalysis.plugin.io.bean.file.copy.naming.CopyFilesNaming<T>
Type Parameters:
T - shared-state
Direct Known Subclasses:
Anonymize, ClusterByTimestamp, CopyFilesNamingWithoutSharedState

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

  • Method Details

    • beforeCopying

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

      public Optional<Path> destinationPath​(File file, org.anchoranalysis.io.output.path.prefixer.DirectoryWithPrefix outputTarget, int index, CopyContext<T> context) throws org.anchoranalysis.io.output.error.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:
      org.anchoranalysis.io.output.error.OutputWriteFailedException
    • destinationPathRelative

      public abstract Optional<Path> destinationPathRelative​(File file, org.anchoranalysis.io.output.path.prefixer.DirectoryWithPrefix outputTarget, int index, CopyContext<T> context) throws org.anchoranalysis.io.output.error.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:
      org.anchoranalysis.io.output.error.OutputWriteFailedException