org.apache.ode.utils.fs

## Class FileUtils

- java.lang.Object
- - org.apache.ode.utils.fs.FileUtils

-     public class FileUtils
      extends java.lang.Object

  Various file system utilities.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FileUtils()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static boolean` | `deepDelete(java.io.File file)` Delete a file/directory, recursively.
    `static java.util.List<java.io.File>` | `directoryEntriesInPath(java.io.File rootDirectory)` Recursively collect all Files in the given directory and all its subdirectories.
    `static java.util.List<java.io.File>` | `directoryEntriesInPath(java.io.File rootDirectory, java.io.FileFilter filter)` Recursively collect all Files in the given directory and all its subdirectories, applying the given FileFilter.
    `static java.lang.String` | `encodePath(java.lang.String path)`
    `static boolean` | `isAbsolute(java.lang.String path)` Test if the given path is absolute or not.
    `static boolean` | `isRelative(java.lang.String path)` Test if the given path is relative or absolute.
    `static void` | `main(java.lang.String[] args)`

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

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

- - ### Constructor Detail

    - #### FileUtils

          public FileUtils()

  - ### Method Detail

    - #### isAbsolute

          public static boolean isAbsolute(java.lang.String path)

      Test if the given path is absolute or not.
      Parameters:
        `path` -
      Returns:
        true is absolute
      See Also:
        `File.isAbsolute()`

    - #### isRelative

          public static boolean isRelative(java.lang.String path)

      Test if the given path is relative or absolute.
      Parameters:
        `path` -
      Returns:
        true is relative
      See Also:
        `File.isAbsolute()`

    - #### deepDelete

          public static boolean deepDelete(java.io.File file)

      Delete a file/directory, recursively.
      Parameters:
        `file` - file/directory to delete
      Returns:
        `true` if successful

    - #### directoryEntriesInPath

          public static java.util.List<java.io.File> directoryEntriesInPath(java.io.File rootDirectory)

      Recursively collect all Files in the given directory and all its subdirectories.
      Parameters:
        `rootDirectory` - the top level directory used for the search
      Returns:
        a List of found Files

    - #### directoryEntriesInPath

          public static java.util.List<java.io.File> directoryEntriesInPath(java.io.File rootDirectory,
                                                            java.io.FileFilter filter)

      Recursively collect all Files in the given directory and all its subdirectories, applying the given FileFilter. The FileFilter is also applied to the given rootDirectory. As a result the rootDirectory might be in the returned list.

      Returned files are ordered lexicographically but for each directory, files come before its sudirectories. For instance:
      test
      test/alpha.txt
      test/zulu.txt
      test/a
      test/a/alpha.txt
      test/z
      test/z/zulu.txt

      instead of:
      test
      test/a
      test/a/alpha.txt
      test/alpha.txt
      test/z
      test/z/zulu.txt
      test/zulu.txt

      Parameters:
        `rootDirectory` - the top level directory used for the search
        `filter` - a FileFilter used for accepting/rejecting individual entries
      Returns:
        a List of found Files

    - #### encodePath

          public static java.lang.String encodePath(java.lang.String path)

    - #### main

          public static void main(java.lang.String[] args)