I changed my router   to use and removed delete , I was hoping at this time I
will be able to read file bytes in my processor but its failing with
java.io.FileNotFoundException


public class MyRouteBuilder extends RouteBuilder {

        
    public void configure() {
    
from("file://e:/u01/oracle/NEW_NEAR_FILES/?delay=60000&move=../PROCESSED_NEAR_FILES")
                        .convertBodyTo(File.class)
                
//.aggregate(constant(true)).completionFromBatchConsumer().groupExchanges()
                
.aggregate(constant(true)).completionSize(10).completionTimeout(10000L).groupExchanges()
 
                        .process(new FileProcessor())
        ;

    }

    public static class FileProcessor implements  Processor {
                @Override
                public void process(Exchange exchange) throws Exception {
                        System.out.println("from process");
                        ArrayList<Exchange> grouped =
exchange.getProperty(Exchange.GROUPED_EXCHANGE, ArrayList.class); 
                        for(Exchange exch :grouped){
                                File file=exch.getIn().getBody(File.class);
                                byte[]  filebytes=IOUtils.toByteArray(new 
FileInputStream(file));
                                System.out.println("name"+file.getName());
                        }
                }
    }
}




please advice me how to get file  content 

--
View this message in context: 
http://camel.465427.n5.nabble.com/read-all-files-in-folder-tp4474104p4477356.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to