SpringSource/spring-integration — pull request #832 by garyrussell (2013-07-16 13:48:34+00:00)
Title: INT-3089 Fix FileExistsMode.IGNORE

When writing files with this mode setting, the FWMH detected
that the final file already exists, but did not detect that
the temporary (default ....writing) file exists. This could
happen if two adapters were simulataneously processing the same
file.

Also, while a comment in the setter said an empty temp file
suffix is allowed, it did not work because the file rename
is performed unconditionally, fails, and throws an exception.

Add a check for the temporary file (if the suffix is not "").

Don't rename if the file was written in-place (no temp file suffix).

Add test cases for the FileExistsMode.IGNORE for both the final
and temporary files. Add a test where the temporary file suffix
is "", a ...writing file exists, the final file does not exist
and so is created by the handler. The ...writing file is untouched.

__cherry-pick to 2.2.x__