A simple code for To Move A File In Java(any type of file)
File file = new File("filename");// Destination directoryFile dir = new File("directoryname");// Move file to new directoryboolean 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
Enter any comments