Interface WorkingDirectoryDestroyer

  • Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface WorkingDirectoryDestroyer
    A strategy interface to destroy the working directory.
    Since:
    4.0.0
    Author:
    Dmytro Nosan
    See Also:
    deleteAll(), deleteOnly(String...), doNothing()
    • Method Detail

      • deleteAll

        static WorkingDirectoryDestroyer deleteAll()
        Completely deletes the working directory.
        Returns:
        a new working directory destroyer
      • deleteOnly

        static WorkingDirectoryDestroyer deleteOnly​(String... paths)
        Deletes the provided paths in the working directory.
        Parameters:
        paths - paths within the working directory. (e.g. lib, bin, tools, conf/cassandra.yaml)
        Returns:
        a new working directory destroyer
      • doNothing

        static WorkingDirectoryDestroyer doNothing()
        Do nothing to the working directory. In other words, just skips it.
        Returns:
        a new working directory destroyer
      • destroy

        void destroy​(Path workingDirectory,
                     Version version)
              throws IOException
        Destroys the working directory.
        Parameters:
        workingDirectory - working directory
        version - Cassandra version
        Throws:
        IOException - an I/O error occurs