Results 1 to 7 of 7

Thread: Help with configuration

  1. #1
    Join Date
    Feb 2012
    Posts
    101

    Default Help with configuration

    Hi,

    Question 1:
    I have a configuration like this

    <sftp:outbound-channel-adapter channel="sendChannel"
    session-factory="sftpSessionFactory" id="sftpInboundAdapter"
    auto-create-directory="true"
    temporary-file-suffix = "temp"
    remote-directory="xxxxxx" />
    I would like to set the value of remote directory at run time.I am not sure how to do this.For the hostname,username and password I'm using setProperties through the class.

    Also, Is there an option to configure the outbound channel adapter through the class than through the xml config file.

    Please help.

    Question 2:


    <int:inbound-channel-adapter id="inboundAdapter" expression="new java.io.File('xxxxxx').listFiles()" >

    For the above expression, if I have to specify the java.io.File(<directory name>) in the properties file and then access it.Can I use PropertyPlaceholderConfigurer for this option.

    Please help me with this.

    Thanks

  2. #2
    Join Date
    Jan 2009
    Location
    Ukraine, Kharkov
    Posts
    645

    Default

    Hello

    I can answer you for second question:
    HTML Code:
    <inbound-channel-adapter expression="new java.io.File('${dirName}').listFiles()">
    About first question: need more time to think.

    Nevertheless, it will be more flexible to start new forum thread only with one question and in the subject reflect the problem.

    Good luck!

    Artem

  3. #3
    Join Date
    Feb 2012
    Posts
    101

    Default

    Thank you so much for the response.

    Please correct me if I'm wrong .specifying dirname in the properties file should substitute the value here, but should I configure the name of the properties file through the PropertiesPlaceConfigurer.

    Sure,will use separate threads.Since both where respect to configuration I used one thread.

    Thanks

  4. #4
    Join Date
    Jan 2009
    Location
    Ukraine, Kharkov
    Posts
    645

    Default

    specifying dirname in the properties file should substitute the value here
    Yes, it is. In the properties you configure e.g.: dirName=C:\Windows

    but should I configure the name of the properties file through the PropertiesPlaceConfigurer
    Not sure what do you mean, but I configure my placeholder like this:
    HTML Code:
    <util:properties id="mailProperties" location="classpath:/mail.properties"/>
    <context:property-placeholder properties-ref="mailProperties" location="classpath*:**/mail-password.properties"/>

  5. #5
    Join Date
    Feb 2012
    Posts
    101

    Default

    Just for my understanding...
    The first line gives the location of mail.properties referred by the id "mailProperties"

    and in the second line we refer to id mailProperties but can you also please tell what is the location in the second line indicate.

    Thanks.

  6. #6
    Join Date
    Jan 2009
    Location
    Ukraine, Kharkov
    Posts
    645

    Default

    I've shown you the abilities of <contextroperty-placeholder/>.
    In the end both properties object will be merged on the background and you can use placeholders for properties from both files.
    For more info, please, read this one: http://static.springsource.org/sprin...lderconfigurer

  7. #7
    Join Date
    Feb 2012
    Posts
    101

    Default

    Thanks very much for the help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •