Class SuppressingCloser


public final class SuppressingCloser extends AbstractCloser<SuppressingCloser,Exception>
A helper for closing multiple resources and re-throwing a provided exception, suppressing any exceptions caught while closing.

This class is not thread safe.

This helper is mainly useful when implementing a catch block where resources must be closed, to make sure that all resources are at least given the chance to close, even if closing one of them fails, and that you can still re-throw the originally caught exception.

See the AbstractCloser superclass for a list of methods allowing to close objects while catching exceptions.