camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yli <yimingLearnCa...@gmail.com>
Subject Is that possible to override the properties that are loaded from classpath?
Date Tue, 16 Nov 2010 01:50:57 GMT

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.

Mime
View raw message