Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 52048 invoked from network); 3 Oct 2006 12:01:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 3 Oct 2006 12:01:35 -0000 Received: (qmail 35730 invoked by uid 500); 3 Oct 2006 12:01:22 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 35671 invoked by uid 500); 3 Oct 2006 12:01:22 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 35597 invoked by uid 99); 3 Oct 2006 12:01:22 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Oct 2006 05:01:22 -0700 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests= Received: from [209.237.227.198] ([209.237.227.198:48392] helo=brutus.apache.org) by idunn.apache.osuosl.org (ecelerity 2.1.1.8 r(12930)) with ESMTP id AC/AB-29668-FF052254 for ; Tue, 03 Oct 2006 05:01:03 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 9A2A7714314 for ; Tue, 3 Oct 2006 04:59:19 -0700 (PDT) Message-ID: <24894946.1159876759629.JavaMail.root@brutus> Date: Tue, 3 Oct 2006 04:59:19 -0700 (PDT) From: "Vincentas Vienozinskis (JIRA)" To: commons-dev@jakarta.apache.org Subject: [jira] Created: (VFS-88) HostFileNameParser fails extracting user info MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N HostFileNameParser fails extracting user info --------------------------------------------- Key: VFS-88 URL: http://issues.apache.org/jira/browse/VFS-88 Project: Commons VFS Issue Type: Bug Environment: any Reporter: Vincentas Vienozinskis Priority: Trivial class org.apache.commons.vfs.provider.HostFileNameParser fails to extract user infomation from uri such as : ftp://user@somecompany:userpassword@sompny.site.com Note that User name : user@somecompany Password : userpassword As above uri is valid it should be parsed without exceptions. To fix this first ':' should be found instead of looking for '@' sign: fixed method : /** * Extracts the user info from a URI. The scheme:// part has been removed * already. */ protected String extractUserInfo(final StringBuffer name) { final int maxlen = name.length(); // First look for user info separator ':' then for '@' boolean separatorFound = false; for (int pos = 0; pos < maxlen; pos++) { final char ch = name.charAt(pos); if (ch == ':') { separatorFound = true; } if (ch == '@' && separatorFound) { // Found the end of the user info String userInfo = name.substring(0, pos); name.delete(0, pos + 1); return userInfo; } if (ch == '/' || ch == '?') { // Not allowed in user info break; } } // Not found return null; } -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org