public class Closeables extends Object
AutoCloseable at once.| Modifier and Type | Class and Description |
|---|---|
static class |
Closeables.UncheckedCloseException
Unchecked wrapper for checked exceptions thrown during closing a closeable
instance.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
close(AutoCloseable... closeables)
Close the given closeables, throwing the first original exception in case of
an error.
|
static void |
close(Collection<? extends AutoCloseable> closeables)
Close the given closeables, throwing the first original exception in case of
an error.
|
static void |
closeUnchecked(AutoCloseable... closeables)
Close the given closeables, throwing an unchecked exception in case of an
error.
|
static void |
closeUnchecked(Collection<? extends AutoCloseable> closeables)
Close the given closeables, throwing an unchecked exception in case of an
error.
|
public static void closeUnchecked(Collection<? extends AutoCloseable> closeables)
If one of the exceptions thrown is an instance of
InterruptedException, the interrupted state of the current thread
will be set.
closeables - The closeable instances to close. Null elements in
the list are ignored.Closeables.UncheckedCloseException - in case of an errorpublic static void closeUnchecked(AutoCloseable... closeables)
If one of the exceptions thrown is an instance of
InterruptedException, the interrupted state of the current thread
will be set.
closeables - The closeable instances to close. Null elements in
the array are ignored.Closeables.UncheckedCloseException - in case of an errorpublic static void close(Collection<? extends AutoCloseable> closeables) throws Exception
If one of the suppressed exceptions is an instance of
InterruptedException, the interrupted state of the current thread
will be set.
closeables - The closeable instances to close. Null elements in
the list are ignored.Closeables.UncheckedCloseException - in case of an errorExceptionpublic static void close(AutoCloseable... closeables) throws Exception
If one of the suppressed exceptions is an instance of
InterruptedException, the interrupted state of the current thread
will be set.
closeables - The closeable instances to close. Null elements in
the array are ignored.Closeables.UncheckedCloseException - in case of an errorExceptionCopyright © 2019 mklinger GmbH. All rights reserved.