[jira] [Comment Edited] (VFS-203) FileObject..getName().getURI() returns URIs with spaces

2015-09-28 Thread Bernd Eckenfels (JIRA)

[ 
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:15 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%23"); // 
upper
assertEquals("/temp folder/temp file@%?#", f.getName().getPathDecoded());
assertEquals("/temp%20folder/temp%20file@%25%3f%23", f.getName().getPath()); // 
lower
{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. 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().


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


[jira] [Comment Edited] (VFS-203) FileObject..getName().getURI() returns URIs with spaces

2015-09-28 Thread Bernd Eckenfels (JIRA)

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


[jira] [Comment Edited] (VFS-203) FileObject..getName().getURI() returns URIs with spaces

2015-09-24 Thread Joerg Schaible (JIRA)

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

Joerg Schaible edited comment on VFS-203 at 9/24/15 9:57 PM:
-

Not true for Unix:

{noformat}
  $ touch \?\"\\\*.txt
  $ ls -1 *.txt
  ?"\*.txt
  $ rm *.txt
{noformat}

Actually it depends also on the underlying file system. You can use NT in Linux 
or Ext3 in Windows. Wonder, what VFS can do about ...


was (Author: joehni):
Not true for Unix:

{noformat}
  $ touch \?\"\\\*.txt
  $ ls -1 *.txt
  ?"\*.txt
  $ rm *.txt
{noformat}

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