You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Aaron Digulla (JIRA)" <ji...@codehaus.org> on 2011/05/23 15:28:22 UTC

[jira] Commented: (DOXIA-431) Doxia creates illegal URLs from local paths

    [ http://jira.codehaus.org/browse/DOXIA-431?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=268177#action_268177 ] 

Aaron Digulla commented on DOXIA-431:
-------------------------------------

In an external project, there are image files which contain spaces. Instead of replacing the spaces with %20 or calling {{java.net.URLEncoder.encode()}}, Doxia tries to call {{new java.net.URL("images/The ExTeX Project.png"}} which fails.

I tried a fix but couldn't get it to work in a couple of hours. The problem is that you use a lot of Strings when you should be using URLs (or at least a URL-like type). Without such a type, it's impossible to know when a URL must be encoded/decoded.

Example stacktrace:

{code}
Caused by: java.lang.IllegalArgumentException
        at java.net.URI.create(URI.java:842)
        at org.apache.maven.doxia.site.decoration.inheritance.URIPathDescriptor.<init>(URIPathDescriptor.java:69)
        at org.apache.maven.doxia.site.decoration.inheritance.DefaultDecorationModelInheritanceAssembler.rebaseLink(DefaultDecorationModelInheritanceAssembler.java:361)
        at org.apache.maven.doxia.site.decoration.inheritance.DefaultDecorationModelInheritanceAssembler.rebaseBannerPaths(DefaultDecorationModelInheritanceAssembler.java:162)
        at org.apache.maven.doxia.site.decoration.inheritance.DefaultDecorationModelInheritanceAssembler.assembleModelInheritance(DefaultDecorationModelInheritanceAssembler.java:61)
        at org.apache.maven.doxia.tools.DefaultSiteTool.getDecorationModel(DefaultSiteTool.java:1221)
        at org.apache.maven.doxia.tools.DefaultSiteTool.getDecorationModel(DefaultSiteTool.java:458)
        at org.apache.maven.plugins.site.AbstractSiteRenderingMojo.createSiteRenderingContext(AbstractSiteRenderingMojo.java:285)
        at org.apache.maven.plugins.site.SiteMojo.renderLocale(SiteMojo.java:140)
        at org.apache.maven.plugins.site.SiteMojo.execute(SiteMojo.java:124)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:107)
        ... 20 more
Caused by: java.net.URISyntaxException: Illegal character in path at index 10: images/The ExTeX Project.png
        at java.net.URI$Parser.fail(URI.java:2809)
        at java.net.URI$Parser.checkChars(URI.java:2982)
        at java.net.URI$Parser.parseHierarchical(URI.java:3066)
        at java.net.URI$Parser.parse(URI.java:3024)
        at java.net.URI.<init>(URI.java:578)
        at java.net.URI.create(URI.java:840)
        ... 30 more
{code}




> Doxia creates illegal URLs from local paths
> -------------------------------------------
>
>                 Key: DOXIA-431
>                 URL: http://jira.codehaus.org/browse/DOXIA-431
>             Project: Maven Doxia
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.2
>            Reporter: Aaron Digulla
>
> If a local resource contains characters which are illegal in a URL, Doxia creates illegal code or crashes.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira