public void close() throws IOException {
        // Release all resources and keep track of any exceptions
        IOException exception = null;
        for (Closeable resource : resources) {
            try {
                resource.close();
            } catch (IOException e) {
                if (exception == null) {
                    exception = e;
                } else {
                    exception.addSuppressed(e);
                }
            }
        }
        resources.clear();

        // Throw any exceptions that were captured from above
        if (exception != null) {
            throw exception;
        }
    }
Closes all tracked resources. The resources are closed in reverse order
from how they were added.
<p>
Any suppressed exceptions from managed resources are collected and
then added to the first thrown exception, which is re-thrown once
all the resources have been closed.

@throws IOException if one or more of the tracked resources
                    could not be closed
tika-core/src/main/java/org/apache/tika/io/TemporaryResources.java