This content has been marked as final.
Show 2 replies
-
1. Re: How to get a resource from a bundle when it is created via blueprint?
davsclaus Jan 25, 2012 6:01 AM (in response to sekaijin)And you have that .properties file in the root of the classpath of your Camel bundle?
Camel has API for loading resources. So you can try with:
InputStream is = getCamelContext().getClassResolver().loadResourceAsStream("myProperties.properties");
-
2. Re: How to get a resource from a bundle when it is created via blueprint?
sekaijin Mar 8, 2012 4:07 AM (in response to davsclaus)Thank you.
sorry for the late reply, I interrupted my development for some time.
I found the following solution that works.
RouteBuilder in my class I do:
getClass().getClassLoader().getResource(resource).openStream();
What is strange is that if I do it in a bean, that does not work.
and in a bean I did not camelContext. I can't call
getCamelContext()
I have chosen as a solution to pass the routeBuilder classloader on create.
Bye