Class IoTools.Quiet<C extends AutoCloseable>

    • Field Detail

      • logger

        protected final Logger logger
        The logger to which to log an occurred exception or null to wrap the exception as RuntimeException.
    • Constructor Detail

      • Quiet

        protected Quiet​(C wrapped,
                        Logger logger)
        Creates a new closeable wrapping the designated AutoCloseable logging or wrapping any exception from AutoCloseable.close().
        Parameters:
        wrapped - The wrapped AutoCloseable.
        logger - The logger to which to log an occurred exception or null to wrap the exception as RuntimeException.
    • Method Detail

      • close

        public void close()
        Closes the wrapped AutoCloseable and logs any Exception.