Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -470,11 +470,13 @@ private WebResource urlToWebResource( URL url, String path )
// url.getFile is
// file:/Users/olamy/mvn-repo/org/springframework/spring-web/4.0.0.RELEASE/spring-web-4.0.0.RELEASE.jar!/org/springframework/web/context/ContextLoaderListener.class

int idx = url.getFile().indexOf( '!' );
URI uri = new URI(url.getFile());
String filePath = uri.getPath();
int idx = filePath.indexOf( '!' );

if ( idx >= 0 )
{
String filePath = StringUtils.removeStart( url.getFile().substring( 0, idx ), "file:" );
filePath = filePath.substring( 0, idx);

jarFile = new JarFile( filePath );

Expand All @@ -483,17 +485,21 @@ private WebResource urlToWebResource( URL url, String path )
return new JarResource( this, //
getPath(), //
filePath, //
url.getPath().substring( 0, idx ), //
"file:"+filePath, //
jarEntry, //
"", //
null );
}
else
{
return new FileResource( this, webAppPath, new File( url.getFile() ), true );
return new FileResource( this, webAppPath, new File( filePath ), true );
}

}
catch (URISyntaxException e)
{
throw new RuntimeException( e.getMessage(), e );
}
catch ( IOException e )
{
throw new RuntimeException( e.getMessage(), e );
Expand Down