We have upgraded iText version from 5.0 to 5.5.9 in few of our applications. After that we are facing issues in File.renameTo calls. Its returning false.
If we replace back the previous version of iText, it is working fine.
Once iText merges the pdf's, those pdf's are not getting moved to different folder.
If you are running your code on Windows, the file may not have been closed properly, and you rely on the garbage collector to do it. So you may try to run the same program on Linux to check this hypothesis.
This can be a regression in iText or your code was broken even with the previous version of iText, but with the difference of implementation, the garbage collector did its job before you called
File.renameTo
.As told on the comments of your post, the single line
File.renameTo(sourceFilePath, targetFilePath)
is not enough to understand your issue. We need the context to understand the problem.As a reminder the Java doc says :