RE: How can i configure dynamic FTP End Points in Mule ?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

RE: How can i configure dynamic FTP End Points in Mule ?

Tashani Kathriarachchi
Hi David,

I am trying to retrieve FTP connection details from Database. It is giving extra sybols along with the data. Please let me know how to remove this special characters.

Configuration XML



<flow name="dynamicjdbc2Flow1" doc:name="dynamicjdbc2Flow1">
<jdbc:inbound-endpoint exchange-pattern="one-way" queryKey="DSQuery" queryTimeout="-1" pollingFrequency="1000" connector-ref="Database__JDBC_" doc:name="Database (JDBC)"><jdbc:query key="DSQuery" value="SELECT &quot;User&quot;,&quot;Password&quot;,&quot;Host&quot;, &quot;Port&quot;,&quot;Path&quot; FROM &quot;User&quot;; "/>
</jdbc:inbound-endpoint><scripting:component doc:name="Groovy">
<scripting:script engine="Groovy">
<scripting:text><![CDATA[def ftpFileUri = "ftp://${payload.User}:${payload.Password}@${payload.Host}:${payload.Port}${payload.Path}"muleContext.client.request(ftpFileUri,30000L);println ftpFileUri;]]>
</scripting:text>
</scripting:script>
</scripting:component>
</flow>



Output

ftp://anonymous%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20:[hidden email]%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20:21/Partha, connector=FtpConnector

Thanks
Partha --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
Reply | Threaded
Open this post in threaded view
|

RE: How can i configure dynamic FTP End Points in Mule ?

Tashani Kathriarachchi
Have you checked the data in the database?

I think you'd need to have these %20 in the DB to have them printed out from the script, as I don't see any URL encoding of ftpFileUri being done (which would turn spaces into %20). --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
Reply | Threaded
Open this post in threaded view
|

RE: How can i configure dynamic FTP End Points in Mule ?

Tashani Kathriarachchi
In reply to this post by Tashani Kathriarachchi
Thanks David. I checked the Database.There are extra spaces in DB. Dut to this %20 is coming in the output.

Please let me know how to code to supress this spaces from mule side. I have mentiond my groovy script in the above conversation. --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
Reply | Threaded
Open this post in threaded view
|

RE: How can i configure dynamic FTP End Points in Mule ?

Tashani Kathriarachchi
In reply to this post by Tashani Kathriarachchi
Let's hope the usernames/passwords don't start or end with spaces...

Use: ${payload.User.trim()} and ${payload.Password.trim()} --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
Reply | Threaded
Open this post in threaded view
|

RE: How can i configure dynamic FTP End Points in Mule ?

Tashani Kathriarachchi
In reply to this post by Tashani Kathriarachchi
Thanks David. --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email