Here you can find the source of copyFile(File inputFile, File outputFile)
public static void copyFile(File inputFile, File outputFile) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.File; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; public class Main { public static void copyFile(File inputFile, File outputFile) throws IOException { outputFile.getParentFile().mkdirs(); FileReader in = new FileReader(inputFile); FileWriter out = new FileWriter(outputFile); int c;//from w w w . java2s . c o m while ((c = in.read()) != -1) out.write(c); in.close(); out.close(); } }