org.hibernate.search.util.impl

## Class FileHelper

- java.lang.Object
- - org.hibernate.search.util.impl.FileHelper

-     public class FileHelper
      extends Object

  Utility class for file and directory operations, like synchronisation and reading from class path.
  Author:
    Emmanuel Bernard, Sanne Grinovero, Hardy Ferentschik

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static boolean` | `areInSync(Path source, Path destination)`
    `static void` | `delete(Path path)` Deletes a file.
    `static void` | `synchronize(Path source, Path destination, boolean smart)`
    `static void` | `tryDelete(Path path)` Attempts to delete a file.

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

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

- - ### Method Detail

    - #### areInSync

          public static boolean areInSync(Path source,
                                          Path destination)
                                   throws IOException

      Throws:
        `IOException`

    - #### synchronize

          public static void synchronize(Path source,
                                         Path destination,
                                         boolean smart)
                                  throws IOException

      Throws:
        `IOException`

    - #### delete

          public static void delete(Path path)
                             throws IOException

      Deletes a file. If the file is a directory delete recursively all content.
      Parameters:
        `path` - the file or directory to be deleted
      Throws:
        `IOException` - if it wasn't possible to delete all content.

    - #### tryDelete

          public static void tryDelete(Path path)
                                throws IOException

      Attempts to delete a file. If the file is a directory delete recursively all content. Any IOException preventing a file to be deleted will be swallowed.
      Parameters:
        `path` - the file or directory to be deleted
      Throws:
        `IOException` - on unexpected io errors

Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved