[英]Apache Camel - not moving file
我无法弄清楚我在做什么错。 我尝试了各种方法,包括绝对路径,相对路径,启用日志记录(使用Main,使用DefaultCamelContext并添加threadsleep似乎也不起作用,但是我无法让骆驼将文件从一个文件夹移动到另一个文件夹。
这是我的代码:
package scratchpad;
import org.apache.camel.CamelContext;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.dataformat.beanio.BeanIODataFormat;
import org.apache.camel.impl.DefaultCamelContext;
import org.apache.camel.main.Main;
import org.apache.camel.spi.DataFormat;
public class CamelMain {
private static Main main;
public static void main(String[] args) throws Exception {
main = new Main();
main.addRouteBuilder( new RouteBuilder() {
@Override
public void configure() throws Exception {
// DataFormat format = new BeanIODataFormat(
// "org/apache/camel/dataformat/beanio/mappings.xml",
// "orderFile");
System.out.println("starting route");
// a route which uses the bean io data format to format a CSV data
// to java objects
from("file://input?noop=true&startingDirectoryMustExist=true")
.to("file://output");
}
});
//main.run();
main.start();
Thread.sleep(5000);
main.stop();
}
}
有人可以发现以上内容有问题吗?
谢谢
例如,您可以从《骆驼在行动》一书的免费第1章中阅读,因为它有一个文件复制的示例,从上到下涵盖了该示例。
pdf可以在这里下载: http : //manning.com/ibsen/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.