The following code will rename the file/directory.Here 'FileOrDirNameBefore' is the directory name to be renamed to 'FileOrDirNameAfter'.
- boolean success = f1.renameTo(f2);
- if (!success) {
- // File was not successfully renamed
- }
No comments:
Post a Comment