commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1308105 - in /commons/proper/compress/trunk/src: main/java/org/apache/commons/compress/archivers/zip/ test/java/org/apache/commons/compress/archivers/cpio/ test/java/org/apache/commons/compress/archivers/zip/
Date Sun, 01 Apr 2012 13:26:55 GMT
Author: ggregory
Date: Sun Apr  1 13:26:55 2012
New Revision: 1308105

URL: http://svn.apache.org/viewvc?rev=1308105&view=rev
Log:
Change access using declaring type.

Modified:
    commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java
    commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java
    commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipUtil.java
    commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/cpio/CpioArchiveOutputStreamTest.java
    commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/Zip64SupportIT.java
    commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntryTest.java
    commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/ZipFileTest.java

Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java?rev=1308105&r1=1308104&r2=1308105&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java
(original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java
Sun Apr  1 13:26:55 2012
@@ -27,6 +27,7 @@ import java.io.PushbackInputStream;
 import java.util.zip.CRC32;
 import java.util.zip.DataFormatException;
 import java.util.zip.Inflater;
+import java.util.zip.ZipEntry;
 import java.util.zip.ZipException;
 
 import org.apache.commons.compress.archivers.ArchiveEntry;
@@ -635,7 +636,7 @@ public class ZipArchiveInputStream exten
     private boolean supportsDataDescriptorFor(ZipArchiveEntry entry) {
         return allowStoredEntriesWithDataDescriptor ||
             !entry.getGeneralPurposeBit().usesDataDescriptor()
-            || entry.getMethod() == ZipArchiveEntry.DEFLATED;
+            || entry.getMethod() == ZipEntry.DEFLATED;
     }
 
     /**

Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java?rev=1308105&r1=1308104&r2=1308105&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java
(original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java
Sun Apr  1 13:26:55 2012
@@ -31,6 +31,7 @@ import java.util.LinkedHashMap;
 import java.util.Map;
 import java.util.zip.Inflater;
 import java.util.zip.InflaterInputStream;
+import java.util.zip.ZipEntry;
 import java.util.zip.ZipException;
 
 import static org.apache.commons.compress.archivers.zip.ZipConstants.DWORD;
@@ -325,9 +326,9 @@ public class ZipFile {
         BoundedInputStream bis =
             new BoundedInputStream(start, ze.getCompressedSize());
         switch (ze.getMethod()) {
-            case ZipArchiveEntry.STORED:
+            case ZipEntry.STORED:
                 return bis;
-            case ZipArchiveEntry.DEFLATED:
+            case ZipEntry.DEFLATED:
                 bis.addDummy();
                 final Inflater inflater = new Inflater(true);
                 return new InflaterInputStream(bis, inflater) {

Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipUtil.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipUtil.java?rev=1308105&r1=1308104&r2=1308105&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipUtil.java
(original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipUtil.java
Sun Apr  1 13:26:55 2012
@@ -21,6 +21,7 @@ import java.io.IOException;
 import java.util.Calendar;
 import java.util.Date;
 import java.util.zip.CRC32;
+import java.util.zip.ZipEntry;
 
 /**
  * Utility class for handling DOS and Java time conversions.
@@ -208,8 +209,8 @@ public abstract class ZipUtil {
      * @return true if the compression method is STORED or DEFLATED
      */
     private static boolean supportsMethodOf(ZipArchiveEntry entry) {
-        return entry.getMethod() == ZipArchiveEntry.STORED
-            || entry.getMethod() == ZipArchiveEntry.DEFLATED;
+        return entry.getMethod() == ZipEntry.STORED
+            || entry.getMethod() == ZipEntry.DEFLATED;
     }
 
     /**

Modified: commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/cpio/CpioArchiveOutputStreamTest.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/cpio/CpioArchiveOutputStreamTest.java?rev=1308105&r1=1308104&r2=1308105&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/cpio/CpioArchiveOutputStreamTest.java
(original)
+++ commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/cpio/CpioArchiveOutputStreamTest.java
Sun Apr  1 13:26:55 2012
@@ -35,9 +35,9 @@ public class CpioArchiveOutputStreamTest
         InputStream in = null;
         try {
             final CpioArchiveOutputStream os =
-                new CpioArchiveOutputStream(out, CpioArchiveOutputStream
+                new CpioArchiveOutputStream(out, CpioConstants
                                             .FORMAT_OLD_BINARY);
-            os.putArchiveEntry(new CpioArchiveEntry(CpioArchiveOutputStream
+            os.putArchiveEntry(new CpioArchiveEntry(CpioConstants
                                                     .FORMAT_OLD_BINARY,
                                                     f, "test1.xml"));
             IOUtils.copy(in = new FileInputStream(f), os);

Modified: commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/Zip64SupportIT.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/Zip64SupportIT.java?rev=1308105&r1=1308104&r2=1308105&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/Zip64SupportIT.java
(original)
+++ commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/Zip64SupportIT.java
Sun Apr  1 13:26:55 2012
@@ -39,6 +39,7 @@ import java.net.URI;
 import java.net.URL;
 import java.util.Enumeration;
 import java.util.Random;
+import java.util.zip.ZipEntry;
 
 import org.apache.commons.compress.AbstractTestCase;
 import org.junit.Test;
@@ -543,7 +544,7 @@ public class Zip64SupportIT {
                     zae.setSize(FIVE_BILLION);
                     zae.setCrc(0x5c316f50L);
                 }
-                zae.setMethod(ZipArchiveEntry.STORED);
+                zae.setMethod(ZipEntry.STORED);
                 zos.putArchiveEntry(zae);
                 for (int j = 0; j < FIVE_BILLION / 1000 / 1000; j++) {
                     zos.write(buf);
@@ -723,7 +724,7 @@ public class Zip64SupportIT {
                         zae.setSize(FIVE_BILLION);
                         zae.setCrc(0x5c316f50L);
                     }
-                    zae.setMethod(ZipArchiveEntry.STORED);
+                    zae.setMethod(ZipEntry.STORED);
                     zos.putArchiveEntry(zae);
                     for (int j = 0; j < FIVE_BILLION / 1000 / 1000; j++) {
                         zos.write(buf);
@@ -781,7 +782,7 @@ public class Zip64SupportIT {
                 if (knownSize) {
                     zae.setSize(FIVE_BILLION);
                 }
-                zae.setMethod(ZipArchiveEntry.DEFLATED);
+                zae.setMethod(ZipEntry.DEFLATED);
                 zos.putArchiveEntry(zae);
                 for (int j = 0; j < FIVE_BILLION / 1000 / 1000; j++) {
                     zos.write(buf);
@@ -964,7 +965,7 @@ public class Zip64SupportIT {
                     }
                     byte[] buf = new byte[ONE_MILLION];
                     ZipArchiveEntry zae = new ZipArchiveEntry("0");
-                    zae.setMethod(ZipArchiveEntry.DEFLATED);
+                    zae.setMethod(ZipEntry.DEFLATED);
                     zos.putArchiveEntry(zae);
                     for (int j = 0; j < FIVE_BILLION / 1000 / 1000; j++) {
                         zos.write(buf);
@@ -1022,7 +1023,7 @@ public class Zip64SupportIT {
                 if (knownSize) {
                     zae.setSize(FIVE_BILLION);
                 }
-                zae.setMethod(ZipArchiveEntry.DEFLATED);
+                zae.setMethod(ZipEntry.DEFLATED);
                 zos.putArchiveEntry(zae);
                 for (int j = 0;
                      j < FIVE_BILLION / 1000 / 1000;
@@ -1191,7 +1192,7 @@ public class Zip64SupportIT {
                                          ZipArchiveEntry zae =
                                              new ZipArchiveEntry("0");
                                          zae.setSize(FIVE_BILLION);
-                                         zae.setMethod(ZipArchiveEntry.DEFLATED);
+                                         zae.setMethod(ZipEntry.DEFLATED);
                                          zos.putArchiveEntry(zae);
                                          fail("expected a"
                                               + " Zip64RequiredException");
@@ -1225,7 +1226,7 @@ public class Zip64SupportIT {
                     if (knownSize) {
                         zae.setSize(FIVE_BILLION);
                     }
-                    zae.setMethod(ZipArchiveEntry.DEFLATED);
+                    zae.setMethod(ZipEntry.DEFLATED);
                     zos.putArchiveEntry(zae);
                     for (int j = 0;
                          j < FIVE_BILLION / 1000 / 1000;
@@ -1282,7 +1283,7 @@ public class Zip64SupportIT {
                     zae.setSize(ONE_MILLION);
                     zae.setCrc(0x1279CB9EL);
                 }
-                zae.setMethod(ZipArchiveEntry.STORED);
+                zae.setMethod(ZipEntry.STORED);
                 zos.putArchiveEntry(zae);
                 zos.write(buf);
                 zos.closeArchiveEntry();
@@ -1458,7 +1459,7 @@ public class Zip64SupportIT {
                     zae.setSize(ONE_MILLION);
                     zae.setCrc(0x1279CB9EL);
                 }
-                zae.setMethod(ZipArchiveEntry.STORED);
+                zae.setMethod(ZipEntry.STORED);
                 zos.putArchiveEntry(zae);
                 zos.write(buf);
                 zos.closeArchiveEntry();
@@ -1621,7 +1622,7 @@ public class Zip64SupportIT {
                 if (knownSize) {
                     zae.setSize(ONE_MILLION);
                 }
-                zae.setMethod(ZipArchiveEntry.DEFLATED);
+                zae.setMethod(ZipEntry.DEFLATED);
                 zos.putArchiveEntry(zae);
                 zos.write(buf);
                 zos.closeArchiveEntry();
@@ -1791,7 +1792,7 @@ public class Zip64SupportIT {
                 if (knownSize) {
                     zae.setSize(ONE_MILLION);
                 }
-                zae.setMethod(ZipArchiveEntry.DEFLATED);
+                zae.setMethod(ZipEntry.DEFLATED);
                 zos.putArchiveEntry(zae);
                 zos.write(buf);
                 zos.closeArchiveEntry();
@@ -1975,7 +1976,7 @@ public class Zip64SupportIT {
                 if (knownSize) {
                     zae.setSize(ONE_MILLION);
                 }
-                zae.setMethod(ZipArchiveEntry.DEFLATED);
+                zae.setMethod(ZipEntry.DEFLATED);
                 zos.putArchiveEntry(zae);
                 zos.write(buf);
                 zos.closeArchiveEntry();
@@ -2147,7 +2148,7 @@ public class Zip64SupportIT {
                 if (knownSize) {
                     zae.setSize(ONE_MILLION);
                 }
-                zae.setMethod(ZipArchiveEntry.DEFLATED);
+                zae.setMethod(ZipEntry.DEFLATED);
                 zos.putArchiveEntry(zae);
                 zos.write(buf);
                 zos.closeArchiveEntry();
@@ -2541,7 +2542,7 @@ public class Zip64SupportIT {
         for (int i = 0; i < 2; i++) {
             zae = new ZipArchiveEntry(String.valueOf(i));
             zae.setSize(FIVE_BILLION / 2);
-            zae.setMethod(ZipArchiveEntry.STORED);
+            zae.setMethod(ZipEntry.STORED);
             zae.setCrc(0x8a408f16L);
             zos.putArchiveEntry(zae);
             for (int j = 0; j < FIVE_BILLION / 2 / 1000 / 1000;
@@ -2552,7 +2553,7 @@ public class Zip64SupportIT {
         }
         zae = new ZipArchiveEntry(String.valueOf(2));
         zae.setSize(1);
-        zae.setMethod(ZipArchiveEntry.STORED);
+        zae.setMethod(ZipEntry.STORED);
         zae.setCrc(0x9b9265bL);
         zos.putArchiveEntry(zae);
         zos.write(new byte[] { 42 });

Modified: commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntryTest.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntryTest.java?rev=1308105&r1=1308104&r2=1308105&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntryTest.java
(original)
+++ commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntryTest.java
Sun Apr  1 13:26:55 2012
@@ -18,6 +18,8 @@
 
 package org.apache.commons.compress.archivers.zip;
 
+import java.util.zip.ZipEntry;
+
 import junit.framework.TestCase;
 
 /**
@@ -209,12 +211,12 @@ public class ZipArchiveEntryTest extends
         assertEquals(-1, entry.getMethod());
         assertFalse(zos.canWriteEntryData(entry));
 
-        entry.setMethod(ZipArchiveEntry.STORED);
-        assertEquals(ZipArchiveEntry.STORED, entry.getMethod());
+        entry.setMethod(ZipEntry.STORED);
+        assertEquals(ZipEntry.STORED, entry.getMethod());
         assertTrue(zos.canWriteEntryData(entry));
 
-        entry.setMethod(ZipArchiveEntry.DEFLATED);
-        assertEquals(ZipArchiveEntry.DEFLATED, entry.getMethod());
+        entry.setMethod(ZipEntry.DEFLATED);
+        assertEquals(ZipEntry.DEFLATED, entry.getMethod());
         assertTrue(zos.canWriteEntryData(entry));
 
         // Test the unsupported "imploded" compression method (6)

Modified: commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/ZipFileTest.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/ZipFileTest.java?rev=1308105&r1=1308104&r2=1308105&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/ZipFileTest.java
(original)
+++ commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/ZipFileTest.java
Sun Apr  1 13:26:55 2012
@@ -26,6 +26,7 @@ import java.net.URI;
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.Collections;
+import java.util.zip.ZipEntry;
 
 import junit.framework.TestCase;
 
@@ -112,7 +113,7 @@ public class ZipFileTest extends TestCas
             o = new FileOutputStream(f);
             ZipArchiveOutputStream zo = new ZipArchiveOutputStream(o);
             ZipArchiveEntry ze = new ZipArchiveEntry("foo");
-            ze.setMethod(ZipArchiveEntry.STORED);
+            ze.setMethod(ZipEntry.STORED);
             ze.setSize(4);
             ze.setCrc(0xb63cfbcdl);
             zo.putArchiveEntry(ze);



Mime
View raw message