aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r1096801 - in /aries/branches/0.2-incubating-RCx/application: ./ application-utils/src/main/java/org/apache/aries/application/utils/filesystem/impl/ZipDirectory.java
Date Tue, 26 Apr 2011 16:48:35 GMT
Author: gawor
Date: Tue Apr 26 16:48:34 2011
New Revision: 1096801

URL: http://svn.apache.org/viewvc?rev=1096801&view=rev
Log:
Merged partial fix for ARIES-521 - handles zip files without directory entries

Modified:
    aries/branches/0.2-incubating-RCx/application/   (props changed)
    aries/branches/0.2-incubating-RCx/application/application-utils/src/main/java/org/apache/aries/application/utils/filesystem/impl/ZipDirectory.java

Propchange: aries/branches/0.2-incubating-RCx/application/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Tue Apr 26 16:48:34 2011
@@ -0,0 +1 @@
+/incubator/aries/trunk/application:983779,984819,985113,1051507

Modified: aries/branches/0.2-incubating-RCx/application/application-utils/src/main/java/org/apache/aries/application/utils/filesystem/impl/ZipDirectory.java
URL: http://svn.apache.org/viewvc/aries/branches/0.2-incubating-RCx/application/application-utils/src/main/java/org/apache/aries/application/utils/filesystem/impl/ZipDirectory.java?rev=1096801&r1=1096800&r2=1096801&view=diff
==============================================================================
--- aries/branches/0.2-incubating-RCx/application/application-utils/src/main/java/org/apache/aries/application/utils/filesystem/impl/ZipDirectory.java
(original)
+++ aries/branches/0.2-incubating-RCx/application/application-utils/src/main/java/org/apache/aries/application/utils/filesystem/impl/ZipDirectory.java
Tue Apr 26 16:48:34 2011
@@ -100,12 +100,17 @@ public class ZipDirectory extends ZipFil
     StringBuilder baseBuilderCrapThingToGetRoundFindBugs = new StringBuilder(getName());
     
     if (!!!isRoot()) baseBuilderCrapThingToGetRoundFindBugs.append('/');
-    
-    if (paths != null && paths.length > 1) {
+    // Build 'result' as a chain of ZipDirectories. This will only work if java.util.ZipFile
recognises every 
+    // directory in the chain as being a ZipEntry in its own right. 
+    outer: if (paths != null && paths.length > 1) {
       for (int i = 0; i < paths.length - 1; i++) {
         String path = paths[i];
         baseBuilderCrapThingToGetRoundFindBugs.append(path);
         ZipEntry dirEntry = getEntry(baseBuilderCrapThingToGetRoundFindBugs.toString());
+        if (dirEntry == null) { 
+          result = this;
+          break outer;
+        }
         result = new ZipDirectory(zip, dirEntry, result);
         baseBuilderCrapThingToGetRoundFindBugs.append('/');
       }



Mime
View raw message