camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Is that possible to override the properties that are loaded from classpath?
Date Tue, 16 Nov 2010 16:24:18 GMT
Hi

You can also implement your custom PropertyResolver and set it on the
Properties component.
Then you can control how the properties is resolved.

But as Willem said, maybe the jasypt encryption stuff is something
that works for you.
Then you can use that out of the box.

On Tue, Nov 16, 2010 at 2:50 AM, yli <yimingLearnCamel@gmail.com> wrote:
>
> Hi all,
>       Now in my project, I am trying to load a password value from the
> property file(or technically speaking from classpath).
>       But it is not a good idea to write the clear text of password in the
> property file, so I decided to put the encrypted string of the password in
> the property file and decrypted it on the fly after loading from the
> property.
>       Here is some code to make the problem more clear:
>       In the property file(myProperty.properties) I have:
>       ...
>       password=encryptedPassword
>       ...
>
>       In the camle context file, I have
>       <bean id="properties"
> class="org.apache.camel.component.properties.PropertiesComponent">
>        <property name="locations"
>                  value="myProperty.properties" />
>       </bean>
>
>       Basically I want to decrypt "password" at runtime and refer it in a
> <camel:simple> expression, for example:
> <camel:simple>password=${properties:password}</camel:simple>
>       Is there an easy way to achieve this?
>
>       Thank you very much!
> --
> View this message in context: http://camel.465427.n5.nabble.com/Is-that-possible-to-override-the-properties-that-are-loaded-from-classpath-tp3266760p3266760.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Mime
View raw message