[jboss-jira] [JBoss JIRA] Created: (JBCOMMON-38) Use URI instead of URL in FileProtocolArchiveBrowserFactory
Davide Baroncelli (JIRA)
jira-events at lists.jboss.org
Tue Oct 16 09:28:03 EDT 2007
Use URI instead of URL in FileProtocolArchiveBrowserFactory
-----------------------------------------------------------
Key: JBCOMMON-38
URL: http://jira.jboss.com/jira/browse/JBCOMMON-38
Project: JBoss Common
Issue Type: Bug
Security Level: Public (Everyone can see)
Reporter: Davide Baroncelli
Assigned To: Dimitris Andreadis
Priority: Critical
Fix For: 2.2.2.GA
Current code in FileProtocolArchiveBrowserFactory has problems when the URL coming from above contains escaped characters. E.g.: In an app. I'm writing, the class receives an URL coming from a ClassLoader.getResources method: resources in directories containing square brackets arrive to the class in escaped URLs such as the following:
file:/C:/Stratosfera/pos_back/%5BCARCON%5Dstratosfera-verifica-cartoline-concorso/war/WEB-INF/classes/
this form fails in the current implementation because of line 40:
File f = new File(url.getPath());
this results in a non existing file. Replacing the line with the following solves the problem:
File f;
try {
f = new File(url.toURI());
}
catch ( URISyntaxException e ) {
throw new RuntimeException( e );
}
this problems creates various compatibility problems in depending libraries (hibernate entitymanager for one).
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list