What I mean under ‘proper’ file renaming:
-
It should work on different platforms.
-
It should handle in some way cases when:
- the file is locked
- a file with ‘new’ name already exists
- there’s not enough free space on the disk to complete the operation.
Are there any common solutions/libs/strategies?
As described in the javadoc:
Here’s an example:
My advice would be to check the
successboolean and use the standard approach defined in the API.