Hi You can use the Camel properties component which is also supported in the Simple language http://camel.apache.org/simple.html http://camel.apache.org/properties
And if you use Camel 2.4 you can bridge the Camel properties component to use Spring property placeholder using the ref prefix in the location On Fri, Aug 6, 2010 at 9:01 AM, vcheruvu <[email protected]> wrote: > > Hi, > > I am using below config to read files from specific directory. > > <route id="readCTSFile" startupOrder="2" shutdownRoute="Defer"> > <from > uri="file://dev/source/cts?delay=10000&delete=false&exclude=.done&move=.done/${file:name.noext}-${date:now:yyyyMMddHHmmss}&moveFailed=.error/${file:name.noext}-${date:now:yyyyMMddHHmmss}.error&autoCreate=false"/> > <!-- <to > uri="flatpack:fixed:META-INF/flatpack/CTSFixedLength.pzmap.xml"/>--> > <unmarshal ref="flatPackRef"/> > <to uri="bean:mapCTStoBedBean?method=mapCTSLineToBed"/> > </route> > <!-- > --> > <!-- The will be the encryptor used for decrypting configuration values. > --> > <!-- > --> > <bean id="configurationEncryptor" > class="org.jasypt.encryption.pbe.StandardPBEStringEncryptor"> > <property name="config" ref="environmentVariablesConfiguration" /> > </bean> > > <bean id="propertyConfigurer" > > class="org.jasypt.spring.properties.EncryptablePropertyPlaceholderConfigurer"> > <constructor-arg ref="configurationEncryptor" /> > <property name="locations"> > <list> > <!-- when java app starts, env value is passed from the program > arguments-> > <value>classpath:META-INF/properties/${env}.properties</value> > </list> > </property> > > </bean> > > > Now, I am trying to figure out based on environment where application was > deployed the directory will be changed i.e > > dev/source/cts -- dev environment > uat/source/cts -- uat environment. > > > The camel file component site clearly explains that "... the starting > directory must not contain dynamic expressions with ${ } placeholders." I > am already using Spring placeholder feature and setting database connections > details from dev.properties or uat.properties file. How can I get File > component to read environment properties file to get directory name? > > Kind regards, > -Vid- > -- > View this message in context: > http://camel.465427.n5.nabble.com/File-Component-directory-name-changes-based-on-environment-location-tp2266342p2266342.html > Sent from the Camel - Users mailing list archive at Nabble.com. > -- Claus Ibsen Apache Camel Committer Author of Camel in Action: http://www.manning.com/ibsen/ Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus
