因为第2、3点特点,需要:
先搞定第2步,第1个问题暂时未遇到
/**
* 模拟检查等待
*
* @throws Exception
*/
@Test
void test() throws Exception {
String filePath = "D:/src/投诉清单各地市投诉率20230503.xlsx";
File file = new File(filePath);
while (!file.exists()) {
// 发送提醒
System.out.println("检查发现:文件" + filePath + "不存在");
// 等待5秒后再次检查
Thread.sleep(1000 * 5);
}
// 完成任务
System.out.println("done!");
}