1
我是骆驼新手。我试图创建一个小应用程序,允许我将文件从一个位置移动到另一个位置。由于各种原因,我被迫使用骆驼。我可以执行移动,但当文件夹中没有更多文件时,我无法让驼峰停止。我尝试了几种方式,但没有成功。骆驼停止当文件夹中没有文件
这里是我使用的代码:
try {
Main main = new Main();
main.addRouteBuilder(createRouteBuilder());
main.run();
} catch (Exception e1) {
e1.printStackTrace();
}
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
public void configure() throws Exception {
from("file:./xxx").to("file:C:\\tomcat-6.0.37\\apache-tomcat-6.0.37\\yyy");
}
};
}
当没有更多文件时,您希望停止什么样的行为? – Ralf
您可能想尝试如下所示: http://stackoverflow.com/a/9099553/6264 –