commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r758860 - /commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveOutputStream.java
Date Thu, 26 Mar 2009 21:23:55 GMT
Author: sebb
Date: Thu Mar 26 21:23:53 2009
New Revision: 758860

URL: http://svn.apache.org/viewvc?rev=758860&view=rev
Log:
Oops, forgot to change check for initial value when the default changed
Add some Javadoc

Modified:
    commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveOutputStream.java

Modified: commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveOutputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveOutputStream.java?rev=758860&r1=758859&r2=758860&view=diff
==============================================================================
--- commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveOutputStream.java
(original)
+++ commons/proper/compress/trunk/src/main/java/org/apache/commons/compress/archivers/cpio/CpioArchiveOutputStream.java
Thu Mar 26 21:23:53 2009
@@ -41,9 +41,11 @@
  * CpioArchiveOutputStream out = new CpioArchiveOutputStream(
  *         new FileOutputStream(new File("test.cpio")));
  * CpioArchiveEntry entry = new CpioArchiveEntry();
- * entry.setName("testfile");
+ * entry.setName("testfile");
  * String contents = "12345";
  * entry.setFileSize(contents.length());
+ * entry.setMode(CpioConstants.C_ISREG); // regular file
+ * ... set other attributes, e.g. time, number of links
  * out.putNextEntry(entry);
  * out.write(testContents.getBytes());
  * out.close();
@@ -146,7 +148,7 @@
         }
 
         final short format = e.getFormat();
-        if (format == -1) {
+        if (format == 0) {// Not yet initialised
             e.setFormat(this.entryFormat);
         } else if (format != this.entryFormat){
             throw new IOException("Header format: "+format+" does not match existing format:
"+this.entryFormat);



Mime
View raw message