A simple code for To Move A File In Java(any type of file)
File file = new File("filename");
// Destination directory
File dir = new File("directoryname");
// Move file to new directory
boolean success = file.renameTo(new File(dir, file.getName()));
if (!success) {
System.out.print("\n Error");//No such a file or directory
}
Loading...
|
Comments :
Post a Comment