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 D8FF618B58 for ; Mon, 28 Sep 2015 19:12:27 +0000 (UTC) Received: (qmail 10408 invoked by uid 500); 28 Sep 2015 19:12:05 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 10329 invoked by uid 500); 28 Sep 2015 19:12:05 -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 10315 invoked by uid 99); 28 Sep 2015 19:12:05 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Sep 2015 19:12:05 +0000 Date: Mon, 28 Sep 2015 19:12:05 +0000 (UTC) From: "Bernd Eckenfels (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (VFS-203) FileObject..getName().getURI() returns URIs with spaces 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-203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14933812#comment-14933812 ] Bernd Eckenfels edited comment on VFS-203 at 9/28/15 7:12 PM: -------------------------------------------------------------- Hm, there seems to be a general problem, getDecodedPath/getPath API of AbstractFileName seems to make clear that it expects to store encoded names, so getURI can simple use that name. There is no special LocalFileName encoding needed as other FileNames can have that problem (including space) as well. How about this test: {code} FileObject f = VFS.getManager().resolveFile("tmp://temp%20folder/temp%20file@%25%3F"); assertEquals("/temp folder/temp file@%?", f.getName().getPathDecoded()); assertEquals("/temp%20folder/temp%20file@%25%3F", f.getName().getPath()); {code} If this is expected from a FileName, toURI() can be trivially implemented with getPath(). was (Author: b.eckenfels): Hm, there seems to be a general problem, getDecodedPath/getPath API of AbstractFileName seems to make clear that it expects to store encoded names, so getURI can simple use that name. There is no special LocalFileName encoding needed as other FileNames can have that problem (including space) as well. > FileObject..getName().getURI() returns URIs with spaces > ------------------------------------------------------- > > Key: VFS-203 > URL: https://issues.apache.org/jira/browse/VFS-203 > Project: Commons VFS > Issue Type: Bug > Affects Versions: 1.0 > Reporter: Tim Lebedkov > Attachments: VFD-203-v2.patch, VFD-203-v3.patch, patch.txt > > > Windows supports file names with spaces and '#'. AFAIK spaces are not allowed in URIs and # will be interpreted as an URI fragment. -- This message was sent by Atlassian JIRA (v6.3.4#6332)