0
我有下面的代碼:如何檢查Apache Camel中是否存在文件?
package camelinaction;
import org.apache.camel.CamelContext;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.DefaultCamelContext;
public class MakeNotaBeneFile {
public static void main(String args[]) throws Exception {
// create CamelContext
CamelContext context = new DefaultCamelContext();
// add our route to the CamelContext
context.addRoutes(new RouteBuilder() {
public void configure() {
from("quartz://report?cron=0/2+*+*+*+*+?")
.setBody().simple("\n")
.to("file:/c:/Users/Mishin/Documents/work_line/?fileName=${date:now:ddMMyyyy}/${date:now:ddMMyyyy}_nb.txt");
}
});
// start the route and let it do its work
context.start();
Thread.sleep(1000);
// stop the CamelContext
context.stop();
}
}
我有一個創建一個目錄,並用當前日期與駱駝 MakeNotaBeneFile.java
我的問題是,我怎麼能確認我的文件所在的文件中的代碼? 由於當前的代碼覆蓋舊文件,我丟失了筆記。
它與&fileExist =忽略,謝謝! –