Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.4
-
None
-
None
-
Unix, Eclipse 3.3
-
Patch
Description
Currently, the plugin constructs the URL for the javadoc attachment via
"jar:file:/" + javadocpath + "!/"
Now, consider a unix path like "/home/me/.m2/<snip>.jar". This will produce the URL "jar:file://home/me/.m2/<snip>.jar!/". Note the double slash after "file:" which will cause "home" to be parsed as a hostname instead of a directory. This misinterpretation makes Eclipse fail to access the javadocs. Acceptable URLs would either be "jar:file:/home/..." or "jar:file:///home/...".
The simple solution is to use java.io.File.toURI() for this job. This method will not only properly handle slashes but also care for encoding of characters that may appear in filesystem paths but are illegal in URLs (most prominently spaces).