final ScheduledThreadPoolExecutor executror = new ScheduledThreadPoolExecutor(1);
executror.scheduleAtFixedRate(new Runnable() {
public void run() {
//To change body of implemented methods use File | Settings | File Templates.
// 1. 判断数据是否完整
for (int i = 0; i < nameLongth.length; i++) {
if (!nameLongth[i].equals("sunlineTELFile.ctl")) {
return;
}
}
try {
process = Runtime.getRuntime().exec("D:\\etlpath\\BillFtp\\ftpdown.BAT");
} catch (IOException e) {
e.printStackTrace();
}
executror.shutdownNow();
}
// 0 表示延时0秒启动,5表示每5秒钟重复一次
}, 0, 20, TimeUnit.MINUTES);
executror.scheduleAtFixedRate(new Runnable() {
public void run() {
//To change body of implemented methods use File | Settings | File Templates.
// 1. 判断数据是否完整
for (int i = 0; i < nameLongth.length; i++) {
if (!nameLongth[i].equals("sunlineTELFile.ctl")) {
return;
}
}
try {
process = Runtime.getRuntime().exec("D:\\etlpath\\BillFtp\\ftpdown.BAT");
} catch (IOException e) {
e.printStackTrace();
}
executror.shutdownNow();
}
// 0 表示延时0秒启动,5表示每5秒钟重复一次
}, 0, 20, TimeUnit.MINUTES);