commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r915826 - in /commons/proper/compress/trunk/src: changes/ main/java/org/apache/commons/compress/archivers/ main/java/org/apache/commons/compress/archivers/zip/ test/java/org/apache/commons/compress/archivers/ test/java/org/apache/commons/co...
Date Wed, 24 Feb 2010 15:35:48 GMT
Author: bodewig
Date: Wed Feb 24 15:35:47 2010
New Revision: 915826

URL: http://svn.apache.org/viewvc?rev=915826&view=rev
Log:
canRead => canReadEntryData as discussed on the list

Modified:
    commons/proper/compress/trunk/src/changes/changes.xml
    commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ArchiveInputStream.java
    commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ArchiveOutputStream.java
    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/ZipArchiveOutputStream.java
    commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java
    commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/ZipTestCase.java
    commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/EncryptedArchiveTest.java
    commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntryTest.java

Modified: commons/proper/compress/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/changes/changes.xml?rev=915826&r1=915825&r2=915826&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/changes/changes.xml (original)
+++ commons/proper/compress/trunk/src/changes/changes.xml Wed Feb 24 15:35:47 2010
@@ -24,9 +24,9 @@
   <body>
     <release version="1.1" date="as in SVN" description="Release 1.1">
       <action type="add" date="2010-02-19">
