Return-Path: X-Original-To: apmail-commons-commits-archive@minotaur.apache.org Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 54E2110808 for ; Sat, 26 Oct 2013 14:25:56 +0000 (UTC) Received: (qmail 32106 invoked by uid 500); 26 Oct 2013 14:25:10 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 31975 invoked by uid 500); 26 Oct 2013 14:25:09 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 31576 invoked by uid 99); 26 Oct 2013 14:25:00 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 26 Oct 2013 14:25:00 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 26 Oct 2013 14:24:19 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 460AD2388CBB for ; Sat, 26 Oct 2013 14:22:29 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r884228 [33/50] - in /websites/production/commons/content/proper/commons-compress: ./ cobertura/ Date: Sat, 26 Oct 2013 14:22:17 -0000 To: commits@commons.apache.org From: bodewig@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20131026142229.460AD2388CBB@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: websites/production/commons/content/proper/commons-compress/cobertura/org.apache.commons.compress.archivers.zip.ZipArchiveEntry.html ============================================================================== --- websites/production/commons/content/proper/commons-compress/cobertura/org.apache.commons.compress.archivers.zip.ZipArchiveEntry.html (original) +++ websites/production/commons/content/proper/commons-compress/cobertura/org.apache.commons.compress.archivers.zip.ZipArchiveEntry.html Sat Oct 26 14:22:15 2013 @@ -133,7 +133,7 @@
     private static final int SHORT_MASK = 0xFFFF;
 58  
     private static final int SHORT_SHIFT = 16;
-  59  1
     private static final byte[] EMPTY = new byte[0];
+  59  2
     private static final byte[] EMPTY = new byte[0];
 60  
 
 61   @@ -156,7 +156,7 @@
      *        >COMPRESS-93</a>
 70  
      */
-  71  727
     private int method = -1;
+  71  1454
     private int method = -1;
 72  
 
 73   @@ -171,17 +171,17 @@
      * information for Zip64 support.
 78  
      */
-  79  727
     private long size = SIZE_UNKNOWN;
+  79  1454
     private long size = SIZE_UNKNOWN;
 80  
 
-  81  727
     private int internalAttributes = 0;
-  82  727
     private int platform = PLATFORM_FAT;
-  83  727
     private long externalAttributes = 0;
-  84  727
     private LinkedHashMap<ZipShort, ZipExtraField> extraFields = null;
-  85  727
     private UnparseableExtraFieldData unparseableExtra = null;
-  86  727
     private String name = null;
-  87  727
     private byte[] rawName = null;
-  88  727
     private GeneralPurposeBit gpb = new GeneralPurposeBit();
+  81  1454
     private int internalAttributes = 0;
+  82  1454
     private int platform = PLATFORM_FAT;
+  83  1454
     private long externalAttributes = 0;
+  84  1454
     private LinkedHashMap<ZipShort, ZipExtraField> extraFields = null;
+  85  1454
     private UnparseableExtraFieldData unparseableExtra = null;
+  86  1454
     private String name = null;
+  87  1454
     private byte[] rawName = null;
+  88  1454
     private GeneralPurposeBit gpb = new GeneralPurposeBit();
 89  
 
 90   @@ -202,9 +202,9 @@
      */
 98  
     public ZipArchiveEntry(String name) {
-  99  672
         super(name);
-  100  672
         setName(name);
-  101  672
     }
+  99  1344
         super(name);
+  100  1344
         setName(name);
