com.tibbo.aggregate.common.util

## Class FileUtils

- java.lang.Object
- - com.tibbo.aggregate.common.util.FileUtils

-     public class FileUtils
      extends java.lang.Object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `BACKUP_FILE_PREFIX`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `FileUtils()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `copyFile(java.io.File source, java.io.File destination)`
    `static void` | `deleteDirectories(java.nio.file.Path directoryPath)`
    `static boolean` | `deleteDirectory(java.io.File dir)` Deprecated.
    `static java.lang.String` | `getExtension(java.io.File f)`
    `static java.lang.String` | `getExtension(java.lang.String fileName)`
    `static java.lang.Long` | `makeChecksumAdler32(java.io.File f)`
    `static java.lang.Long` | `makeChecksumAdler32(java.io.InputStream in)`
    `static java.lang.String` | `pathToBackupFileFor(java.lang.String filePath)`
    `static byte[]` | `readFile(java.io.File file)`
    `static byte[]` | `readFile(java.nio.file.Path path)`
    `static java.lang.String` | `readTextFile(java.nio.file.Path path)`
    `static java.lang.String` | `readTextFile(java.nio.file.Path path, java.nio.charset.Charset encoding)`
    `static java.lang.String` | `readTextFile(java.lang.String filename)` Deprecated.
    `static java.lang.String` | `readTextFile(java.lang.String filename, java.nio.charset.Charset encoding)` Deprecated.
    `static void` | `writeAtomic(java.lang.String data, java.io.File file)`
    `static void` | `writeAtomic(java.lang.String data, java.io.File file, boolean preserveBackup)`
    `static void` | `writeFile(java.io.File file, byte[] data)`
    `static void` | `writeFile(java.nio.file.Path path, byte[] data)`
    `static void` | `writeTextFile(java.nio.file.Path path, java.lang.String contents, boolean append)`

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

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

- - ### Field Detail

    - #### BACKUP_FILE_PREFIX

          public static final java.lang.String BACKUP_FILE_PREFIX

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### FileUtils

          public FileUtils()

  - ### Method Detail

    - #### pathToBackupFileFor

          public static java.lang.String pathToBackupFileFor(java.lang.String filePath)

    - #### writeAtomic

          public static void writeAtomic(java.lang.String data,
                                         java.io.File file)
                                  throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### writeAtomic

          public static void writeAtomic(java.lang.String data,
                                         java.io.File file,
                                         boolean preserveBackup)
                                  throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### deleteDirectories

          public static void deleteDirectories(@Nonnull
                                               java.nio.file.Path directoryPath)
                                        throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### readTextFile

          public static java.lang.String readTextFile(@Nonnull
                                                      java.nio.file.Path path)
                                               throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### readTextFile

          public static java.lang.String readTextFile(@Nonnull
                                                      java.nio.file.Path path,
                                                      @Nonnull
                                                      java.nio.charset.Charset encoding)
                                               throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### deleteDirectory

          @Deprecated
          public static boolean deleteDirectory(java.io.File dir)

      Deprecated.

    - #### readTextFile

          @Deprecated
          public static java.lang.String readTextFile(java.lang.String filename)
                                                            throws java.io.IOException

      Deprecated.
      Throws:
        `java.io.IOException`

    - #### readTextFile

          @Deprecated
          public static java.lang.String readTextFile(java.lang.String filename,
                                                                   java.nio.charset.Charset encoding)
                                                            throws java.io.IOException

      Deprecated.
      Throws:
        `java.io.IOException`

    - #### writeTextFile

          public static void writeTextFile(java.nio.file.Path path,
                                           java.lang.String contents,
                                           boolean append)
                                    throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### readFile

          public static byte[] readFile(java.nio.file.Path path)
                                 throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### readFile

          public static byte[] readFile(java.io.File file)
                                 throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### writeFile

          public static void writeFile(java.nio.file.Path path,
                                       byte[] data)
                                throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### writeFile

          public static void writeFile(java.io.File file,
                                       byte[] data)
                                throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### copyFile

          public static void copyFile(java.io.File source,
                                      java.io.File destination)
                               throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### getExtension

          public static java.lang.String getExtension(java.io.File f)

    - #### getExtension

          public static java.lang.String getExtension(java.lang.String fileName)

    - #### makeChecksumAdler32

          public static java.lang.Long makeChecksumAdler32(java.io.File f)
                                                    throws java.io.FileNotFoundException

      Throws:
        `java.io.FileNotFoundException`

    - #### makeChecksumAdler32

          public static java.lang.Long makeChecksumAdler32(java.io.InputStream in)