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 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 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 createFileOutputStream() throws IOException { if (tempFileFailed) { return; } ByteArrayOutputStream bout = (ByteArrayOutputStream)currentStream; try { if (outputDir == null) { tempFile = FileUtils.createTempFile("cos", "tmp"); } else { tempFile = FileUtils.createTempFile("cos", "tmp", outputDir, false); } currentStream = createOutputStream(tempFile); bout.writeTo(currentStream); inmem = false; streamList.add(currentStream); } catch (Exception ex) { //Could be IOException or SecurityException or other issues. //Don't care what, just keep it in memory. tempFileFailed = true; if (currentStream != bout) { currentStream.close(); } deleteTempFile(); inmem = true; currentStream = bout; } }
private void createFileOutputStream() throws IOException { if (tempFileFailed) { return; } ByteArrayOutputStream bout = (ByteArrayOutputStream)currentStream; try { if (outputDir == null) { tempFile = FileUtils.createTempFile("cos", "tmp"); } else { tempFile = FileUtils.createTempFile("cos", "tmp", outputDir, false); } currentStream = createOutputStream(tempFile); bout.writeTo(currentStream); inmem = false; streamList.add(currentStream); } catch (Exception ex) { //Could be IOException or SecurityException or other issues. //Don't care what, just keep it in memory. tempFileFailed = true; if (currentStream != bout) { currentStream.close(); } deleteTempFile(); inmem = true; currentStream = bout; } }
private void createFileOutputStream() throws IOException { if (tempFileFailed) { return; } ByteArrayOutputStream bout = (ByteArrayOutputStream)currentStream; try { if (outputDir == null) { tempFile = FileUtils.createTempFile("cos", "tmp"); } else { tempFile = FileUtils.createTempFile("cos", "tmp", outputDir, false); } currentStream = createOutputStream(tempFile); bout.writeTo(currentStream); inmem = false; streamList.add(currentStream); } catch (Exception ex) { //Could be IOException or SecurityException or other issues. //Don't care what, just keep it in memory. tempFileFailed = true; if (currentStream != bout) { currentStream.close(); } deleteTempFile(); inmem = true; currentStream = bout; } }
private void createFileOutputStream() throws IOException { if (tempFileFailed) { return; } ByteArrayOutputStream bout = (ByteArrayOutputStream)currentStream; try { if (outputDir == null) { tempFile = FileUtils.createTempFile("cos", "tmp"); } else { tempFile = FileUtils.createTempFile("cos", "tmp", outputDir, false); } currentStream = createOutputStream(tempFile); bout.writeTo(currentStream); inmem = false; streamList.add(currentStream); } catch (Exception ex) { //Could be IOException or SecurityException or other issues. //Don't care what, just keep it in memory. tempFileFailed = true; if (currentStream != bout) { currentStream.close(); } deleteTempFile(); inmem = true; currentStream = bout; } }
deleteTempFile(); inmem = true;
deleteTempFile(); inmem = true;
deleteTempFile(); inmem = true;
deleteTempFile(); inmem = true;