[jboss-cvs] JBossAS SVN: r68560 - in projects/vfs/trunk/src: test/java/org/jboss/test/virtual/test and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Dec 26 11:27:48 EST 2007


Author: alesj
Date: 2007-12-26 11:27:48 -0500 (Wed, 26 Dec 2007)
New Revision: 68560

Modified:
   projects/vfs/trunk/src/main/java/org/jboss/virtual/plugins/context/jar/JarEntryContents.java
   projects/vfs/trunk/src/main/java/org/jboss/virtual/plugins/context/jar/NestedJarFromStream.java
   projects/vfs/trunk/src/main/java/org/jboss/virtual/plugins/context/jar/NoCopyNestedJarHandler.java
   projects/vfs/trunk/src/test/java/org/jboss/test/virtual/test/FileVFSUnitTestCase.java
Log:
Right entry name.

Modified: projects/vfs/trunk/src/main/java/org/jboss/virtual/plugins/context/jar/JarEntryContents.java
===================================================================
--- projects/vfs/trunk/src/main/java/org/jboss/virtual/plugins/context/jar/JarEntryContents.java	2007-12-26 16:13:39 UTC (rev 68559)
+++ projects/vfs/trunk/src/main/java/org/jboss/virtual/plugins/context/jar/JarEntryContents.java	2007-12-26 16:27:48 UTC (rev 68560)
@@ -60,18 +60,17 @@
            throws IOException
    {
       super(context, parent, jarURL, null, entry, entry.getName());
-      String entryName = entry.getName();
       try
       {
-         setPathName(getChildPathName(entryName, false));
-         setVfsUrl(getChildVfsUrl(entryName, false));
+         setPathName(getChildPathName(getName(), false));
+         setVfsUrl(getChildVfsUrl(getName(), false));
       }
       catch (Exception e)
       {
          throw new RuntimeException(e);
       }
       this.entryURL = entryURL;
-      this.isJar = JarUtils.isArchive(entryName);
+      this.isJar = JarUtils.isArchive(getName());
       int size = (int) entry.getSize();
       if (size <= 0)
          return;
@@ -215,7 +214,7 @@
       {
          ByteArrayInputStream bais = new ByteArrayInputStream(contents);
          ZipInputStream zis = new ZipInputStream(bais);
-         njar = new NestedJarFromStream(getVFSContext(), this, zis, entryURL, null, getEntry());
+         njar = new NestedJarFromStream(getVFSContext(), this, zis, entryURL, null, getEntry(), getName());
       }
    }
 }

Modified: projects/vfs/trunk/src/main/java/org/jboss/virtual/plugins/context/jar/NestedJarFromStream.java
===================================================================
--- projects/vfs/trunk/src/main/java/org/jboss/virtual/plugins/context/jar/NestedJarFromStream.java	2007-12-26 16:13:39 UTC (rev 68559)
+++ projects/vfs/trunk/src/main/java/org/jboss/virtual/plugins/context/jar/NestedJarFromStream.java	2007-12-26 16:27:48 UTC (rev 68560)
@@ -48,25 +48,26 @@
    /**
     * Create a nested jar from the parent zip inputstream/zip entry.
     *
-    * @param context - the context containing the jar
-    * @param parent  - the jar handler for this nested jar
-    * @param zis     - the jar zip input stream
-    * @param jarURL  - the URL to use as the jar URL
-    * @param jar     - the parent jar file for the nested jar
-    * @param entry   - the parent jar ZipEntry for the nested jar
+    * @param context   - the context containing the jar
+    * @param parent    - the jar handler for this nested jar
+    * @param zis       - the jar zip input stream
+    * @param jarURL    - the URL to use as the jar URL
+    * @param jar       - the parent jar file for the nested jar
+    * @param entry     - the zip entry
+    * @param entryName - the entry name
     * @throws IOException for any error
     */
-   public NestedJarFromStream(VFSContext context, VirtualFileHandler parent, ZipInputStream zis, URL jarURL, JarFile jar, ZipEntry entry) throws IOException
+   public NestedJarFromStream(VFSContext context, VirtualFileHandler parent, ZipInputStream zis, URL jarURL, JarFile jar, ZipEntry entry, String entryName) throws IOException
    {
-      super(context, parent, jarURL, jar, entry, entry.getName());
+      super(context, parent, jarURL, jar, entry, entryName);
       this.jarURL = jarURL;
       this.lastModified = entry.getTime();
       this.size = entry.getSize();
       this.zis = zis;
       try
       {
-         setPathName(getChildPathName(getName(), false));
-         setVfsUrl(getChildVfsUrl(getName(), false));
+         setPathName(getChildPathName(entryName, false));
+         setVfsUrl(getChildVfsUrl(entryName, false));
       }
       catch (Exception e)
       {

Modified: projects/vfs/trunk/src/main/java/org/jboss/virtual/plugins/context/jar/NoCopyNestedJarHandler.java
===================================================================
--- projects/vfs/trunk/src/main/java/org/jboss/virtual/plugins/context/jar/NoCopyNestedJarHandler.java	2007-12-26 16:13:39 UTC (rev 68559)
+++ projects/vfs/trunk/src/main/java/org/jboss/virtual/plugins/context/jar/NoCopyNestedJarHandler.java	2007-12-26 16:27:48 UTC (rev 68560)
@@ -85,7 +85,7 @@
          {
             zis = new ZipInputStream(is);
          }
-         njar = new NestedJarFromStream(context, parent, zis, url, parentJar, entry);
+         njar = new NestedJarFromStream(context, parent, zis, url, parentJar, entry, entryName);
       }
       catch (IOException original)
       {

Modified: projects/vfs/trunk/src/test/java/org/jboss/test/virtual/test/FileVFSUnitTestCase.java
===================================================================
--- projects/vfs/trunk/src/test/java/org/jboss/test/virtual/test/FileVFSUnitTestCase.java	2007-12-26 16:13:39 UTC (rev 68559)
+++ projects/vfs/trunk/src/test/java/org/jboss/test/virtual/test/FileVFSUnitTestCase.java	2007-12-26 16:27:48 UTC (rev 68560)
@@ -129,7 +129,7 @@
       VFSContext parent1 = pf1.getVFS(jar1URL);
 
       ZipInputStream jis1 = new ZipInputStream(jf.getInputStream(jar1));
-      NestedJarFromStream njfs = new NestedJarFromStream(context, parent1.getRoot(), jis1, jar1URL, jf, jar1);
+      NestedJarFromStream njfs = new NestedJarFromStream(context, parent1.getRoot(), jis1, jar1URL, jf, jar1, "jar1.jar");
       JarEntryContents e1 = njfs.getEntry("org/jboss/test/vfs/support/jar1/ClassInJar1.class");
       assertNotNull(e1);
       log.info("org/jboss/test/vfs/support/CommonClass.class: "+e1);
@@ -149,7 +149,7 @@
       VFSContext parent2 = pf2.getVFS(jar2URL);
 
       ZipInputStream jis2 = new ZipInputStream(jf.getInputStream(jar2));
-      NestedJarFromStream njfs2 = new NestedJarFromStream(context, parent2.getRoot(), jis2, jar2URL, jf, jar2);
+      NestedJarFromStream njfs2 = new NestedJarFromStream(context, parent2.getRoot(), jis2, jar2URL, jf, jar2, "jar2.jar");
       JarEntryContents e2 = njfs2.getEntry("org/jboss/test/vfs/support/jar2/ClassInJar2.class");
       assertNotNull(e2);
       log.info("org/jboss/test/vfs/support/CommonClass.class: "+e2);




More information about the jboss-cvs-commits mailing list