On Fri, Nov 4, 2011 at 10:48 AM, Donald Whytock <[email protected]> wrote:
> This showed up with camel-mail also.  It has to do with how URIs are
> parsed.  I believe there was a JIRA.

Looks like camel-ftp/RemoteFileConfiguration gets the user ID from the
URI the same way camel-mail/MailConfiguration does, by using
URI.getUserInfo().  This comes up null for URIs like
username@[email protected].

My opinion is that this is a glitch in URI.getUserInfo(), but that's
outside of Camel's control.  You can look for a user ID with an
embedded @ by using URI.getAuthority(), which fetches the domain and
everything to the left of it, then splitting on the rightmost @.

What I wound up doing when setting up mail routing in Java was
creating a MailEndpoint, using getConfiguration() to get its
MailConfiguration, and explicitly setting the user ID on that using
setUsername().  If ?username=<username> doesn't work for you, you can
do that with FTPEndpoint too.  But of course that won't help you if
you're using Spring.

Don

Reply via email to