+  101  1344
     }
 102  
 
 103   @@ -227,11 +227,11 @@
      */
 112  
     public ZipArchiveEntry(java.util.zip.ZipEntry entry) throws ZipException {
-  113  55
         super(entry);
-  114  55
         setName(entry.getName());
-  115  55
         byte[] extra = entry.getExtra();
-  116  55
         if (extra != null) {
-  117  55
             setExtraFields(ExtraFieldUtils.parse(extra, true,
+  113  110
         super(entry);
+  114  110
         setName(entry.getName());
+  115  110
         byte[] extra = entry.getExtra();
+  116  110
         if (extra != null) {
+  117  110
             setExtraFields(ExtraFieldUtils.parse(extra, true,
 118  
                                                  ExtraFieldUtils
 119   @@ -243,9 +243,9 @@  122  0
             setExtra();
 123  
         }
-  124  55
         setMethod(entry.getMethod());
-  125  55
         this.size = entry.getSize();
-  126  55
     }
+  124  110
         setMethod(entry.getMethod());
+  125  110
         this.size = entry.getSize();
+  126  110
     }
 127  
 
 128   @@ -268,11 +268,11 @@
      */
 137  
     public ZipArchiveEntry(ZipArchiveEntry entry) throws ZipException {
-  138  55
         this((java.util.zip.ZipEntry) entry);
-  139  55
         setInternalAttributes(entry.getInternalAttributes());
-  140  55
         setExternalAttributes(entry.getExternalAttributes());
-  141  55
         setExtraFields(entry.getExtraFields(true));
-  142  55
     }
+  138  110
         this((java.util.zip.ZipEntry) entry);
+  139  110
         setInternalAttributes(entry.getInternalAttributes());
+  140  110
         setExternalAttributes(entry.getExternalAttributes());
+  141  110
         setExtraFields(entry.getExtraFields(true));
+  142  110
     }
 143  
 
 144   @@ -281,8 +281,8 @@
      */
 146  
     protected ZipArchiveEntry() {
-  147  546
         this("");
-  148  546
     }
+  147  1092
         this("");
+  148  1092
     }
 149  
 
 150   @@ -305,17 +305,17 @@
      */
 159  
     public ZipArchiveEntry(File inputFile, String entryName) {
-  160  56
         this(inputFile.isDirectory() && !entryName.endsWith("/") ? 
+  160  112
         this(inputFile.isDirectory() && !entryName.endsWith("/") ? 
 161  
              entryName + "/" : entryName);
-  162  56
         if (inputFile.isFile()){
-  163  55
             setSize(inputFile.length());
+  162  112
         if (inputFile.isFile()){
+  163  110
             setSize(inputFile.length());
 164  
         }
-  165  56
         setTime(inputFile.lastModified());
+  165  112
         setTime(inputFile.lastModified());
 166  
         // TODO are there any other fields we can set here?
-  167  56
     }
+  167  112
     }
 168  
 
 169   @@ -361,7 +361,7 @@
     @Override
 192  
     public int getMethod() {
-  193  4296
         return method;
+  193  8592
         return method;
 194  
     }
 195   @@ -384,14 +384,14 @@
     @Override
 204  
     public void setMethod(int method) {
-  205  714
         if (method < 0) {
+  205  1428
         if (method < 0) {
 206  0
             throw new IllegalArgumentException(
 207  
                     "ZIP compression method can not be negative: " + method);
 208  
         }
-  209  714
         this.method = method;
-  210  714
     }
+  209  1428
         this.method = method;
+  210  1428
     }
 211  
 
 212   @@ -406,7 +406,7 @@
      */
 217  
     public int getInternalAttributes() {
-  218  217
         return internalAttributes;
+  218  434
         return internalAttributes;
 219  
     }
 220   @@ -421,8 +421,8 @@
      */
 225  
     public void setInternalAttributes(int value) {
-  226  280
         internalAttributes = value;
-  227  280
     }
+  226  560
         internalAttributes = value;
+  227  560
     }
 228  
 
 229   @@ -435,7 +435,7 @@
      */
 233  
     public long getExternalAttributes() {
-  234  267
         return externalAttributes;
+  234  534
         return externalAttributes;
 235  
     }
 236   @@ -450,8 +450,8 @@
      */
 241  
     public void setExternalAttributes(long value) {
-  242  284
         externalAttributes = value;
-  243  284
     }
+  242  568
         externalAttributes = value;
+  243  568
     }
 244  
 
 245   @@ -468,7 +468,7 @@
     public void setUnixMode(int mode) {
 251  
         // CheckStyle:MagicNumberCheck OFF - no point
-  252  4
         setExternalAttributes((mode << SHORT_SHIFT)
+  252  8
         setExternalAttributes((mode << SHORT_SHIFT)
 253  
                               // MS-DOS read-only attribute
 254   @@ -479,8 +479,8 @@
                               | (isDirectory() ? 0x10 : 0));
 257  
         // CheckStyle:MagicNumberCheck ON
-  258  4
         platform = PLATFORM_UNIX;
-  259  4
     }
+  258  8
         platform = PLATFORM_UNIX;
+  259  8
     }
 260  
 
 261   @@ -493,7 +493,7 @@
      */
 265  
     public int getUnixMode() {
-  266  42
         return platform != PLATFORM_UNIX ? 0 :
+  266  84
         return platform != PLATFORM_UNIX ? 0 :
 267  
             (int) ((getExternalAttributes() >> SHORT_SHIFT) & SHORT_MASK);
 268   @@ -518,7 +518,7 @@
      */
 278  
     public boolean isUnixSymlink() {
-  279  42
         return (getUnixMode() & UnixStat.LINK_FLAG) == UnixStat.LINK_FLAG;
+  279  84
         return (getUnixMode() & UnixStat.LINK_FLAG) == UnixStat.LINK_FLAG;
 280  
     }
 281   @@ -539,7 +539,7 @@
      */
 289  
     public int getPlatform() {
-  290  1453
         return platform;
+  290  2906
         return platform;
 291  
     }
 292   @@ -554,8 +554,8 @@
      */
 297  
     protected void setPlatform(int platform) {
-  298  546
         this.platform = platform;
-  299  546
     }
+  298  1092
         this.platform = platform;
+  299  1092
     }
 300  
 
 301   @@ -568,19 +568,19 @@
      */
 305  
     public void setExtraFields(ZipExtraField[] fields) {
-  306  659
         extraFields = new LinkedHashMap<ZipShort, ZipExtraField>();
-  307  1203
         for (ZipExtraField field : fields) {
-  308  544
             if (field instanceof UnparseableExtraFieldData) {
+  306  1318
         extraFields = new LinkedHashMap<ZipShort, ZipExtraField>();
+  307  2406
         for (ZipExtraField field : fields) {
+  308  1088
             if (field instanceof UnparseableExtraFieldData) {
 309  0
                 unparseableExtra = (UnparseableExtraFieldData) field;
 310  
             } else {
-  311  544
                 extraFields.put(field.getHeaderId(), field);
+  311  1088
                 extraFields.put(field.getHeaderId(), field);
 312  
             }
 313  
         }
-  314  659
         setExtra();
-  315  659
     }
+  314  1318
         setExtra();
+  315  1318
     }
 316  
 
 317   @@ -593,7 +593,7 @@
      */
 321  
     public ZipExtraField[] getExtraFields() {
-  322  11
         return getExtraFields(false);
+  322  22
         return getExtraFields(false);
 323  
     }
 324   @@ -618,22 +618,22 @@
      */
 334  
     public ZipExtraField[] getExtraFields(boolean includeUnparseable) {
-  335  1313
         if (extraFields == null) {
-  336  74
             return !includeUnparseable || unparseableExtra == null
+  335  2626
         if (extraFields == null) {
+  336  148
             return !includeUnparseable || unparseableExtra == null
 337  
                 ? new ZipExtraField[0]
 338  
                 : new ZipExtraField[] { unparseableExtra };
 339  
         }
-  340  1239
         List<ZipExtraField> result =
+  340  2478
         List<ZipExtraField> result =
 341  
             new ArrayList<ZipExtraField>(extraFields.values());
-  342  1239
         if (includeUnparseable && unparseableExtra != null) {
+  342  2478
         if (includeUnparseable && unparseableExtra != null) {
 343  0
             result.add(unparseableExtra);
 344  
         }
-  345  1239
         return result.toArray(new ZipExtraField[0]);
+  345  2478
         return result.toArray(new ZipExtraField[0]);
 346  
     }
 347   @@ -656,19 +656,19 @@
      */
 356  
     public void addExtraField(ZipExtraField ze) {
-  357  53
         if (ze instanceof UnparseableExtraFieldData) {
+  357  106
         if (ze instanceof UnparseableExtraFieldData) {
 358  0
             unparseableExtra = (UnparseableExtraFieldData) ze;
 359  
         } else {
-  360  53
             if (extraFields == null) {
-  361  7
                 extraFields = new LinkedHashMap<ZipShort, ZipExtraField>();
+  360  106
             if (extraFields == null) {
+  361  14
                 extraFields = new LinkedHashMap<ZipShort, ZipExtraField>();
 362  
             }
-  363  53
             extraFields.put(ze.getHeaderId(), ze);
+  363  106
             extraFields.put(ze.getHeaderId(), ze);
 364  
         }
-  365  53
         setExtra();
-  366  53
     }
+  365  106
         setExtra();
+  366  106
     }
 367  
 
 368   @@ -687,22 +687,22 @@
      */
 375  
     public void addAsFirstExtraField(ZipExtraField ze) {
-  376  48
         if (ze instanceof UnparseableExtraFieldData) {
+  376  96
         if (ze instanceof UnparseableExtraFieldData) {
 377  0
             unparseableExtra = (UnparseableExtraFieldData) ze;
 378  
         } else {
-  379  48
             LinkedHashMap<ZipShort, ZipExtraField> copy = extraFields;
-  380  48
             extraFields = new LinkedHashMap<ZipShort, ZipExtraField>();
-  381  48
             extraFields.put(ze.getHeaderId(), ze);
-  382  48
             if (copy != null) {
-  383  12
                 copy.remove(ze.getHeaderId());
-  384  12
                 extraFields.putAll(copy);
+  379  96
             LinkedHashMap<ZipShort, ZipExtraField> copy = extraFields;
+  380  96
             extraFields = new LinkedHashMap<ZipShort, ZipExtraField>();
+  381  96
             extraFields.put(ze.getHeaderId(), ze);
+  382  96
             if (copy != null) {
+  383  24
                 copy.remove(ze.getHeaderId());
+  384  24
                 extraFields.putAll(copy);
 385  
             }
 386  
         }
-  387  48
         setExtra();
-  388  48
     }
+  387  96
         setExtra();
+  388  96
     }
 389  
 
 390   @@ -715,16 +715,16 @@
      */
 394  
     public void removeExtraField(ZipShort type) {
-  395  34
         if (extraFields == null) {
+  395  68
         if (extraFields == null) {
 396  0
             throw new java.util.NoSuchElementException();
 397  
         }
-  398  34
         if (extraFields.remove(type) == null) {
-  399  1
             throw new java.util.NoSuchElementException();
+  398  68
         if (extraFields.remove(type) == null) {
+  399  2
             throw new java.util.NoSuchElementException();
 400  
         }
-  401  33
         setExtra();
-  402  33
     }
+  401  66
         setExtra();
+  402  66
     }
 403  
 
 404   @@ -760,11 +760,11 @@
      */
 422  
     public ZipExtraField getExtraField(ZipShort type) {
-  423  1960
         if (extraFields != null) {
-  424  1660
             return extraFields.get(type);
+  423  3920
         if (extraFields != null) {
+  424  3320
             return extraFields.get(type);
 425  
         }
-  426  300
         return null;
+  426  600
         return null;
 427  
     }
 428   @@ -812,20 +812,20 @@
     public void setExtra(byte[] extra) throws RuntimeException {
 450  
         try {
-  451  547
             ZipExtraField[] local =
+  451  1094
             ZipExtraField[] local =
 452  
                 ExtraFieldUtils.parse(extra, true,
 453  
                                       ExtraFieldUtils.UnparseableExtraField.READ);
-  454  547
             mergeExtraFields(local, true);
+  454  1094
             mergeExtraFields(local, true);
 455  0
         } catch (ZipException e) {
 456  
             // actually this is not possible as of Commons Compress 1.1
 457  0
             throw new RuntimeException("Error parsing extra fields for entry: "
 458  
                                        + getName() + " - " + e.getMessage(), e);
-  459  547
         }
-  460  547
     }
+  459  1094
         }
+  460  1094
     }
 461  
 
 462   @@ -842,8 +842,8 @@
      */
 468  
     protected void setExtra() {
-  469  1085
         super.setExtra(ExtraFieldUtils.mergeLocalFileDataData(getExtraFields(true)));
-  470  1085
     }
+  469  2170
         super.setExtra(ExtraFieldUtils.mergeLocalFileDataData(getExtraFields(true)));
+  470  2170
     }
 471  
 
 472   @@ -856,16 +856,16 @@
     public void setCentralDirectoryExtra(byte[] b) {
 476  
         try {
-  477  227
             ZipExtraField[] central =
+  477  454
             ZipExtraField[] central =
 478  
                 ExtraFieldUtils.parse(b, false,
 479  
                                       ExtraFieldUtils.UnparseableExtraField.READ);
-  480  227
             mergeExtraFields(central, false);
+  480  454
             mergeExtraFields(central, false);
 481  0
         } catch (ZipException e) {
 482  0
             throw new RuntimeException(e.getMessage(), e);
-  483  227
         }
-  484  227
     }
+  483  454
         }
+  484  454
     }
 485  
 
 486   @@ -878,8 +878,8 @@
      */
 490  
     public byte[] getLocalFileDataExtra() {
-  491  164
         byte[] extra = getExtra();
-  492  164
         return extra != null ? extra : EMPTY;
+  491  328
         byte[] extra = getExtra();
+  492  328
         return extra != null ? extra : EMPTY;
 493  
     }
 494   @@ -894,7 +894,7 @@
      */
 499  
     public byte[] getCentralDirectoryExtra() {
-  500  162
         return ExtraFieldUtils.mergeCentralDirectoryData(getExtraFields(true));
+  500  324
         return ExtraFieldUtils.mergeCentralDirectoryData(getExtraFields(true));
 501  
     }
 502   @@ -911,7 +911,7 @@
     @Override
 508  
     public String getName() {
-  509  3750
         return name == null ? super.getName() : name;
+  509  7500
         return name == null ? super.getName() : name;
 510  
     }
 511   @@ -928,7 +928,7 @@
     @Override
 517  
     public boolean isDirectory() {
-  518  233
         return getName().endsWith("/");
+  518  466
         return getName().endsWith("/");
 519  
     }
 520   @@ -943,14 +943,14 @@
      */
 525  
     protected void setName(String name) {
-  526  1285
         if (name != null && getPlatform() == PLATFORM_FAT
+  526  2570
         if (name != null && getPlatform() == PLATFORM_FAT
 527  
             && name.indexOf("/") == -1) {
-  528  805
             name = name.replace('\\', '/');
+  528  1610
             name = name.replace('\\', '/');
 529  
         }
-  530  1285
         this.name = name;
-  531  1285
     }
+  530  2570
         this.name = name;
+  531  2570
     }
 532  
 
 533   @@ -965,7 +965,7 @@
     @Override
 538  
     public long getSize() {
-  539  1938
         return size;
+  539  3876
         return size;
 540  
     }
 541   @@ -986,12 +986,12 @@
     @Override
 549  
     public void setSize(long size) {
-  550  774
         if (size < 0) {
+  550  1548
         if (size < 0) {
 551  0
             throw new IllegalArgumentException("invalid entry size");
 552  
         }
-  553  774
         this.size = size;
-  554  774
     }
+  553  1548
         this.size = size;
+  554  1548
     }
 555  
 
 556   @@ -1014,9 +1014,9 @@
      */
 565  
     protected void setName(String name, byte[] rawName) {
-  566  546
         setName(name);
-  567  546
         this.rawName = rawName;
-  568  546
     }
+  566  1092
         setName(name);
+  567  1092
         this.rawName = rawName;
+  568  1092
     }
 569  
 
 570   @@ -1039,10 +1039,10 @@
      */
 579  
     public byte[] getRawName() {
-  580  4
         if (rawName != null) {
-  581  4
             byte[] b = new byte[rawName.length];
-  582  4
             System.arraycopy(rawName, 0, b, 0, rawName.length);
-  583  4
             return b;
+  580  8
         if (rawName != null) {
+  581  8
             byte[] b = new byte[rawName.length];
+  582  8
             System.arraycopy(rawName, 0, b, 0, rawName.length);
+  583  8
             return b;
 584  
         }
 585  0
         return null;
@@ -1072,7 +1072,7 @@
         // the empty string in the current implemention (there's no setter)
 598  
         // so it is basically draining the performance of a hashmap lookup
-  599  888
         return getName().hashCode();
+  599  1776
         return getName().hashCode();
 600  
     }
 601   @@ -1087,7 +1087,7 @@
      */
 606  
     public GeneralPurposeBit getGeneralPurposeBit() {
-  607  1300
         return gpb;
[... 140 lines stripped ...]