Class TemporaryFilesystem


  • public class TemporaryFilesystem
    extends java.lang.Object
    A wrapper around temporary filesystem behaviour.
    • Method Detail

      • setTemporaryDirectory

        public static void setTemporaryDirectory​(java.io.File directory)
      • getTmpFsBasedOn

        public static TemporaryFilesystem getTmpFsBasedOn​(java.io.File directory)
      • createTempDir

        public java.io.File createTempDir​(java.lang.String prefix,
                                          java.lang.String suffix)
        Create a temporary directory, and track it for deletion.
        Parameters:
        prefix - the prefix to use when creating the temporary directory
        suffix - the suffix to use when creating the temporary directory
        Returns:
        the temporary directory to create
      • deleteTempDir

        public void deleteTempDir​(java.io.File file)
        Delete a temporary directory that we were responsible for creating.
        Parameters:
        file - the file to delete
      • deleteTemporaryFiles

        public void deleteTemporaryFiles()
        Perform the operation that a shutdown hook would have.
      • deleteBaseDir

        public boolean deleteBaseDir()