Tweak the JobOperator slightly and add Javadocs.

This commit is contained in:
dsyer
2008-12-31 16:23:11 +00:00
parent d8c3020176
commit bd3ab51c60
11 changed files with 230 additions and 43 deletions

View File

@@ -285,13 +285,14 @@ public class FlatFileItemWriter<T> extends ExecutionContextUserSupport implement
// Returns object representing state.
private OutputState getOutputState() {
if (state == null) {
File file;
try {
File file = resource.getFile();
Assert.state(!file.exists() || file.canWrite(), "Resource is not writable: [" + resource + "]");
file = resource.getFile();
}
catch (IOException e) {
throw new ItemStreamException("Could not test resource for writable status.", e);
throw new ItemStreamException("Could not convert resource to file: [" + resource + "]", e);
}
Assert.state(!file.exists() || file.canWrite(), "Resource is not writable: [" + resource + "]");
state = new OutputState();
state.setDeleteIfExists(shouldDeleteIfExists);
state.setEncoding(encoding);
@@ -308,7 +309,7 @@ public class FlatFileItemWriter<T> extends ExecutionContextUserSupport implement
private static final String DEFAULT_CHARSET = "UTF-8";
private FileOutputStream os;
// The bufferedWriter over the file channel that is actually written
Writer outputBufferedWriter;
@@ -327,7 +328,6 @@ public class FlatFileItemWriter<T> extends ExecutionContextUserSupport implement
boolean shouldDeleteIfExists = true;
boolean initialized = false;
/**
* Return the byte offset position of the cursor in the output file as a