Class OutputPrefixWithExtension

Object
AnchorBean<CopyFilesNaming<NoSharedState>>
CopyFilesNaming<NoSharedState>
CopyFilesNamingWithoutSharedState
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 Details

    • OutputPrefixWithExtension

      public OutputPrefixWithExtension()
  • Method Details

    • destinationPathRelative

      public Optional<Path> destinationPathRelative(File file, DirectoryWithPrefix outputTarget, int index, CopyContext<NoSharedState> context) throws OutputWriteFailedException
      Description copied from class: CopyFilesNaming
      Calculates the relative-output path (to be appended to destDir)
      Specified by:
      destinationPathRelative in class CopyFilesNaming<NoSharedState>
      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