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:
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.
Deletes the files referenced in Targets
. Sources
is ignored.
Appends the content of the files referenced in Sources
to the file referenced in Targets
.
Replaces the file referenced in Targets
with the content of the files referenced in Sources
.
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.
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.