History | Log In     View a printable version of the current page. Get help!  
Issue Details (XML | Word)

Key: JBCOMMON-38
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Dimitris Andreadis
Reporter: Davide Baroncelli
Votes: 0
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
JBoss Common

Use URI instead of URL in FileProtocolArchiveBrowserFactory

Created: 16/Oct/07 09:27 AM   Updated: 16/Oct/07 10:14 AM
Component/s: None
Affects Version/s: None
Fix Version/s: None
Security Level: Public (Everyone can see)

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown


 Description  « Hide
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).

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order:
Dimitris Andreadis [16/Oct/07 10:14 AM]
Please, don't set the fix version and the criticality.