public static void closeQuietly(final AutoCloseable closeable, final Consumer<Exception> consumer) {
        if (closeable != null) {
            try {
                closeable.close();
            }
            catch (final Exception e) {
                if (consumer != null) {
                    consumer.accept(e);
                }
            }
        }
    }
Closes the given {@link Closeable} as a null-safe operation while consuming IOException by the given {@code consumer}.

@param closeable The resource to close, may be null.
@param consumer Consumes the IOException thrown by {@link Closeable#close()}.
primefaces/src/main/java/org/primefaces/util/IOUtils.java