de.vc.io

## Class FileUtil

- java.lang.Object
- - de.vc.io.FileUtil

-     public class FileUtil
      extends java.lang.Object

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `copyFile(java.lang.String fromFile, java.lang.String toFile)`
    `static java.net.URL` | `findFile(java.lang.String path)` Finds a file relative to current working directory or classpath.
    `static java.net.URL` | `findFile(java.lang.String path, java.lang.String systemProperty, boolean updateProperty)` Finds a file thats location might be stored in a system property.
    `static java.net.URL` | `findFile(java.lang.String file, java.net.URL baseFile)` Finds a file thats location might be relative to directory of another file.
    `static java.io.File[]` | `listFiles(java.io.File directory, java.lang.String namePattern, boolean recursive)`

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

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

- - ### Method Detail

    - #### copyFile

          public static final void copyFile(java.lang.String fromFile,
                      java.lang.String toFile)
                                     throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### listFiles

          public static final java.io.File[] listFiles(java.io.File directory,
                                 java.lang.String namePattern,
                                 boolean recursive)

    - #### findFile

          public static java.net.URL findFile(java.lang.String file,
                              java.net.URL baseFile)

      Finds a file thats location might be relative to directory of another file. If a configuration for example file references to another file, the location of the referenced file can be relative to the configuration file. The configuration file is the `baseFile`.
      Parameters:
        `file` - URL or relative path to working directory or classpath.
        `baseFile` - URL
      Returns:
        URL of file or null if not found.

    - #### findFile

          public static java.net.URL findFile(java.lang.String path)

      Finds a file relative to current working directory or classpath. Locations of files are checked in the following order:
      1. path is relative to working directory
      2. path is an URL
      3. path points to file in classpath
      4. path points to file in classpath relative to Environment.class
      Parameters:
        `path` - Path of file.
      Returns:
        URL of file or null if not found.

    - #### findFile

          public static java.net.URL findFile(java.lang.String path,
                              java.lang.String systemProperty,
                              boolean updateProperty)

      Finds a file thats location might be stored in a system property.
      Parameters:
        `path` - URL or relative path to working directory or classpath.
        `systemProperty` - Key of system property.
        `updateProperty` - Update system property.
      Returns:
        URL of file or null if not found.

© 2003-2011 by Sascha Schmidt (vision-cloud.de). All Rights Reserved.