Here you can find the source of copyFile(String fileName, String newFileName)
public static void copyFile(String fileName, String newFileName) throws IOException
//package com.java2s; //License from project: Apache License import java.io.File; import java.io.IOException; import com.google.common.io.Files; public class Main { public static void copyFile(String fileName, String newFileName) throws IOException { Files.copy(new File(fileName), new File(newFileName)); }//from w ww .j a va2s.co m }