import java.io.File;
public class aa {
public static void main(String [] args){
//文件原地址
File srcFile = new File("c:/test.zip");
//文件新(目标)地址
String newPath = "c:/test/";
//new一个新文件夹
File fnewpath = new File(newPath);
//判断文件夹是否存在
if(!fnewpath.exists())
fnewpath.mkdirs();
//将文件移到新文件里
File newfile = new File(newPath +srcFile.getName());
srcFile.renameTo(newfile);
}
}
以前不知道,还几个几个字节的读,暴汗!