//拷贝单个文件的方法
public void copy(String path1,String path2) throws IOException {
// TODO Auto-generated method stub
DataInputStream in = new DataInputStream(
new BufferedInputStream(
new FileInputStream(path1)));
byte[] date = new byte[in.available()];
in.read(date);
DataOutputStream out = new DataOutputStream(
new BufferedOutputStream(
new FileOutputStream(path2)));
out.write(date);
in.close();
out.close();
}
public static void main(String[] args) throws Exception {
Dptest dp = new Dptest();
dp.deleteFile("c:/wmpub");
// dp.copyFiles("c:/新建文件夹", "c:/xiao");
}
}