Here you can find the source of fileCopy(String fromPath, String toPath)
public static void fileCopy(String fromPath, String toPath) throws IOException
//package com.java2s; /*//w w w . j ava 2s .co m * Copyright (C) 2003 by Institute for Systems Biology, * Seattle, Washington, USA. All rights reserved. * * This source code is distributed under the GNU Lesser * General Public License, the text of which is available at: * http://www.gnu.org/copyleft/lesser.html */ import java.io.File; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; public class Main { public static void fileCopy(String fromPath, String toPath) throws IOException { File inputFile = new File(fromPath); File outputFile = new File(toPath); FileReader in = new FileReader(inputFile); FileWriter out = new FileWriter(outputFile); int c; while ((c = in.read()) != -1) out.write(c); in.close(); out.close(); } }