org.crosswire.common.util

## Class FileUtil

- java.lang.Object
- - org.crosswire.common.util.FileUtil

-     public final class FileUtil
      extends Object

  .
  Author:
    Joe Walker
  See Also:
    `The GNU Lesser General Public License for details.`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `EXTENSION_JAVA` Extension for java files
    `static String` | `EXTENSION_PLUGIN` Extension for plug-in files
    `static String` | `EXTENSION_PROPERTIES` Extension for properties files
    `static String` | `EXTENSION_XML` Extension for XML files
    `static String` | `EXTENSION_XSLT` Extension for XSLT files
    `static String` | `MODE_READ` Modes for opening random access files
    `static String` | `MODE_WRITE` Modes for opening random access files

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `private` | `FileUtil()` Prevent instantiation

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static List<File>` | `delete(File file)` Deletes a file or a directory and all of its contents
    `private static void` | `deleteContents(File dirPath, List<File> failures)` Recursive delete files.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### EXTENSION_JAVA

          public static final String EXTENSION_JAVA

      Extension for java files
      See Also:
        Constant Field Values

    - #### EXTENSION_PROPERTIES

          public static final String EXTENSION_PROPERTIES

      Extension for properties files
      See Also:
        Constant Field Values

    - #### EXTENSION_PLUGIN

          public static final String EXTENSION_PLUGIN

      Extension for plug-in files
      See Also:
        Constant Field Values

    - #### EXTENSION_XSLT

          public static final String EXTENSION_XSLT

      Extension for XSLT files
      See Also:
        Constant Field Values

    - #### EXTENSION_XML

          public static final String EXTENSION_XML

      Extension for XML files
      See Also:
        Constant Field Values

    - #### MODE_READ

          public static final String MODE_READ

      Modes for opening random access files
      See Also:
        Constant Field Values

    - #### MODE_WRITE

          public static final String MODE_WRITE

      Modes for opening random access files
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### FileUtil

          private FileUtil()

      Prevent instantiation

  - ### Method Detail

    - #### delete

          public static List<File> delete(File file)

      Deletes a file or a directory and all of its contents
      Parameters:
        `file` - or directory to delete
      Returns:
        the list of files that could not be deleted

    - #### deleteContents

          private static void deleteContents(File dirPath,
                            List<File> failures)

      Recursive delete files.
      Parameters:
        `dirPath` - directory of files to delete
        `failures` - the list of files that could not be deleted