Using Camel to copy file from one location to another based on their type

package camelinaction;

import java.awt.Choice;

import org.apache.camel.CamelContext;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.DefaultCamelContext;

public class RouteBuilderExample {

public static void main(String args[]) throws Exception {
CamelContext context = new DefaultCamelContext();

context.addRoutes(new RouteBuilder() {
@Override
public void configure() {

from(“file:D:\\Files”).choice().when(header(“CamelFileName”).endsWith(“.csv”)).to(“file:D:\\CopyFileCsv”)
.when(header(“CamelFileName”).endsWith(“.txt”)).to(“file:D://CopyTextFile”);
}
});
context.start();
Thread.sleep(10000);
context.stop();
}
}