@Override public void remove() throws IOException { super.remove(); if (Files.exists(this.tempFile)) { Files.delete(this.tempFile); } diskCacheManager.remove(this); latch.countDown(); }
public void writeToOutputStream(OutputStream outputStream, ProgressReporter progressReporter) throws SerializerException, IOException { try { MultiplexingOutputStream multiplexer = new MultiplexingOutputStream(outputStream, diskCacheOutputStream); serializer.writeToOutputStream(multiplexer); try { multiplexer.close(); } catch (EOFException e) { // let this one slide } doneListener.done(); } catch (Exception e) { e.printStackTrace(); diskCacheOutputStream.remove(); } }