Apache camel 如何使用Apache Camel获取目录中的文件数?

Apache camel 如何使用Apache Camel获取目录中的文件数?,apache-camel,Apache Camel,如何使用Camel获取目录中文件数的计数 谢谢我发现了如何使用Camel实现这一点-以下是一个示例: // add our route to the CamelContext context.addRoutes(new RouteBuilder() { public void configure() { from("file:"+getFullPath()+"?noop=true") .process(new Proces

如何使用Camel获取目录中文件数的计数


谢谢

我发现了如何使用Camel实现这一点-以下是一个示例:

// add our route to the CamelContext
    context.addRoutes(new RouteBuilder() {
        public void configure() {

            from("file:"+getFullPath()+"?noop=true")
            .process(new Processor() {

                public void process(Exchange exchange) throws Exception {

                    System.out.println("size is #" +exchange.getProperty("CamelBatchSize"));
                    System.out.println(file.getName());

                }
            }).to("file:/home/anton/tmp/outbox?"); 

        }
    });

编写一个bean来完成它?是的,你可以使用java.io.File返回文件列表,然后得到数组的大小。你知道如何在blueprint中实现同样的操作吗?