public final class IOUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T extends AutoCloseable> |
closeAll(Collection<T> closeables)
Closes given
collection of closeables. |
static <T extends AutoCloseable> |
closeAll(T... closeables)
Closes given array of
closeables. |
static <T extends AutoCloseable> |
closeAllSilently(Collection<T> closeables)
Closes given
collection of closeables ignoring all exceptions. |
static <T extends AutoCloseable> |
closeAllSilently(T... closeables)
Closes given array of
closeables ignoring all exceptions. |
public static <T extends AutoCloseable> void closeAll(Collection<T> closeables) throws IOException
collection of closeables.T - the type of closeablecloseables - the closeables to closeIOExceptioncloseAll(AutoCloseable[])public static <T extends AutoCloseable> void closeAllSilently(Collection<T> closeables)
collection of closeables ignoring all exceptions.T - the type of closeablecloseables - the closeables to closecloseAll(AutoCloseable[])@SafeVarargs public static <T extends AutoCloseable> void closeAll(T... closeables) throws IOException
closeables. If any AutoCloseable.close() call throws
IOException than it will be rethrown to the caller after calling AutoCloseable.close()
on other given resources. If more than one AutoCloseable.close() throw than resulting exception will
have suppressed exceptions. See Throwable.addSuppressed(Throwable)T - the type of closeablecloseables - the closeables to closeIOException@SafeVarargs public static <T extends AutoCloseable> void closeAllSilently(T... closeables)
closeables ignoring all exceptions.T - the type of closeablecloseables - the closeables to closeCopyright © 2002–2016 The Neo4j Graph Database Project. All rights reserved.