@Override public void close() throws ItemStreamException { super.close(); resourceIndex = 1; currentResourceItemCount = 0; if (opened) { delegate.close(); } }
/** * @see ItemStream#close() */ @Override public void close() { super.close(); if (state != null) { try { if (footerCallback != null && state.outputBufferedWriter != null) { footerCallback.writeFooter(state.outputBufferedWriter); state.outputBufferedWriter.flush(); } } catch (IOException e) { throw new ItemStreamException("Failed to write footer before closing", e); } finally { state.close(); if (state.linesWritten == 0 && shouldDeleteIfEmpty) { try { resource.getFile().delete(); } catch (IOException e) { throw new ItemStreamException("Failed to delete empty file on close", e); } } state = null; } } }
@Override public void close() throws ItemStreamException { super.close(); resourceIndex = 1; currentResourceItemCount = 0; if (opened) { delegate.close(); } }
@Override public void close() throws ItemStreamException { super.close(); currentItemCount = 0; currentItemIndex = 0; try { doClose(); } catch (Exception e) { throw new ItemStreamException("Error while closing item writer", e); } }
/** * @see ItemStream#close() */ @Override public void close() { super.close(); if (state != null) { try { if (footerCallback != null && state.outputBufferedWriter != null) { footerCallback.writeFooter(state.outputBufferedWriter); state.outputBufferedWriter.flush(); } } catch (IOException e) { throw new ItemStreamException("Failed to write footer before closing", e); } finally { state.close(); if (state.linesWritten == 0 && shouldDeleteIfEmpty) { try { resource.getFile().delete(); } catch (IOException e) { throw new ItemStreamException("Failed to delete empty file on close", e); } } state = null; } } }