Hi,

I have a small question about Endpoint construction.
I'm trying to construct an endpoint programmatically.
But I am missing something and I don't know what it is.

Take, for example, a simple case :

public class FileRouteBuilder extends RouteBuilder {

        public void configure() throws Exception {

                FileEndpoint input = new FileEndpoint();
                input.setCamelContext(getContext());
                input.setFile(new File("c:/post"));
                input.setDelete(true);

                FileEndpoint output = new FileEndpoint();
                output.setCamelContext(getContext());
                output.setFile(new File("c:/backup"));

                from(input).to(output);
        }
}

The endpoint URI for the input is shown, in the log, as :
[...]
INFO: Route: route1 started and consuming from: Endpoint[file://c:\post]
[...]

But, if I use string representation for the same endpoint - at least what I'm thinking is the same endpoint -, such as

public class FileRouteBuilder extends RouteBuilder {

        public void configure() throws Exception {

                from("file://c:/post?delete=true").to("file://c:/backup");
        }

}

I'm getting another URI :
[...]
INFO: Route: route1 started and consuming from: Endpoint[file://c:/post?delete=true]
[...]

So, it seems the options are missing.
Should I call a certain method in order to correctly build the Endpoint after setting the options ?

Regards.
--
Bruno Dusausoy
YP5 Software

--
Pensez environnement : limitez l'impression de ce mail.
Please don't print this e-mail unless you really need to.

Reply via email to