/** {@inheritDoc} */ @Override public final void after( final RESOURCE releasable ) throws IOException { releasable.release(); } }
/** * Releases the specified resource, logging and swallowing I/O errors if needed. * * @param resource Release this resource. * @param <T> Type of the resource to release. */ public static <T extends ReferenceCountable<T>> void releaseOrLog( ReferenceCountable<T> resource) { if (resource == null) { return; } try { resource.release(); } catch (IOException ioe) { LOG.warn("I/O error while releasing resource '{}':\n{}", resource, StringUtils.stringifyException(ioe)); } }