camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Borut BolĨina <borut.bolc...@gmail.com>
Subject Configuring endpoint programmatically
Date Mon, 26 Mar 2012 11:16:43 GMT
Hello again,

The File component can be configured with some options, I am interested in
"noop=true". What can be done by:

from("file:src/test/resources?fileName=myFile.xml&noop=true")

is what I want to do it with code:

String fileName = "src/test/resources/myFile.xml";
Endpoint endpoint = new FileEndpoint("file:" + fileName, new
FileComponent());
 Map<String, Object> options = new HashMap();
options.put("noop", "true");
 endpoint.configureProperties(options);

but it does not work - the file is still moved, which is something I do not
want. I tried with boolean value as well, but the same result. I found
nothing in the mailing list, nor in the Camel book.

I also tried:

String fileName = "myFile.xml";
FileComponent fileComponent = new FileComponent();
 fileComponent.setCamelContext(context);
Endpoint endpoint = fileComponent.createEndpoint("file:" + fileName);
 Map<String, Object> options = new HashMap();
options.put("noop", "true");
 endpoint.configureProperties(options);

but no success either.

-borut

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message