java

java - file copy

고.니 2020. 11. 18. 23:07
반응형

jdk 1.7 부터 추가된   java.nio.file.Files 클래스를 이용합니다.

 

public static void copyFile( File from, File to ) throws IOException {
    Files.copy( from.toPath(), to.toPath() );
}
반응형