Class DirectoryCreationParameters

Object
DirectoryCreationParameters

public final class DirectoryCreationParameters extends Object
Options that influence how an output directory is created.
Author:
Owen Feehan
  • Constructor Details

    • DirectoryCreationParameters

      public DirectoryCreationParameters()
      Creates to not delete directories, and with no consumer called upon directory creation.
    • DirectoryCreationParameters

      public DirectoryCreationParameters(boolean deleteExistingDirectory, Optional<Consumer<Path>> callUponDirectoryCreation)
      Creates a new DirectoryCreationParameters instance.
      Parameters:
      deleteExistingDirectory - When true, this will delete any existing directory with the same path, and then create it anew.

      When false, an exception is thrown if an existing directory with the same path already exists.

      callUponDirectoryCreation - When defined, this consumer is called when the directory is first created, as it is created lazily only when first needed.

      It is called with the path of the directory as an argument.

  • Method Details

    • isDeleteExistingDirectory

      public boolean isDeleteExistingDirectory()
      When true, this will delete any existing directory with the same path, and then create it anew.

      When false, an exception is thrown if an existing directory with the same path already exists.

    • getCallUponDirectoryCreation

      public Optional<Consumer<Path>> getCallUponDirectoryCreation()
      When defined, this consumer is called when the directory is first created, as it is created lazily only when first needed.

      It is called with the path of the directory as an argument.

    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object