Class DeleteFileOnExitHook


  • final class DeleteFileOnExitHook
    extends java.lang.Object
    DeleteFileOnExitHook.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.util.Set<java.lang.String> FILES  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void add​(java.lang.String file)
      Add to the hook and clean up when the program exits.
      static boolean checkFileExist​(java.lang.String file)
      Check in the hook files.
      static void remove​(java.lang.String file)
      Remove from the pool to reduce space footprint.
      (package private) static void runHook()
      Clean up all the files.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • FILES

        private static final java.util.Set<java.lang.String> FILES
    • Constructor Detail

      • DeleteFileOnExitHook

        private DeleteFileOnExitHook()
    • Method Detail

      • remove

        public static void remove​(java.lang.String file)
        Remove from the pool to reduce space footprint.
        Parameters:
        file - tmp file path
      • add

        public static void add​(java.lang.String file)
        Add to the hook and clean up when the program exits.
        Parameters:
        file - tmp file path
      • checkFileExist

        public static boolean checkFileExist​(java.lang.String file)
        Check in the hook files.
        Parameters:
        file - target file
        Returns:
        true or false
      • runHook

        static void runHook()
        Clean up all the files.