我的E:\ temp \ file.zip中有一个zip文件。现在我需要复制整个zip文件并将其粘贴到我的桌面上,不应删除原始zip文件。这应该使用java SWT lib。
完成import java.io.*;
import javax.swing.*;
public class MovingFile {
public static void copyStreamToFile() throws IOException {
FileOutputStream foutOutput = null;
String oldDir = "F:/CAF_UPLOAD_04052011.TXT.zip";
System.out.println(oldDir);
String newDir = "F:/New/CAF_UPLOAD_04052011.TXT.zip.zip";
// name the file in destination File f = new File(oldDir);
f.renameTo(new File(newDir));
}
public static void main(String[] args) throws IOException {
copyStreamToFile();
}
}