private void maybeDeleteTempFile(Object stream) { streamList.remove(stream); if (!inmem && tempFile != null && streamList.isEmpty() && allowDeleteOfFile) { if (currentStream != null) { try { currentStream.close(); postClose(); } catch (Exception e) { //ignore } } deleteTempFile(); currentStream = new LoadingByteArrayOutputStream(1024); inmem = true; } }
private boolean maybeDeleteTempFile(Object stream) { boolean postClosedInvoked = false; streamList.remove(stream); if (!inmem && tempFile != null && streamList.isEmpty() && allowDeleteOfFile) { if (currentStream != null) { try { currentStream.close(); postClose(); } catch (Exception e) { //ignore } postClosedInvoked = true; } deleteTempFile(); currentStream = new LoadingByteArrayOutputStream(1024); inmem = true; } return postClosedInvoked; }
private void maybeDeleteTempFile(Object stream) { streamList.remove(stream); if (!inmem && tempFile != null && streamList.isEmpty() && allowDeleteOfFile) { if (currentStream != null) { try { currentStream.close(); postClose(); } catch (Exception e) { //ignore } } deleteTempFile(); currentStream = new LoadingByteArrayOutputStream(1024); inmem = true; } }
private boolean maybeDeleteTempFile(Object stream) { boolean postClosedInvoked = false; streamList.remove(stream); if (!inmem && tempFile != null && streamList.isEmpty() && allowDeleteOfFile) { if (currentStream != null) { try { currentStream.close(); postClose(); } catch (Exception e) { //ignore } postClosedInvoked = true; } deleteTempFile(); currentStream = new LoadingByteArrayOutputStream(1024); inmem = true; } return postClosedInvoked; }
public void close() throws IOException { currentStream.flush(); outputLocked = true; if (null != callbacks) { for (CachedOutputStreamCallback cb : callbacks) { cb.onClose(this); } } doClose(); currentStream.close(); maybeDeleteTempFile(currentStream); postClose(); }
public void close() throws IOException { currentStream.flush(); outputLocked = true; if (null != callbacks) { for (CachedOutputStreamCallback cb : callbacks) { cb.onClose(this); } } doClose(); currentStream.close(); maybeDeleteTempFile(currentStream); postClose(); }
public void close() throws IOException { currentStream.flush(); outputLocked = true; if (null != callbacks) { for (CachedOutputStreamCallback cb : callbacks) { cb.onClose(this); } } doClose(); currentStream.close(); if (ciphers != null) { ciphers.clean(); } if (!maybeDeleteTempFile(currentStream)) { postClose(); } }
public void close() throws IOException { currentStream.flush(); outputLocked = true; if (null != callbacks) { for (CachedOutputStreamCallback cb : callbacks) { cb.onClose(this); } } doClose(); currentStream.close(); if (ciphers != null) { ciphers.clean(); } if (!maybeDeleteTempFile(currentStream)) { postClose(); } }