public static void copy(File sourceFile, File targetFile) throws IOException {
	FileInputStream in = new FileInputStream(sourceFile);
	try {
	    FileOutputStream out = new FileOutputStream(targetFile);
	    try {
		copy(in, out);
	    } finally {
		out.close();
	    }
	} finally {
	    in.close();
	}
    }
public static void copy ( File sourceFile , File targetFile ) throws IOException { FileInputStream in = new FileInputStream ( sourceFile ) ; try { FileOutputStream out = new FileOutputStream ( targetFile ) ; try { copy ( in , out ) ; } finally { out . close ( ) ; } } finally { in . close ( ) ; } }
This method performs a simple copy of sourceFile to targetFile.

@param sourceFile
is the source file where it is to be copied from.
@param targetFile
is the file to which everything is to be copied to.
@throws IOException
is thrown in cases of IO issues.