Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.0-rc2
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
The patch is included below...
We're starting Jetty from an uberjar and are passing the war file as jar:file:uberjar.jar!/ourapp.war instead of having to extract it manually. It works well with the patch, which when returning the File for the jar removes the 'file:' from the path and also decodes it to remove the %20 that get inserted for spaces in the file path.
Index: src/java/main/com/werken/classworlds/protocol/jar/JarUrlConnection.java
===================================================================
RCS file: /cvsroot/classworlds/classworlds/src/java/main/com/werken/classworlds/protocol/jar/JarUrlConnection.java,v
retrieving revision 1.3
diff -u -r1.3 JarUrlConnection.java
— src/java/main/com/werken/classworlds/protocol/jar/JarUrlConnection.java 4 May 2003 01:38:14 -0000 1.3
+++ src/java/main/com/werken/classworlds/protocol/jar/JarUrlConnection.java 12 Jun 2003 07:42:34 -0000
@@ -51,6 +51,7 @@
import java.net.JarURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
+import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
@@ -264,6 +265,11 @@
*/
public JarFile getJarFile() throws IOException
{
- return new JarFile( getURL().getFile() );
+ String url = baseResource.toExternalForm();
+ if ( url.startsWith("file:/" ) )
+ { + url = url.substring(6); + }+ return new JarFile( URLDecoder.decode( url, "UTF-8" ) );
}
}
Patch applied.