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

Jeremy Carroll commented on JENA-662:
-------------------------------------

In my view the issue is that the % encoding of %'s is unclearly specified.
You are required to % escape certain characters, and not all.
Exactly which seems to depend ….

Since in this case:

1) {{/tmp/file name with space}} is a legal file name
2) {{file:///tmp/file name with space}}  is not a legal IRI
3) {{file:///tmp/file%20name%20with%20space}}  is a legal IRI that decodes to 
{{/tmp/file name with space}}

my take is that the only 'correct' implementation does indeed replace the %20 
with spaces, and if you want to talk about the file
{{/tmp/file%20name%20with%20space}} then the IRI you should use is
{{file:///tmp/file%2520name%2520with%2520space}} 

Identifying where in the software stack this should happen is difficult. It is 
made more difficult because java.net.URI predates the IRI spec, and as far as I 
know, has not been updated. I also do not believe that they would view this as 
their problem, but I suspect a careful analysis would make that the most 
suspect code

> Wrong space handling in FileModelAssembler
> ------------------------------------------
>
>                 Key: JENA-662
>                 URL: https://issues.apache.org/jira/browse/JENA-662
>             Project: Apache Jena
>          Issue Type: Bug
>          Components: Jena
>    Affects Versions: Jena 2.11.1
>            Reporter: Natanael Arndt
>            Priority: Minor
>
> The method {{getDirectoryName}} in 
> {{com.hp.hpl.jena.assembler.assemblers.FileModelAssembler}} should also make 
> sure that at some chars, like space should be urldecoded again. E.g. If the 
> URI is {{file:///tmp/file%20name%20with%20space}} the corresponding file can 
> not be found under {{/tmp/file%20name%20with%20space}} but under  {{/tmp/file 
> name with space}}.
> There might be some other chars which have to be taken into account, e.g. 
> "%25" -> "%", but I don't think a urldecode over the whole string is correct.
> Sorry I can't provide an example yet, because I couldn't isolate this part of 
> the code so far and I didn't try to write a test for this.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to