Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C1AF9112CF for ; Tue, 10 Jun 2014 04:17:04 +0000 (UTC) Received: (qmail 8287 invoked by uid 500); 10 Jun 2014 04:17:04 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 8156 invoked by uid 500); 10 Jun 2014 04:17:02 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 8145 invoked by uid 99); 10 Jun 2014 04:17:02 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Jun 2014 04:17:02 +0000 Date: Tue, 10 Jun 2014 04:17:02 +0000 (UTC) From: "Paul (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (VFS-398) FtpFileObject.getChildren() fails when a folder contains a file with a colon in the name MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/VFS-398?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14026105#comment-14026105 ] Paul commented on VFS-398: -------------------------- We have been waiting for 2.1 a release to fix this bug for over a year and a half. It cripples our app that uses webdav and sftp (both are effected). There are lots of files starting with "jcr:" on our servers with webdav services. > FtpFileObject.getChildren() fails when a folder contains a file with a colon in the name > ---------------------------------------------------------------------------------------- > > Key: VFS-398 > URL: https://issues.apache.org/jira/browse/VFS-398 > Project: Commons VFS > Issue Type: Bug > Affects Versions: 2.0 > Environment: Connecting via FTP to a host running SunOS 5.10 > Reporter: Mark Leonard > Priority: Blocker > Fix For: 2.1 > > > In line 767 of DefaultFileSystemManager.java the UriParser's extractScheme() method is called: > String scheme = UriParser.extractScheme(buffer.toString()); > This code was added in revision 780730 > http://svn.apache.org/viewvc?view=revision&revision=780730 > It is not clear to me why this change was made. > For the FTP provider, buffer contains a plain file name (i.e. without a path and definitely not in URI form) > A colon is a valid character for a file name. > However a colon will be interpreted as a URI scheme name. > This causes an exception when the resolved path is checked using AbstractFileName.checkName() > Sample code: > FileObject fo = VFS.getManager().resolveFile("ftp://user:pass@host/some/path/some.file"); > fo.getParent().getChildren(); > If /some/path/ contains a child such as PREFIX:SUFFIX then an exception is thrown: > Exception in thread "main" org.apache.commons.vfs2.FileSystemException: Invalid descendent file name "PREFIX:SUFFIX". > at org.apache.commons.vfs2.impl.DefaultFileSystemManager.resolveName(DefaultFileSystemManager.java:791) > at org.apache.commons.vfs2.provider.AbstractFileObject.getChildren(AbstractFileObject.java:710) > at org.apache.commons.vfs2.provider.ftp.FtpFileObject.getChildren(FtpFileObject.java:420) > Therefore calling code is unable to list the children of the specified folder. -- This message was sent by Atlassian JIRA (v6.2#6252)