@Override protected void deallocate() { closeSilently(body); } }
/** * {@inheritDoc} */ public void onAllBytesReceived() { closeSilently(file); }
private void closeConsumer() { if (bodyConsumer != null) closeSilently(bodyConsumer); }
public void close() { if (closed.compareAndSet(false, true)) { for (MultipartPart<? extends Part> part : parts) { closeSilently(part); } } }
public void operationComplete(ChannelProgressiveFuture cf) { closeSilently(body); super.operationComplete(cf); } });
@Override public void close() { super.close(); closeSilently(part.getInputStream()); closeSilently(channel); }
public void operationComplete(ChannelProgressiveFuture cf) { closeSilently(is); super.operationComplete(cf); } });
@Override public void close() { super.close(); closeSilently(channel); } }
/** * {@inheritDoc} */ @Override public void save(Map<String, Long> map) { log.debug("Saving current download state {}", properties.toString()); OutputStream os = null; try { if (!TMP.exists() && !TMP.mkdirs()) { throw new IllegalStateException("Unable to create directory: " + TMP.getAbsolutePath()); } File f = new File(TMP, storeName); if (!f.exists() && !f.createNewFile()) { throw new IllegalStateException("Unable to create temp file: " + f.getAbsolutePath()); } if (!f.canWrite()) { throw new IllegalStateException(); } os = Files.newOutputStream(f.toPath()); for (Map.Entry<String, Long> e : properties.entrySet()) { os.write(append(e).getBytes(UTF_8)); } os.flush(); } catch (Throwable e) { log.warn(e.getMessage(), e); } finally { closeSilently(os); } }
@Override protected void deallocate() { closeSilently(body); } }
@Override protected void deallocate() { closeSilently(body); } }
public void releaseExternalResources() { closeSilently(file); closeSilently(raf); } }
private void closeConsumer() { if (bodyConsumer != null) closeSilently(bodyConsumer); }
public void operationComplete(ChannelProgressiveFuture cf) { closeSilently(is); super.operationComplete(cf); } });
public void operationComplete(ChannelFuture cf) { closeSilently(raf); super.operationComplete(cf); } });
public void operationComplete(ChannelProgressiveFuture cf) { closeSilently(raf); super.operationComplete(cf); } });
public void operationComplete(ChannelFuture cf) { closeSilently(body); super.operationComplete(cf); } });
public void operationComplete(ChannelFuture cf) { closeSilently(body); super.operationComplete(cf); } });
public void operationComplete(ChannelProgressiveFuture cf) { closeSilently(body); super.operationComplete(cf); } });
public void operationComplete(ChannelFuture cf) { closeSilently(body); super.operationComplete(cf); } });