Hi Pubudu,

What you can do is have the below part of the uri in some property.

  <property name="filelocation"
                   value="file://home/pubudup/data/fileopen/inbound/
original/"
                   scope="default"
                   type="STRING"/>

And then have another property to append the file name to the end.
Something like blew.

<property name="completeLocation"

 expression="fn:concat(get-property('filelocation'),get-property('FILE_NAME'),'
')"
                   scope="default"
                   type="STRING"/>

Then in the connector try something as below,

<fileconnector.copy>
            <source>*{$ctx:completeLocation}*</source>
            <destination>sftp://john:****@10.100.7.95/www/</destination>
            <setTimeout>10000</setTimeout>
            <setPassiveMode>true</setPassiveMode>
            <setSoTimeout>10000</setSoTimeout>
            <setUserDirIsRoot>false</setUserDirIsRoot>
            <setStrictHostKeyChecking>no</setStrictHostKeyChecking>
         </fileconnector.copy>



On Thu, Nov 24, 2016 at 1:42 PM, Pubudu Priyashan <[email protected]> wrote:

> Hi all,
>
> I am using the file connector to copy a file from locationA to locationB.
> I would like to know how we can identify the file name if it's variable and
> append it to the file connector source url.
>
> for example, let's say I have already captured the file name in a property.
>
> eg:-
>          <property name="FileName"
>                    expression="get-property('transport', 'FILE_NAME')"
>                    scope="default"
>                    type="STRING"/>
>
> I would like to append the value of the above property instead of having
> 'test.pdf' in the source location in my file connector below.
>
>
>          <fileconnector.copy>
>             <source>file://home/pubudup/data/fileopen/inbound/
> original/test.pdf</source>
>             <destination>sftp://john:****@10.100.7.95/www/</destination>
>             <setTimeout>10000</setTimeout>
>             <setPassiveMode>true</setPassiveMode>
>             <setSoTimeout>10000</setSoTimeout>
>             <setUserDirIsRoot>false</setUserDirIsRoot>
>             <setStrictHostKeyChecking>no</setStrictHostKeyChecking>
>          </fileconnector.copy>
>
> Cheers,
> Pubudu D.P
> Senior Software Engineer - QA Team | WSO2 inc.
> Mobile : +94775464547
>
> Linkedin: https://uk.linkedin.com/in/pubududp
> Medium: https://medium.com/@pubududp
>
>


-- 
Regards,
*Shafreen*
Software Engineer
WSO2 Inc
Mobile : 077-556-395-1
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to