Author: sebb
Date: Thu Mar 26 20:18:57 2009
New Revision: 758833
URL: http://svn.apache.org/viewvc?rev=758833&view=rev
Log:
Ensure a valid mode is set
Modified:
commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/CpioTestCase.java
Modified:
commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/CpioTestCase.java
URL:
http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/CpioTestCase.java?rev=758833&r1=758832&r2=758833&view=diff
==============================================================================
---
commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/CpioTestCase.java
(original)
+++
commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/archivers/CpioTestCase.java
Thu Mar 26 20:18:57 2009
@@ -28,6 +28,7 @@
import org.apache.commons.compress.AbstractTestCase;
import org.apache.commons.compress.archivers.cpio.CpioArchiveEntry;
+import org.apache.commons.compress.archivers.cpio.CpioConstants;
import org.apache.commons.compress.utils.IOUtils;
public final class CpioTestCase extends AbstractTestCase {
@@ -60,11 +61,15 @@
final OutputStream out = new FileOutputStream(output);
final ArchiveOutputStream os = new
ArchiveStreamFactory().createArchiveOutputStream("cpio", out);
- os.putArchiveEntry(new CpioArchiveEntry("test1.xml",
file1.length()));
+ CpioArchiveEntry entry = new CpioArchiveEntry("test1.xml",
file1.length());
+ entry.setMode(CpioConstants.C_ISREG);
+ os.putArchiveEntry(entry);
IOUtils.copy(new FileInputStream(file1), os);
os.closeArchiveEntry();
- os.putArchiveEntry(new CpioArchiveEntry("test2.xml",
file2.length()));
+ entry = new CpioArchiveEntry("test2.xml", file2.length());
+ entry.setMode(CpioConstants.C_ISREG);
+ os.putArchiveEntry(entry);
IOUtils.copy(new FileInputStream(file2), os);
os.closeArchiveEntry();