org.cybergarage.util

## Class FileUtil

- java.lang.Object
- - org.cybergarage.util.FileUtil

-     public final class FileUtil
      extends Object

  Utility class for file operations and XML file detection. This class provides static methods for loading file contents into byte arrays and checking if files have XML extensions.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FileUtil()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static boolean` | `isXMLFileName(String name)` Checks if a filename has an XML extension.
    `static byte[]` | `load(File file)` Loads the entire contents of a File object into a byte array.
    `static byte[]` | `load(FileInputStream fin)` Loads the entire contents of a FileInputStream into a byte array.
    `static byte[]` | `load(String fileName)` Loads the entire contents of a file into a byte array.

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

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

- - ### Constructor Detail

    - #### FileUtil

          public FileUtil()

  - ### Method Detail

    - #### isXMLFileName

          public static final boolean isXMLFileName(String name)

      Checks if a filename has an XML extension.
      Parameters:
        `name` - the filename to check
      Returns:
        true if the filename ends with ".xml" (case-insensitive), false otherwise

    - #### load

          public static final byte[] load(File file)

      Loads the entire contents of a File object into a byte array.
      Parameters:
        `file` - the File object to load
      Returns:
        the file contents as a byte array, or empty array if an error occurs

    - #### load

          public static final byte[] load(FileInputStream fin)

      Loads the entire contents of a FileInputStream into a byte array.
      Parameters:
        `fin` - the FileInputStream to read from
      Returns:
        the stream contents as a byte array, or empty array if an error occurs

    - #### load

          public static final byte[] load(String fileName)

      Loads the entire contents of a file into a byte array.
      Parameters:
        `fileName` - the path to the file to load
      Returns:
        the file contents as a byte array, or empty array if an error occurs