commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bernd Eckenfels (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (VFS-203) FileObject..getName().getURI() returns URIs with spaces
Date Mon, 28 Sep 2015 19:12:05 GMT

    [ 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)

Mime
View raw message