IN PROGRESS - BATCH-827: Create Sample job for reading and writing headers and footers

This commit is contained in:
robokaso
2008-09-11 14:21:43 +00:00
parent df870a5df6
commit 2973139959
9 changed files with 212 additions and 19 deletions

View File

@@ -247,8 +247,8 @@ public class FlatFileItemWriter<T> extends ExecutionContextUserSupport implement
if (outputState.lastMarkedByteOffsetPosition == 0) {
if (headerCallback != null) {
try {
headerCallback.write(state.outputBufferedWriter);
state.write("\n");
headerCallback.write(outputState.outputBufferedWriter);
outputState.write("\n");
}
catch (IOException e) {
throw new FlushFailedException("Could not write headers. The file may be corrupt.", e);
@@ -422,6 +422,7 @@ public class FlatFileItemWriter<T> extends ExecutionContextUserSupport implement
outputBufferedWriter = getBufferedWriter(fileChannel, encoding);
Assert.state(outputBufferedWriter != null);
// in case of restarting reset position to last committed point
if (restarted) {
checkFileSize();