public final class Closer
extends java.lang.Object
| Modifier | Constructor and Description |
|---|---|
private |
Closer() |
| Modifier and Type | Method and Description |
|---|---|
static void |
close(java.lang.AutoCloseable closeable)
Closes an AutoCloseable or ignores if
null. |
static boolean |
closeSilently(java.lang.AutoCloseable closeable)
Closes an AutoCloseable and returns
true if it closed without exception. |
public static void close(java.lang.AutoCloseable closeable)
throws java.lang.Exception
null.closeable - the resource to close; may be nulljava.lang.Exception - if the resource cannot be closedpublic static boolean closeSilently(java.lang.AutoCloseable closeable)
true if it closed without exception.closeable - the resource to close; may be null