Moving a File or Directory to Another Directory
// File (or directory) to be moved
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) {
// File was not successfully moved
}
How to move selected pictures from one folder to another using Java
its very useful to me
how to move file using sockets
i tryied that code and it worked when i try to move a file to D:/abc but when i try to move a file to C:/windows/asd the code doesnt work????? how can i move a file to C directory windows folder?????
does this apply both for windows and for ubuntu -linux? I need a code that will work for both OS in one program.. thanks in advance.