@Override public final void release() { // Don't call IOUtils.release(in, null) or else could lead to infinite loop IOUtils.closeQuietly(this, null); if (out instanceof Releasable) { // This allows any underlying stream that has the close operation // disabled to be truly released Releasable r = (Releasable)out; r.release(); } } }
@Override public final void release() { // Don't call IOUtils.release(in, null) or else could lead to infinite loop SdkIOUtils.closeQuietly(this); if (in instanceof Releasable) { // This allows any underlying stream that has the close operation // disabled to be truly released Releasable r = (Releasable)in; r.release(); } } }
@Override public void release() { // Don't call IOUtils.release(in, null) or else could lead to infinite loop SdkIOUtils.closeQuietly(this); if (in instanceof Releasable) { // This allows any underlying stream that has the close operation // disabled to be truly released Releasable r = (Releasable)in; r.release(); } } }
/** * Used to truly release the underlying resources. */ private void doRelease() { try { in.close(); } catch (Exception ex) { if (log.isDebugEnabled()) log.debug("FYI", ex); } if (in instanceof Releasable) { // This allows any underlying stream that has the close operation // disabled to be truly released Releasable r = (Releasable)in; r.release(); } abortIfNeeded(); }
/** * Releases the given {@link Closeable} especially if it was an instance of * {@link Releasable}. * <p> * For example, the creation of a <code>ResettableInputStream</code> would entail * physically opening a file. If the opened file is meant to be closed only * (in a finally block) by the very same code block that created it, then it * is necessary that the release method must not be called while the * execution is made in other stack frames. * * In such case, as other stack frames may inadvertently or indirectly call * the close method of the stream, the creator of the stream would need to * explicitly disable the accidental closing via * <code>ResettableInputStream#disableClose()</code>, so that the release method * becomes the only way to truly close the opened file. */ public static void release(Closeable is, Log log) { closeQuietly(is, log); if (is instanceof Releasable) { Releasable r = (Releasable) is; r.release(); } }
/** * WARNING: Subclass that overrides this method must NOT call * super.release() or else it would lead to infinite loop. * <p> * {@inheritDoc} */ @Override public void release() { // Don't call IOUtils.release(in, null) or else could lead to infinite loop IOUtils.closeQuietly(this, null); InputStream in = getWrappedInputStream(); if (in instanceof Releasable) { // This allows any underlying stream that has the close operation // disabled to be truly released Releasable r = (Releasable)in; r.release(); } } }
@Override public final void release() { // Don't call IOUtils.release(in, null) or else could lead to infinite loop SdkIOUtils.closeQuietly(this); if (in instanceof Releasable) { // This allows any underlying stream that has the close operation // disabled to be truly released Releasable r = (Releasable)in; r.release(); } } }
@Override public final void release() { // Don't call IOUtils.release(in, null) or else could lead to infinite loop IOUtils.closeQuietly(this, null); if (out instanceof Releasable) { // This allows any underlying stream that has the close operation // disabled to be truly released Releasable r = (Releasable)out; r.release(); } } }
@Override public void release() { // Don't call IOUtils.release(in, null) or else could lead to infinite loop SdkIOUtils.closeQuietly(this); if (in instanceof Releasable) { // This allows any underlying stream that has the close operation // disabled to be truly released Releasable r = (Releasable)in; r.release(); } } }
/** * Used to truly release the underlying resources. */ private void doRelease() { try { in.close(); } catch (Exception ex) { if (log.isDebugEnabled()) log.debug("FYI", ex); } if (in instanceof Releasable) { // This allows any underlying stream that has the close operation // disabled to be truly released Releasable r = (Releasable)in; r.release(); } abortIfNeeded(); }
/** * Releases the given {@link Closeable} especially if it was an instance of * {@link Releasable}. * <p> * For example, the creation of a <code>ResettableInputStream</code> would entail * physically opening a file. If the opened file is meant to be closed only * (in a finally block) by the very same code block that created it, then it * is necessary that the release method must not be called while the * execution is made in other stack frames. * * In such case, as other stack frames may inadvertently or indirectly call * the close method of the stream, the creator of the stream would need to * explicitly disable the accidental closing via * <code>ResettableInputStream#disableClose()</code>, so that the release method * becomes the only way to truly close the opened file. */ public static void release(Closeable is, Log log) { closeQuietly(is, log); if (is instanceof Releasable) { Releasable r = (Releasable) is; r.release(); } }
/** * WARNING: Subclass that overrides this method must NOT call * super.release() or else it would lead to infinite loop. * <p> * {@inheritDoc} */ @Override public void release() { // Don't call IOUtils.release(in, null) or else could lead to infinite loop IOUtils.closeQuietly(this, null); InputStream in = getWrappedInputStream(); if (in instanceof Releasable) { // This allows any underlying stream that has the close operation // disabled to be truly released Releasable r = (Releasable)in; r.release(); } } }
/** * Used to truly release the underlying resources. */ private void doRelease() { try { in.close(); } catch (final Exception ex) { if (log.isDebugEnabled()) { log.debug("FYI", ex); } } if (in instanceof Releasable) { // This allows any underlying stream that has the close operation // disabled to be truly released final Releasable r = (Releasable)in; r.release(); } abortIfNeeded(); }
@Override public final void release() { // Don't call IOUtils.release(in, null) or else could lead to infinite loop SdkIOUtils.closeQuietly(this); if (in instanceof Releasable) { // This allows any underlying stream that has the close operation // disabled to be truly released Releasable r = (Releasable)in; r.release(); } } }
@Override public final void release() { // Don't call IOUtils.release(in, null) or else could lead to infinite loop IOUtils.closeQuietly(this, null); if (out instanceof Releasable) { // This allows any underlying stream that has the close operation // disabled to be truly released Releasable r = (Releasable)out; r.release(); } } }
@Override public void release() { // Don't call IOUtils.release(in, null) or else could lead to infinite loop SdkIOUtils.closeQuietly(this); if (in instanceof Releasable) { // This allows any underlying stream that has the close operation // disabled to be truly released Releasable r = (Releasable)in; r.release(); } } }
/** * Used to truly release the underlying resources. */ private void doRelease() { try { in.close(); } catch (final Exception ex) { if (log.isDebugEnabled()) { log.debug("FYI", ex); } } if (in instanceof Releasable) { // This allows any underlying stream that has the close operation // disabled to be truly released final Releasable r = (Releasable)in; r.release(); } abortIfNeeded(); }
/** * Used to truly release the underlying resources. */ private void doRelease() { try { in.close(); } catch (Exception ex) { if (log.isDebugEnabled()) log.debug("FYI", ex); } if (in instanceof Releasable) { // This allows any underlying stream that has the close operation // disabled to be truly released Releasable r = (Releasable)in; r.release(); } abortIfNeeded(); }
/** * WARNING: Subclass that overrides this method must NOT call * super.release() or else it would lead to infinite loop. * <p> * {@inheritDoc} */ @Override public void release() { // Don't call IOUtils.release(in, null) or else could lead to infinite loop IOUtils.closeQuietly(this, null); InputStream in = getWrappedInputStream(); if (in instanceof Releasable) { // This allows any underlying stream that has the close operation // disabled to be truly released Releasable r = (Releasable)in; r.release(); } } }
/** * Used to truly release the underlying resources. */ private void doRelease() { try { in.close(); } catch (final Exception ex) { if (log.isDebugEnabled()) { log.debug("FYI", ex); } } if (in instanceof Releasable) { // This allows any underlying stream that has the close operation // disabled to be truly released final Releasable r = (Releasable)in; r.release(); } abortIfNeeded(); }