Class Deleter


  • public class Deleter
    extends Object
    Deletes a file or directory recursively. It does not follow symbolic links in the process.
    Since:
    0.5.0
    Version:
    $Id: Deleter.java 17784 2018-11-19 21:08:09Z colin $
    Author:
    tlerios@marketcetera.com
    • Constructor Detail

      • Deleter

        public Deleter()
    • Method Detail

      • deleteWrap

        private static void deleteWrap​(File file)
                                throws IOException
        Deletes the given file. If the file represents a directory, it must be empty.
        Parameters:
        file - The file.
        Throws:
        IOException - Thrown if an I/O error occurs. It has no message and wraps an I18NException.
      • apply

        public static void apply​(File root)
                          throws I18NException
        Deletes the file tree rooted at the given root. It does not follow symbolic links in the process. The root may be nonexistent (or no-op).
        Parameters:
        root - The root.
        Throws:
        I18NException - Thrown if an I/O error occurs.
      • apply

        public static void apply​(String name)
                          throws I18NException
        Deletes the file tree rooted at the file with the given name. It does not follow symbolic links in the process. The root may be nonexistent (no-op).
        Parameters:
        name - The file name.
        Throws:
        I18NException - Thrown if an I/O error occurs.