Back to Summer Batch home page

File Manipulation Tasklet

The Summer.Batch.Extra.IO.FileUtilsTasklet allows for basic file manipulations. The Mode property specifies the file operation to perform, the Sources and Targets properties specify the manipulated files, and the Strict property specifies if the operation is strict or note. If the operation is strict it will fail if it cannot be performed, for instance if no files have been specified, whereas if it is not strict it will succeed even if it does nothing. The semantic of the Sources and Targets properties depends on the operation:

Copy

Copies the files referenced in Sources. If there are only one source file, Targets must contain a reference to either a target file or a target directory. If there are more than one file, Targets must contain a target directory.

Delete

Deletes the files referenced in Targets. Sources is ignored.

Merge

Appends the content of the files referenced in Sources to the file referenced in Targets.

MergeCopy

Replaces the file referenced in Targets with the content of the files referenced in Sources.

Reset

Resets the files referenced in Targets. An existing file is replaced by an empty file. A non-existing file is created, with no content. Sources is ignored.

Compare

Compares the two files referenced in Sources. If the files are equals the tasklet will complete normally, otherwise it fails with the FILESNOTEQUAL status. Targets is ignored.

Back to Summer Batch home page