Issue Details (XML | Word | Printable)

Key: BATCH-21
Type: Improvement Improvement
Status: Closed Closed
Resolution: Won't Fix
Priority: Major Major
Assignee: Robert Kasanicky
Reporter: Dave Syer
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Spring Batch

OutputResource abstraction for file / stream output

Created: 14/Jun/07 08:03 AM   Updated: 01/Oct/08 06:57 AM
Component/s: Infrastructure
Affects Version/s: 1.0-m1
Fix Version/s: 2.0.0.M3

Time Tracking:
Original Estimate: 1d
Original Estimate - 1d
Remaining Estimate: 1d
Remaining Estimate - 1d
Time Spent: Not Specified
Remaining Estimate - 1d

Issue Links:
Depends
Related
 


 Description  « Hide
OuputResource abstraction for file / stream output. Would remove some of the non-batch specific common code in the open()/close() methods of the OutputSources. E.g.

if (file.exists()) {
if (os.shouldDeleteIfExists) {
file.delete();
}
else {
throw new IOException("Resource already exists: " + resource);
}
}
file.createNewFile();

There is no wrapper for an output stream in Spring Core, but maybe it would port over if we get it working.

 All   Comments   Work Log   Change History   FishEye   Related Builds      Sort Order: Ascending order - Click to sort in descending order
Lucas Ward added a comment - 25/Sep/07 09:26 PM
The latest patch applied to BATCH-116 added a FileUtils class that helps abstract out file handling. However, I still believe that this should probably be an abstract class that can be configurable in a common way. It might then make the entire package structure a little bit better as well, since the stax input source would extend AbstractFileInputSource.

Dave Syer added a comment - 13/Nov/07 03:43 AM
See also SPR-4033 - it seems like a core feature, but we can add it here if no-one moves in Core.

Lucas Ward added a comment - 12/May/08 10:33 AM
Can we really add this in 1.1? It seems like it should perhaps be considered a 2.0 issue.

Lucas Ward added a comment - 04/Jun/08 09:34 AM
I'm moving this off to 2.0 sine I don't think we could do a complete refactoring of this for 1.1

Robert Kasanicky added a comment - 01/Oct/08 06:07 AM - edited
Do we really want to address this issue in Spring Batch? I think the FileUtils class encapsulates the non-batch specific complexity sufficiently. Unless there's a common usecase where such abstraction is badly needed I suggest we close this one.

Dave Syer added a comment - 01/Oct/08 06:57 AM
Agreed. This is out of scope / duplication of FileUtils.