commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ivan Lazarte (JIRA)" <j...@apache.org>
Subject [jira] Commented: (VFS-162) Url parsing incorrect with @ symbol in the password field.
Date Thu, 24 May 2007 20:03:16 GMT

    [ https://issues.apache.org/jira/browse/VFS-162?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12498801
] 

Ivan Lazarte commented on VFS-162:
----------------------------------

Here is my first pass fix in: SftpFileNameParser

	@Override
	protected String extractUserInfo(StringBuffer name) {

		int pos = name.lastIndexOf("@");

		if (pos < 0) {
			return null;
		}

		String userInfo = name.substring(0, pos);
		name.delete(0, pos + 1);

		if (userInfo.contains("/") || userInfo.contains("?")) {
			return null;
		}

		return userInfo;
	}

I believe this does the same thing logically as the originally except it looks for the last
index.  However, I'm having a hard time getting a valid filesystem instance out of this- the
path to integration is unclear to me.  If someone could advise a workaround, that would be
really helpful.  

Thanks!

> Url parsing incorrect with @ symbol in the password field.
> ----------------------------------------------------------
>
>                 Key: VFS-162
>                 URL: https://issues.apache.org/jira/browse/VFS-162
>             Project: Commons VFS
>          Issue Type: Bug
>    Affects Versions: 1.0
>         Environment: N/A
>            Reporter: Ivan Lazarte
>
> The file system being used used is SftpFileSystem.  After an initial look into, I'd have
to subclass and invoke the Jsch libs directly to potentially set the pw programmatically?
 It'd be nice if Sftp could accept a high level, non api specific method for programmatically
setting the pw.  
> Expected behavior is to choose the rightmost @ as the host delimiter, but a higher level
programmatic api is a nice to have as well.
> If I've missed anything in the api which lets me do this already, just let me know! :)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message