[jboss-cvs] JBossAS SVN: r95248 - projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/vfs/spi.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Oct 21 00:06:17 EDT 2009


Author: david.lloyd at jboss.com
Date: 2009-10-21 00:06:16 -0400 (Wed, 21 Oct 2009)
New Revision: 95248

Modified:
   projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/vfs/spi/JavaZipFileSystem.java
Log:
Make sure that getFile() works for directories even in the zip filesystem

Modified: projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/vfs/spi/JavaZipFileSystem.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/vfs/spi/JavaZipFileSystem.java	2009-10-21 03:42:36 UTC (rev 95247)
+++ projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/vfs/spi/JavaZipFileSystem.java	2009-10-21 04:06:16 UTC (rev 95248)
@@ -150,8 +150,11 @@
             final JarEntry zipEntry = getNodeEntry(zipNode);
             final String name = zipEntry.getName();
             cachedFile = buildFile(contentsDir, name);
-            cachedFile.getParentFile().mkdirs(); 
-            VFSUtils.copyStreamAndClose(zipFile.getInputStream(zipEntry), new BufferedOutputStream(new FileOutputStream(cachedFile)));
+            if (zipEntry == null) {
+                cachedFile.mkdir();
+            } else {
+                VFSUtils.copyStreamAndClose(zipFile.getInputStream(zipEntry), new BufferedOutputStream(new FileOutputStream(cachedFile)));
+            }
             zipNode.cachedFile = cachedFile;
             return cachedFile;
         }




More information about the jboss-cvs-commits mailing list