public final class Closeables extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
closeAll(AutoCloseable... closeables) |
static void |
closeAll(Closeable... closeables) |
static void |
closeAllRuntimeException(Closeable... closeables) |
static <T extends Throwable> |
closeAllSuppress(T rootCause,
AutoCloseable... closeables) |
static void |
closeQuietly(Closeable... closeables)
Deprecated.
Usage of this method is discouraged, as it may hide real problems.
Use
closeAll(Closeable...) instead and, if necessary, suppress exceptions
explicitly. |
@Deprecated public static void closeQuietly(Closeable... closeables)
closeAll(Closeable...) instead and, if necessary, suppress exceptions
explicitly.public static void closeAll(Closeable... closeables) throws IOException
IOExceptionpublic static void closeAll(AutoCloseable... closeables) throws Exception
Exceptionpublic static void closeAllRuntimeException(Closeable... closeables)
public static <T extends Throwable> T closeAllSuppress(T rootCause, AutoCloseable... closeables)
Copyright © 2010–2020 Airlift. All rights reserved.