Here you can find the source of copy(File source, File dest)
Parameter | Description |
---|---|
source | the source file. |
dest | the destination file. |
Parameter | Description |
---|
public static void copy(File source, File dest) throws IOException
//package com.java2s; import java.io.File; import java.io.IOException; import java.nio.file.Files; public class Main { /**//from ww w .jav a2 s. c o m * Copy a file. * * @param source the source file. * @param dest the destination file. * @throws java.io.IOException if any errors occur during the copy. */ public static void copy(File source, File dest) throws IOException { Files.copy(source.toPath(), dest.toPath()); } }