All Posts

Best code for file archive

S

By Suhas Das

Author

4 views

this is a good code for archiving file:

if (idFile.renameTo(new File(archiveFileRoot + FS + fileName))) {
System.out.println("252…successfully archived!");
} else {
System.out.println("254…Not archived!");
}

never use:

if (idFile.renameTo(new File(archiveFileRoot + FS + idFile.getName()))) {

download OpenJDK:

https://www.openlogic.com/openjdk-downloads

0 Comments

Leave a Comment

Your email will not be published. Comments are subject to moderation.