Index: src/main/java/org/jboss/virtual/plugins/context/zip/ZipEntryContext.java =================================================================== --- src/main/java/org/jboss/virtual/plugins/context/zip/ZipEntryContext.java (revision 94266) +++ src/main/java/org/jboss/virtual/plugins/context/zip/ZipEntryContext.java Fri May 07 20:29:00 CEST 2010 @@ -1202,6 +1202,18 @@ } /** + * Returns the path to physical file, which can be used to construct a jar:file URL. + * This will only be non-null for nested jars when forceCopy is enabled. + * For nested jars it will point into temp directory location where they have been extraced. + * + * @return filePath to zip file + */ + protected String getFilePath() + { + return filePath; + } + + /** * Internal data structure holding meta information of a virtual file in this context */ static class EntryInfo Index: src/main/java/org/jboss/virtual/plugins/context/zip/ZipEntryHandler.java =================================================================== --- src/main/java/org/jboss/virtual/plugins/context/zip/ZipEntryHandler.java (revision 94204) +++ src/main/java/org/jboss/virtual/plugins/context/zip/ZipEntryHandler.java Fri May 07 20:50:45 CEST 2010 @@ -262,10 +262,21 @@ URL realUrl = aPeer.getLocalVFSContext().getRoot().getRealURL(); String urlStr = realUrl.toExternalForm(); if (urlStr.endsWith("!/")) + { return new URL(urlStr + aPeer.getLocalPathName()); + } else + { + String path = getZipEntryContext().getFilePath(); + if (path != null) + { + if (path.endsWith("/")) + path = path.substring(0, path.length()-1); + return new URL("jar:file:" + path + "!/"); + } return realUrl; - } + } + } throw new RuntimeException("Operation not supported for handler: " + this); }