You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2002/07/04 11:06:23 UTC
DO NOT REPLY [Bug 10469] New: -
URLs of resources from application archives contain spaces
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10469>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10469
URLs of resources from application archives contain spaces
Summary: URLs of resources from application archives contain
spaces
Product: Tomcat 4
Version: 4.0.4 Final
Platform: All
OS/Version: Other
Status: NEW
Severity: Normal
Priority: Other
Component: Catalina
AssignedTo: tomcat-dev@jakarta.apache.org
ReportedBy: borismotik@yahoo.com
If Tomcat is installed in a directory with spaces, then the following code
breaks because application class loader will put spaces in the resource URL:
URL url=Test.class.getResource("res/resource.gif");
String useURI=url.toString();
URI uri=new URI(useURI);
For example, if installed under c:\temp\s p a c e s\catalina, Tomcat will
generate following URL:
jar:file:C:/Temp/s p a c e r/catalina/webapps/kaonportal/WEB-
INF/lib/apionrdf.jar!/test/res/resource.gif
The same code when executed from Java alone in the same directory will give
following URL:
jar:file:/C:/Temp/s%20p%20a%20c%20e%20r/test.jar!/test/res/resource.gif
In the latter case the spaces are correctly escaped with %20, whereas in the
case of running under Tomcat, the spaces are present in the URL, which is
incorrect according to the URL standard. The URL class doesn't check this, but
the URI class does, and the code breaks.
Boris Motik
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>