java 复制单个文件 服务器上
来源:百度知道 编辑:UC知道 时间:2024/08/23 01:32:31
public class cpFils {
public boolean push() {
boolean reValue = false;
try {
String[] toDirs = { "dir1", "dir2", "dir3" };
cpStruct tmpCps = new cpStruct();
for (String _dir : toDirs) {
tmpCps = new cpStruct();
tmpCps.setToDir(_dir);
new Thread(new ThreadCp(tmpCps)).start();
}
} catch (Exception e) {
// log
}
return reValue;
}
public static void main(String arg[]) {
new cpFils().push();
System.out.println("end");
}
}
class ThreadCp implements Runnable {
public cpStruct cps;
public ThreadCp() {
}
public ThreadCp(cpStruct _cps) {
this.cps = _cps;
}
publ