Class FileRemover


  • public class FileRemover
    extends Object
    Author:
    Eugene Petrenko Created: 18.11.2008 20:46:09
    • Method Detail

      • isInterrupted

        protected boolean isInterrupted()
      • isTooManyErrors

        public boolean isTooManyErrors()
      • doDelete

        public boolean doDelete​(@NotNull
                                File file,
                                boolean makeCanonicalFirst)
      • setErrorThreshold

        public static void setErrorThreshold​(int maxErrorsNum)
      • doDelete

        public boolean doDelete​(@NotNull
                                File file,
                                boolean makeCanonicalFirst,
                                boolean deleteSelf)
      • getFilesComparer

        @NotNull
        protected Comparator<File> getFilesComparer()
      • deleteDirNative

        public static boolean deleteDirNative​(@NotNull
                                              File dir)
                                       throws ExecutionException
        Deletes dir using native command rd for windows and rm for *nix
        Parameters:
        dir - - dir to delete
        Returns:
        true, if delete process returned 0 and target dir doesn't exist anymore, false otherwise
        Throws:
        ExecutionException