-        The Archive*Stream and ZipFile classes now have canRead/Write
-        methods that can be used to check whether a given entry can be
-        read/written.
+        The Archive*Stream and ZipFile classes now have
+        can(Read|Write)EntryData methods that can be used to check
+        whether a given entry's data can be read/written.
         The method currently returns false for ZIP archives if an
         entry uses an unsupported compression method or encryption.
       </action>

Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ArchiveInputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ArchiveInputStream.java?rev=915826&r1=915825&r2=915826&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ArchiveInputStream.java
(original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ArchiveInputStream.java
Wed Feb 24 15:35:47 2010
@@ -143,7 +143,7 @@
      *
      * @since Apache Commons Compress 1.1
      */
-    public boolean canRead(ArchiveEntry ae) {
+    public boolean canReadEntryData(ArchiveEntry ae) {
         return true;
     }
 

Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ArchiveOutputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ArchiveOutputStream.java?rev=915826&r1=915825&r2=915826&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ArchiveOutputStream.java
(original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ArchiveOutputStream.java
Wed Feb 24 15:35:47 2010
@@ -163,7 +163,7 @@
      * <p>This implementation always returns true.
      * @since Apache Commons Compress 1.1
      */
-    public boolean canWrite(ArchiveEntry ae) {
+    public boolean canWriteEntryData(ArchiveEntry ae) {
         return true;
     }
 }

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=915826&r1=915825&r2=915826&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
Wed Feb 24 15:35:47 2010
@@ -196,7 +196,7 @@
      * compression method that hasn't been implemented yet.</p>
      * @since Apache Commons Compress 1.1
      */
-    public boolean canRead(ArchiveEntry ae) {
+    public boolean canReadEntryData(ArchiveEntry ae) {
         if (ae instanceof ZipArchiveEntry) {
             ZipArchiveEntry ze = (ZipArchiveEntry) ae;
             return !ze.isEncrypted() &&

Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java?rev=915826&r1=915825&r2=915826&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java
(original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java
Wed Feb 24 15:35:47 2010
@@ -511,7 +511,7 @@
      * compression method that hasn't been implemented yet.</p>
      * @since Apache Commons Compress 1.1
      */
-    public boolean canWrite(ArchiveEntry ae) {
+    public boolean canWriteEntryData(ArchiveEntry ae) {
         if (ae instanceof ZipArchiveEntry) {
             ZipArchiveEntry ze = (ZipArchiveEntry) ae;
             return !ze.isEncrypted() &&

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=915826&r1=915825&r2=915826&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
Wed Feb 24 15:35:47 2010
@@ -250,7 +250,7 @@
      * compression method that hasn't been implemented yet.</p>
      * @since Apache Commons Compress 1.1
      */
-    public boolean canRead(ZipArchiveEntry ze) {
+    public boolean canReadEntryData(ZipArchiveEntry ze) {
         return !ze.isEncrypted() &&
             (ze.getMethod() == ZipArchiveEntry.STORED
              || ze.getMethod() == ZipArchiveEntry.DEFLATED);

Modified: commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/ZipTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/ZipTestCase.java?rev=915826&r1=915825&r2=915826&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/ZipTestCase.java
(original)
+++ commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/ZipTestCase.java
Wed Feb 24 15:35:47 2010
@@ -122,11 +122,11 @@
      */
     public void testSupportedCompressionMethod() throws IOException {
         ZipFile bla = new ZipFile(getFile("bla.zip"));
-        assertTrue(bla.canRead(bla.getEntry("test1.xml")));
+        assertTrue(bla.canReadEntryData(bla.getEntry("test1.xml")));
         bla.close();
 
         ZipFile moby = new ZipFile(getFile("moby.zip"));
-        assertFalse(moby.canRead(moby.getEntry("README")));
+        assertFalse(moby.canReadEntryData(moby.getEntry("README")));
         moby.close();
     }
 
@@ -145,7 +145,7 @@
         try {
             ZipArchiveEntry entry = zip.getNextZipEntry();
             assertEquals("README", entry.getName());
-            assertFalse(zip.canRead(entry));
+            assertFalse(zip.canReadEntryData(entry));
             try {
                 assertNull(zip.getNextZipEntry());
             } catch (IOException e) {

Modified: commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/EncryptedArchiveTest.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/EncryptedArchiveTest.java?rev=915826&r1=915825&r2=915826&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/EncryptedArchiveTest.java
(original)
+++ commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/zip/EncryptedArchiveTest.java
Wed Feb 24 15:35:47 2010
@@ -38,7 +38,7 @@
             ZipArchiveEntry zae = zf.getEntry("LICENSE.txt");
             assertTrue(zae.isEncrypted());
             assertFalse(zae.isStronglyEncrypted());
-            assertFalse(zf.canRead(zae));
+            assertFalse(zf.canReadEntryData(zae));
             try {
                 zf.getInputStream(zae);
                 fail("expected an exception");
@@ -61,7 +61,7 @@
             assertEquals("LICENSE.txt", zae.getName());
             assertTrue(zae.isEncrypted());
             assertFalse(zae.isStronglyEncrypted());
-            assertFalse(zin.canRead(zae));
+            assertFalse(zin.canReadEntryData(zae));
             try {
                 byte[] buf = new byte[1024];
                 zin.read(buf, 0, buf.length);

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=915826&r1=915825&r2=915826&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
Wed Feb 24 15:35:47 2010
@@ -205,20 +205,20 @@
             new ZipArchiveOutputStream((java.io.OutputStream) null);
         ZipArchiveEntry entry = new ZipArchiveEntry("foo");
         assertEquals(-1, entry.getMethod());
-        assertFalse(zos.canWrite(entry));
+        assertFalse(zos.canWriteEntryData(entry));
 
         entry.setMethod(ZipArchiveEntry.STORED);
         assertEquals(ZipArchiveEntry.STORED, entry.getMethod());
-        assertTrue(zos.canWrite(entry));
+        assertTrue(zos.canWriteEntryData(entry));
 
         entry.setMethod(ZipArchiveEntry.DEFLATED);
         assertEquals(ZipArchiveEntry.DEFLATED, entry.getMethod());
-        assertTrue(zos.canWrite(entry));
+        assertTrue(zos.canWriteEntryData(entry));
 
         // Test the unsupported "imploded" compression method (6)
         entry.setMethod(6);
         assertEquals(6, entry.getMethod());
-        assertFalse(zos.canWrite(entry));
+        assertFalse(zos.canWriteEntryData(entry));
     }
 
     /**



Mime
View raw message