commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From grobme...@apache.org
Subject svn commit: r767371 - in /commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers: ArchiveOutputStream.java ar/ArArchiveOutputStream.java
Date Wed, 22 Apr 2009 05:19:58 GMT
Author: grobmeier
Date: Wed Apr 22 05:19:58 2009
New Revision: 767371

URL: http://svn.apache.org/viewvc?rev=767371&view=rev
Log:
COMPRESS-64: added finish() as abstract method and implemented it empty for Ar-Archiver. Added
Javadocs

Modified:
    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/ar/ArArchiveOutputStream.java

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=767371&r1=767370&r2=767371&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 Apr 22 05:19:58 2009
@@ -27,9 +27,24 @@
  * {@link #write(byte[], int, int)} method to improve performance.
  * They should also override {@link #close()} to ensure that any necessary
  * trailers are added.
+ * 
+ * <p>
+ * The normal sequence of calls for working with ArchiveOutputStreams is:
+ * + create ArchiveOutputStream object
+ * + write SFX header (optional, Zip only)
+ * + repeat as needed:
+ *      - putArchiveEntry() (writes entry header)
+ *      - write() (writes entry data)
+ *      - closeArchiveEntry() (closes entry)
+ * + finish() (ends the addition of entries)
+ * + write additional data if format supports it (optional)
+ * + close()
+ * </p>
+ * 
  * <p>
  * Example usage:<br/>
  * TBA
+ * </p>
  */
 public abstract class ArchiveOutputStream extends OutputStream {
     
@@ -55,6 +70,13 @@
      * @throws IOException
      */
     public abstract void closeArchiveEntry() throws IOException;
+    
+    /**
+     * Finishes the addition of entries to this stream, without closing it.
+     * Additional data can be written, if the format supports it.
+     * @throws IOException
+     */
+    public abstract void finish() throws IOException;
 
     /**
      * Create an archive entry using the inputFile and entryName provided.

Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveOutputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveOutputStream.java?rev=767371&r1=767370&r2=767371&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveOutputStream.java
(original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/ar/ArArchiveOutputStream.java
Wed Apr 22 05:19:58 2009
@@ -163,4 +163,10 @@
         return new ArArchiveEntry(inputFile, entryName);
     }
 
+    /* (non-Javadoc)
+     * @see org.apache.commons.compress.archivers.ArchiveOutputStream#finish()
+     */
+    public void finish() throws IOException {
+        // Nothing to do
+    }
 }



Mime
View raw message