Java examples for File Path IO:File Move
Move a file from one directory to another
import java.io.File; import java.io.IOException; public class Main { public static void main(String[] arg) throws IOException { File f = new File("logs\\myfile.txt"); if (f.renameTo(new File("savedlogs\\myfile.txt"))) System.out.println("File moved."); else/*from ww w.j a v a 2s. c om*/ System.out.println("File not moved."); } }