You could use the io-package from Apache Commons:
http://jakarta.apache.org/commons/io/apidocs/org/apache/commons/io/IOUtils.html
Example:
import org.apache.commons.io.IOUtils;
import java.io.*;
class CommonsFileCopy {
public static void main(String[] args) {
String fIn = "CommonsFileCopy.java";
String fOut = "(copy) CommonsFileCopy.java";
try {
InputStream inStream = new BufferedInputStream(new FileInputStream(fIn));
OutputStream outStream = new FileOutputStream(new File(fOut));
IOUtils.copy(inStream, outStream);
System.out.println("Copied \""+fIn+"\" to \""+fOut+"\" successfully.");
}
catch(IOException ioe) { ioe.printStackTrace(); }
}
}
You probably have Windows:
String file = "test.txt";
String copy = "copy_test.txt";
String command = "copy "+file+" "+copy;
Runtime.getRuntime().exec("cmd /c "+command);