| Modifier and Type | Method and Description |
|---|---|
static void |
close(Closeable... closeables)
Closes the given Closeables and collects all occurring exceptions as
suppressed exception to the exception that occurred first.
|
static void |
close(Iterable<? extends Closeable> closeables)
Closes the given Closeables and collects all occurring exceptions as
suppressed exception to the exception that occurred first.
|
static boolean |
safeClose(Closeable c)
Closes the given
Closeable and logs any error that occurs. |
static boolean |
safeCloseAll(Closeable... closeables)
Closes all of the given
Closeables by calling
safeClose(Closeable) for each element in the array. |
static boolean |
safeCloseAll(Iterable<? extends Closeable> closeables)
Closes all of the given
Closeables by calling
safeClose(Closeable) for each element returned by the Iterable. |
public static void close(Closeable... closeables) throws IOException
closeables - The Closeables to close.IOException - If any of them throws an IOException.public static void close(Iterable<? extends Closeable> closeables) throws IOException
closeables - The Closeables to close.IOException - If any of them throws an IOException.public static boolean safeClose(Closeable c)
Closeable and logs any error that occurs.c - The Closeable. Might be null.null and its Closeable.close() method did
not throw an exception.public static boolean safeCloseAll(Closeable... closeables)
Closeables by calling
safeClose(Closeable) for each element in the array.closeables - The array of Closeables.public static boolean safeCloseAll(Iterable<? extends Closeable> closeables)
Closeables by calling
safeClose(Closeable) for each element returned by the Iterable.closeables - The of Closeables.Copyright © 2014–2015. All rights reserved.