public final class Closer extends Object
Modifier and Type | Method and Description |
---|---|
static boolean |
close(AutoCloseable closeable)
Closes an AutoCloseable or ignores if
null . |
static boolean |
closeSilently(AutoCloseable closeable)
Closes an AutoCloseable and returns
true if it closed without exception. |
public static boolean close(AutoCloseable closeable) throws Exception
null
.closeable
- the resource to close; may be nullException
- if the resource cannot be closedpublic static boolean closeSilently(AutoCloseable closeable)
true
if it closed without exception.closeable
- the resource to close; may be null Copyright © 1999-2023 The Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.