org.hibernate.search.util.impl

## Class Closeables

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

-     public final class Closeables
      extends Object

  Author:
    Yoann Rodiere

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <E extends Exception> void` | `close(Iterable<? extends GenericCloseable<? extends E>> closeables)` Close multiple resources, ensuring that all resources get closed even if one of them throws a Throwable.
    `static void` | `closeQuietly(Closeable resource)` Close a resource without throwing an exception.
    `static void` | `closeQuietly(Iterable<? extends Closeable>... resourceIterables)` Close resources without throwing an exception.

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

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

- - ### Method Detail

    - #### close

          public static <E extends Exception> void close(Iterable<? extends GenericCloseable<? extends E>> closeables)
                                                  throws E extends Exception

      Close multiple resources, ensuring that all resources get closed even if one of them throws a Throwable.

      The first caught throwable will be re-thrown, and any additional throwable will be `suppressed`.

      Parameters:
        `closeables` - The resources to close
      Throws:
        `E` - if a closeable throws such an exception
        `E extends Exception`

    - #### closeQuietly

          public static void closeQuietly(Closeable resource)

      Close a resource without throwing an exception.
      Parameters:
        `resource` - the resource to close

    - #### closeQuietly

          @SafeVarargs
          public static void closeQuietly(Iterable<? extends Closeable>... resourceIterables)

      Close resources without throwing an exception.
      Parameters:
        `resourceIterables` - the iterables containing the resources to close

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