[
https://jira.jboss.org/jira/browse/JBCOMMON-38?page=com.atlassian.jira.pl...
]
Davide Baroncelli commented on JBCOMMON-38:
-------------------------------------------
Yes it is. Both this one and the other one indicated very clearly where the problem was,
and someone even attached a patch to the other bug: I haven't used this stuff in ages,
but if the bug is still there it's pretty outrageous.
Use URI instead of URL in FileProtocolArchiveBrowserFactory
-----------------------------------------------------------
Key: JBCOMMON-38
URL:
https://jira.jboss.org/jira/browse/JBCOMMON-38
Project: JBoss Common
Issue Type: Bug
Security Level: Public(Everyone can see)
Reporter: Davide Baroncelli
Assignee: Dimitris Andreadis
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:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira