commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r741632 - in /commons/sandbox/compress/trunk/src: main/java/org/apache/commons/compress/archivers/jar/ main/java/org/apache/commons/compress/archivers/zip/ test/java/org/apache/commons/compress/archivers/ test/java/org/apache/commons/compre...
Date Fri, 06 Feb 2009 17:02:22 GMT
Author: bodewig
Date: Fri Feb  6 17:02:21 2009
New Revision: 741632

URL: http://svn.apache.org/viewvc?rev=741632&view=rev
Log:
merge ZipEntry and ZipArchiveEntry into a single class

Removed:
    commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntry.java
Modified:
    commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveEntry.java
    commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveInputStream.java
    commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveOutputStream.java
    commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java
    commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java
    commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipEntry.java
    commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/archivers/JarTestCase.java
    commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/archivers/ZipTestCase.java
    commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/changes/ChangeSetTestCase.java

Modified: commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveEntry.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveEntry.java?rev=741632&r1=741631&r2=741632&view=diff
==============================================================================
--- commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveEntry.java
(original)
+++ commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveEntry.java
Fri Feb  6 17:02:21 2009
@@ -21,18 +21,17 @@
 import java.security.cert.Certificate;
 import java.util.jar.Attributes;
 import java.util.jar.JarEntry;
-import java.util.zip.ZipEntry;
 import java.util.zip.ZipException;
 
 import org.apache.commons.compress.archivers.ArchiveEntry;
-import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
+import org.apache.commons.compress.archivers.zip.ZipEntry;
 
-public class JarArchiveEntry extends ZipArchiveEntry implements ArchiveEntry {
+public class JarArchiveEntry extends ZipEntry implements ArchiveEntry {
 
 	private Attributes manifestAttributes = null;
 	private Certificate[] certificates = null; 
 	
-	public JarArchiveEntry(ZipEntry entry) throws ZipException {
+	public JarArchiveEntry(java.util.zip.ZipEntry entry) throws ZipException {
 		super(entry);
 	}
 
@@ -40,7 +39,7 @@
 		super(name);
 	}
 
-	public JarArchiveEntry(ZipArchiveEntry entry) throws ZipException {
+	public JarArchiveEntry(ZipEntry entry) throws ZipException {
 		super(entry);
 	}
 

Modified: commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveInputStream.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveInputStream.java?rev=741632&r1=741631&r2=741632&view=diff
==============================================================================
--- commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveInputStream.java
(original)
+++ commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveInputStream.java
Fri Feb  6 17:02:21 2009
@@ -22,7 +22,7 @@
 import java.io.InputStream;
 
 import org.apache.commons.compress.archivers.ArchiveEntry;
-import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
+import org.apache.commons.compress.archivers.zip.ZipEntry;
 import org.apache.commons.compress.archivers.zip.ZipArchiveInputStream;
 
 public class JarArchiveInputStream extends ZipArchiveInputStream {
@@ -32,7 +32,7 @@
     }
         
     public ArchiveEntry getNextEntry() throws IOException {
-        ZipArchiveEntry entry = (ZipArchiveEntry)super.getNextEntry();
+        ZipEntry entry = (ZipEntry)super.getNextEntry();
         if(entry == null) {
             return null;
         } else {

Modified: commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveOutputStream.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveOutputStream.java?rev=741632&r1=741631&r2=741632&view=diff
==============================================================================
--- commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveOutputStream.java
(original)
+++ commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/jar/JarArchiveOutputStream.java
Fri Feb  6 17:02:21 2009
@@ -22,7 +22,7 @@
 import java.io.OutputStream;
 
 import org.apache.commons.compress.archivers.ArchiveEntry;
-import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
+import org.apache.commons.compress.archivers.zip.ZipEntry;
 import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream;
 
 public class JarArchiveOutputStream extends ZipArchiveOutputStream {
@@ -33,6 +33,6 @@
 
 	public void putArchiveEntry(ArchiveEntry entry) throws IOException {
 		// TODO special jar stuff
-		super.putArchiveEntry((ZipArchiveEntry) entry);
+		super.putArchiveEntry((ZipEntry) entry);
 	}
 }

Modified: commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java?rev=741632&r1=741631&r2=741632&view=diff
==============================================================================
--- commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java
(original)
+++ commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java
Fri Feb  6 17:02:21 2009
@@ -38,7 +38,7 @@
         if(entry == null) {
             return null;
         }
-        return (ArchiveEntry)new ZipArchiveEntry(entry);
+        return (ArchiveEntry)new ZipEntry(entry);
     }
 
     public int read(byte[] b, int off, int len) throws IOException {

Modified: commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java?rev=741632&r1=741631&r2=741632&view=diff
==============================================================================
--- commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java
(original)
+++ commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java
Fri Feb  6 17:02:21 2009
@@ -34,7 +34,7 @@
     }
     
     public void putArchiveEntry(ArchiveEntry entry) throws IOException {
-        zipOut.putNextEntry((ZipArchiveEntry) entry);
+        zipOut.putNextEntry((ZipEntry) entry);
     }
 
     public void close() throws IOException {

Modified: commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipEntry.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipEntry.java?rev=741632&r1=741631&r2=741632&view=diff
==============================================================================
--- commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipEntry.java
(original)
+++ commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipEntry.java
Fri Feb  6 17:02:21 2009
@@ -19,13 +19,15 @@
 
 import java.util.LinkedHashMap;
 import java.util.zip.ZipException;
+import org.apache.commons.compress.archivers.ArchiveEntry;
 
 /**
  * Extension that adds better handling of extra fields and provides
  * access to the internal and external file attributes.
  *
  */
-public class ZipEntry extends java.util.zip.ZipEntry implements Cloneable {
+public class ZipEntry extends java.util.zip.ZipEntry
+    implements ArchiveEntry, Cloneable {
 
     public static final int PLATFORM_UNIX = 3;
     public static final int PLATFORM_FAT  = 0;

Modified: commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/archivers/JarTestCase.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/archivers/JarTestCase.java?rev=741632&r1=741631&r2=741632&view=diff
==============================================================================
--- commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/archivers/JarTestCase.java
(original)
+++ commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/archivers/JarTestCase.java
Fri Feb  6 17:02:21 2009
@@ -24,7 +24,7 @@
 import java.io.InputStream;
 import java.io.OutputStream;
 
-import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
+import org.apache.commons.compress.archivers.zip.ZipEntry;
 import org.apache.commons.compress.utils.IOUtils;
 
 import org.apache.commons.compress.AbstractTestCase;
@@ -40,11 +40,11 @@
         
         final ArchiveOutputStream os = new ArchiveStreamFactory().createArchiveOutputStream("jar",
out);
 
-        os.putArchiveEntry(new ZipArchiveEntry("testdata/test1.xml"));
+        os.putArchiveEntry(new ZipEntry("testdata/test1.xml"));
         IOUtils.copy(new FileInputStream(file1), os);
         os.closeArchiveEntry();
         
-        os.putArchiveEntry(new ZipArchiveEntry("testdata/test2.xml"));
+        os.putArchiveEntry(new ZipEntry("testdata/test2.xml"));
         IOUtils.copy(new FileInputStream(file2), os);
         os.closeArchiveEntry();
 
@@ -57,21 +57,21 @@
         final InputStream is = new FileInputStream(input);
         final ArchiveInputStream in = new ArchiveStreamFactory().createArchiveInputStream("jar",
is);
         
-        ZipArchiveEntry entry = (ZipArchiveEntry)in.getNextEntry();
+        ZipEntry entry = (ZipEntry)in.getNextEntry();
         File o = new File(dir, entry.getName());
         o.getParentFile().mkdirs();
         OutputStream out = new FileOutputStream(o);
         IOUtils.copy(in, out);
         out.close();
         
-        entry = (ZipArchiveEntry)in.getNextEntry();
+        entry = (ZipEntry)in.getNextEntry();
         o = new File(dir, entry.getName());
         o.getParentFile().mkdirs();
         out = new FileOutputStream(o);
         IOUtils.copy(in, out);
         out.close();
         
-        entry = (ZipArchiveEntry)in.getNextEntry();
+        entry = (ZipEntry)in.getNextEntry();
         o = new File(dir, entry.getName());
         o.getParentFile().mkdirs();
         out = new FileOutputStream(o);

Modified: commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/archivers/ZipTestCase.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/archivers/ZipTestCase.java?rev=741632&r1=741631&r2=741632&view=diff
==============================================================================
--- commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/archivers/ZipTestCase.java
(original)
+++ commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/archivers/ZipTestCase.java
Fri Feb  6 17:02:21 2009
@@ -24,7 +24,7 @@
 import java.io.InputStream;
 import java.io.OutputStream;
 
-import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
+import org.apache.commons.compress.archivers.zip.ZipEntry;
 import org.apache.commons.compress.utils.IOUtils;
 
 import org.apache.commons.compress.AbstractTestCase;
@@ -41,11 +41,11 @@
         
         final ArchiveOutputStream os = new ArchiveStreamFactory().createArchiveOutputStream("zip",
out);
 
-        os.putArchiveEntry(new ZipArchiveEntry("testdata/test1.xml"));
+        os.putArchiveEntry(new ZipEntry("testdata/test1.xml"));
         IOUtils.copy(new FileInputStream(file1), os);
         os.closeArchiveEntry();
         
-        os.putArchiveEntry(new ZipArchiveEntry("testdata/test2.xml"));
+        os.putArchiveEntry(new ZipEntry("testdata/test2.xml"));
         IOUtils.copy(new FileInputStream(file2), os);
         os.closeArchiveEntry();
         
@@ -58,7 +58,7 @@
         final InputStream is = new FileInputStream(input);
         final ArchiveInputStream in = new ArchiveStreamFactory().createArchiveInputStream("zip",
is);
  
-        final ZipArchiveEntry entry = (ZipArchiveEntry)in.getNextEntry();
+        final ZipEntry entry = (ZipEntry)in.getNextEntry();
         final OutputStream out = new FileOutputStream(new File(dir, entry.getName()));
         
         IOUtils.copy(in, out);

Modified: commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/changes/ChangeSetTestCase.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/changes/ChangeSetTestCase.java?rev=741632&r1=741631&r2=741632&view=diff
==============================================================================
--- commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/changes/ChangeSetTestCase.java
(original)
+++ commons/sandbox/compress/trunk/src/test/java/org/apache/commons/compress/changes/ChangeSetTestCase.java
Fri Feb  6 17:02:21 2009
@@ -30,7 +30,7 @@
 import org.apache.commons.compress.archivers.ar.ArArchiveEntry;
 import org.apache.commons.compress.archivers.jar.JarArchiveEntry;
 import org.apache.commons.compress.archivers.tar.TarArchiveEntry;
-import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
+import org.apache.commons.compress.archivers.zip.ZipEntry;
 
 public final class ChangeSetTestCase extends AbstractTestCase {
 
@@ -132,7 +132,7 @@
 			
 			
 			final File file1 = getFile("test.txt");
-			ZipArchiveEntry entry = new ZipArchiveEntry("testdata/test.txt");
+			ZipEntry entry = new ZipEntry("testdata/test.txt");
 	        changes.add(entry, new FileInputStream(file1));
 			
 			final File input = getFile("bla.zip");



Mime
View raw message