Here you can find the source of copy(File src, File folder)
Parameter | Description |
---|
public static void copy(File src, File folder)
//package com.java2s; //License from project: Open Source License import java.io.File; import java.nio.file.Files; import java.nio.file.StandardCopyOption; public class Main { /**/*from w w w . j a v a2 s.c o m*/ * copy the file src to this folder * @param src: source file * @param folder: destination folder */ public static void copy(File src, File folder) { try { File dst = new File(folder, src.getName()); Files.copy(src.toPath(), dst.toPath(), StandardCopyOption.REPLACE_EXISTING); } catch (Exception e) { e.printStackTrace(); } } }