You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by tc...@apache.org on 2008/07/20 00:18:45 UTC
svn commit: r678234 - in /commons/sandbox/compress/branches/redesign: ./
src/main/java/org/apache/commons/compress/archivers/
src/main/java/org/apache/commons/compress/archivers/tar/
src/main/java/org/apache/commons/compress/archivers/zip/ src/main/jav...
Author: tcurdt
Date: Sat Jul 19 15:18:44 2008
New Revision: 678234
URL: http://svn.apache.org/viewvc?rev=678234&view=rev
Log:
removed author tags in favor of NOTICE file,
split up testcases,
nitpicking
Added:
commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/AbstractTestCase.java (with props)
commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/DetectArchiverTestCase.java (with props)
commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/DetectCompressorTestCase.java (with props)
commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/archivers/ArTestCase.java (with props)
commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/archivers/JarTestCase.java (with props)
commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/archivers/TarTestCase.java (with props)
commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/archivers/ZipTestCase.java (with props)
commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/compressors/
commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/compressors/BZip2TestCase.java (with props)
commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/compressors/GZipTestCase.java (with props)
Removed:
commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/archivers/CompressTestCase.java
Modified:
commons/sandbox/compress/branches/redesign/NOTICE.txt
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/ArchiveEntry.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/ArchiveInputStream.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveOutputStream.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/tar/TarBuffer.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/tar/TarConstants.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/tar/TarInputStream.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/tar/TarOutputStream.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/tar/TarUtils.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/AsiExtraField.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/ExtraFieldUtils.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/UnixStat.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/UnrecognizedExtraField.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntry.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/ZipEntry.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/ZipExtraField.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/ZipLong.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/ZipOutputStream.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/ZipShort.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/changes/Change.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/compressors/CompressorOutputStream.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStream.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorOutputStream.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2Constants.java
commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/compressors/bzip2/CRC.java
Modified: commons/sandbox/compress/branches/redesign/NOTICE.txt
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/NOTICE.txt?rev=678234&r1=678233&r2=678234&view=diff
==============================================================================
--- commons/sandbox/compress/branches/redesign/NOTICE.txt (original)
+++ commons/sandbox/compress/branches/redesign/NOTICE.txt Sat Jul 19 15:18:44 2008
@@ -3,3 +3,7 @@
This product includes software developed by
The Apache Software Foundation (http://www.apache.org/).
+
+Original BZip2 classes contributed by Keiron Liddle <ke...@aftexsw.com>, Aftex Software to the Apache Ant project
+Original Tar classes from contributors of the Apache Ant project
+Original Zip classes from contributors of the Apache Ant project
Modified: commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/ArchiveEntry.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/ArchiveEntry.java?rev=678234&r1=678233&r2=678234&view=diff
==============================================================================
--- commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/ArchiveEntry.java (original)
+++ commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/ArchiveEntry.java Sat Jul 19 15:18:44 2008
@@ -22,10 +22,7 @@
* Represents an entry of an archive.
*/
public interface ArchiveEntry {
- /**
- * Returns the name of this entry.
- * @return the name of this entry
- */
+
public String getName();
public long getSize();
Modified: commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/ArchiveInputStream.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/ArchiveInputStream.java?rev=678234&r1=678233&r2=678234&view=diff
==============================================================================
--- commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/ArchiveInputStream.java (original)
+++ commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/ArchiveInputStream.java Sat Jul 19 15:18:44 2008
@@ -22,7 +22,8 @@
import java.io.InputStream;
public abstract class ArchiveInputStream extends InputStream {
- /**
+
+ /**
* Returns the next Archive Entry in this Stream.
* @return the next entry
* @throws IOException if the next entry could not be read
Modified: commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java?rev=678234&r1=678233&r2=678234&view=diff
==============================================================================
--- commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java (original)
+++ commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveEntry.java Sat Jul 19 15:18:44 2008
@@ -64,13 +64,6 @@
* char devminor[8];
* } header;
* </pre>
- *
- * @author <a href="mailto:time@ice.com">Timothy Gerard Endres</a>
- * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
- * @author <a href="mailto:peter@apache.org">Peter Donald</a>
- * @version $Revision$ $Date$
- * @see TarInputStream
- * @see TarArchiveOutputStream
*/
public class TarArchiveEntry implements ArchiveEntry {
/**
Modified: commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveOutputStream.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveOutputStream.java?rev=678234&r1=678233&r2=678234&view=diff
==============================================================================
--- commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveOutputStream.java (original)
+++ commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/tar/TarArchiveOutputStream.java Sat Jul 19 15:18:44 2008
@@ -28,9 +28,6 @@
private TarOutputStream out = null;
- /**
- * @param out
- */
public TarArchiveOutputStream(OutputStream out) {
this.out = new TarOutputStream(out);
}
Modified: commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/tar/TarBuffer.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/tar/TarBuffer.java?rev=678234&r1=678233&r2=678234&view=diff
==============================================================================
--- commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/tar/TarBuffer.java (original)
+++ commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/tar/TarBuffer.java Sat Jul 19 15:18:44 2008
@@ -32,10 +32,6 @@
*
* You should never have a need to access this class directly. TarBuffers are
* created by Tar IO Streams.
- *
- * @author <a href="mailto:time@ice.com">Timothy Gerard Endres</a>
- * @author <a href="mailto:peter@apache.org">Peter Donald</a>
- * @version $Revision$ $Date$
*/
class TarBuffer
{
Modified: commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/tar/TarConstants.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/tar/TarConstants.java?rev=678234&r1=678233&r2=678234&view=diff
==============================================================================
--- commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/tar/TarConstants.java (original)
+++ commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/tar/TarConstants.java Sat Jul 19 15:18:44 2008
@@ -20,10 +20,6 @@
/**
* This interface contains all the definitions used in the package.
- *
- * @author <a href="mailto:time@ice.com">Timothy Gerard Endres</a>
- * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
- * @version $Revision$ $Date$
*/
interface TarConstants
{
Modified: commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/tar/TarInputStream.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/tar/TarInputStream.java?rev=678234&r1=678233&r2=678234&view=diff
==============================================================================
--- commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/tar/TarInputStream.java (original)
+++ commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/tar/TarInputStream.java Sat Jul 19 15:18:44 2008
@@ -27,13 +27,6 @@
* The TarInputStream reads a UNIX tar archive as an InputStream. methods are
* provided to position at each successive entry in the archive, and the read
* each entry as a normal input stream using read().
- *
- * @author <a href="mailto:time@ice.com">Timothy Gerard Endres</a>
- * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
- * @author <a href="mailto:peter@apache.org">Peter Donald</a>
- * @version $Revision$ $Date$
- * @see TarInputStream
- * @see TarArchiveEntry
*/
public class TarInputStream
extends FilterInputStream
Modified: commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/tar/TarOutputStream.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/tar/TarOutputStream.java?rev=678234&r1=678233&r2=678234&view=diff
==============================================================================
--- commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/tar/TarOutputStream.java (original)
+++ commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/tar/TarOutputStream.java Sat Jul 19 15:18:44 2008
@@ -27,12 +27,6 @@
* The TarOutputStream writes a UNIX tar archive as an OutputStream. Methods are
* provided to put entries, and then write their contents by writing to this
* stream using write().
- *
- * @author Timothy Gerard Endres <a href="mailto:time@ice.com">time@ice.com</a>
- * @author <a href="mailto:peter@apache.org">Peter Donald</a>
- * @version $Revision$ $Date$
- * @see TarInputStream
- * @see TarArchiveEntry
*/
public class TarOutputStream
extends FilterOutputStream
Modified: commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/tar/TarUtils.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/tar/TarUtils.java?rev=678234&r1=678233&r2=678234&view=diff
==============================================================================
--- commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/tar/TarUtils.java (original)
+++ commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/tar/TarUtils.java Sat Jul 19 15:18:44 2008
@@ -20,10 +20,6 @@
/**
* This class provides static utility methods to work with byte streams.
- *
- * @author <a href="mailto:time@ice.com">Timothy Gerard Endres</a>
- * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
- * @version $Revision$ $Date$
*/
class TarUtils
{
Modified: commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/AsiExtraField.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/AsiExtraField.java?rev=678234&r1=678233&r2=678234&view=diff
==============================================================================
--- commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/AsiExtraField.java (original)
+++ commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/AsiExtraField.java Sat Jul 19 15:18:44 2008
@@ -42,9 +42,6 @@
*
* Short is two bytes and Long is four bytes in big endian byte and word order,
* device numbers are currently not supported.</p>
- *
- * @author <a href="stefan.bodewig@epost.de">Stefan Bodewig</a>
- * @version $Revision$
*/
public class AsiExtraField
implements ZipExtraField, UnixStat, Cloneable
Modified: commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/ExtraFieldUtils.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/ExtraFieldUtils.java?rev=678234&r1=678233&r2=678234&view=diff
==============================================================================
--- commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/ExtraFieldUtils.java (original)
+++ commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/ExtraFieldUtils.java Sat Jul 19 15:18:44 2008
@@ -24,9 +24,6 @@
/**
* ZipExtraField related methods
- *
- * @author <a href="stefan.bodewig@epost.de">Stefan Bodewig</a>
- * @version $Revision$
*/
public class ExtraFieldUtils
{
Modified: commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/UnixStat.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/UnixStat.java?rev=678234&r1=678233&r2=678234&view=diff
==============================================================================
--- commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/UnixStat.java (original)
+++ commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/UnixStat.java Sat Jul 19 15:18:44 2008
@@ -20,9 +20,6 @@
/**
* Constants from stat.h on Unix systems.
- *
- * @author <a href="stefan.bodewig@epost.de">Stefan Bodewig</a>
- * @version $Revision$
*/
public interface UnixStat
{
Modified: commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/UnrecognizedExtraField.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/UnrecognizedExtraField.java?rev=678234&r1=678233&r2=678234&view=diff
==============================================================================
--- commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/UnrecognizedExtraField.java (original)
+++ commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/UnrecognizedExtraField.java Sat Jul 19 15:18:44 2008
@@ -23,9 +23,6 @@
*
* Assumes local file data and central directory entries are identical - unless
* told the opposite.</p>
- *
- * @author <a href="stefan.bodewig@epost.de">Stefan Bodewig</a>
- * @version $Revision$
*/
public class UnrecognizedExtraField
implements ZipExtraField
Modified: commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntry.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntry.java?rev=678234&r1=678233&r2=678234&view=diff
==============================================================================
--- commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntry.java (original)
+++ commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntry.java Sat Jul 19 15:18:44 2008
@@ -28,9 +28,6 @@
/**
* Extension that adds better handling of extra fields and provides access to
* the internal and external file attributes.
- *
- * @author <a href="stefan.bodewig@epost.de">Stefan Bodewig</a>
- * @version $Revision$
*/
public class ZipArchiveEntry
extends java.util.zip.ZipEntry
Modified: commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java?rev=678234&r1=678233&r2=678234&view=diff
==============================================================================
--- commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java (original)
+++ commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java Sat Jul 19 15:18:44 2008
@@ -28,8 +28,7 @@
public class ZipArchiveOutputStream extends ArchiveOutputStream {
private ZipOutputStream zipOut = null;
-
-
+
public ZipArchiveOutputStream(OutputStream out) {
this.zipOut = new ZipOutputStream(out);
}
Modified: commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/ZipEntry.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/ZipEntry.java?rev=678234&r1=678233&r2=678234&view=diff
==============================================================================
--- commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/ZipEntry.java (original)
+++ commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/ZipEntry.java Sat Jul 19 15:18:44 2008
@@ -26,13 +26,6 @@
/**
* Extension that adds better handling of extra fields and provides access to
* the internal and external file attributes.
- *
- * @author <a href="stefan.bodewig@epost.de">Stefan Bodewig</a>
-<<<<<<< HEAD:src/main/java/org/apache/commons/compress/archivers/zip/ZipEntry.java
- * @version $Revision$
-=======
- * @version $Revision$
->>>>>>> 75cb63ff7005344589b57d17338b64783f8f430c:src/main/java/org/apache/commons/compress/archivers/zip/ZipEntry.java
*/
public class ZipEntry
extends java.util.zip.ZipEntry
Modified: commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/ZipExtraField.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/ZipExtraField.java?rev=678234&r1=678233&r2=678234&view=diff
==============================================================================
--- commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/ZipExtraField.java (original)
+++ commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/ZipExtraField.java Sat Jul 19 15:18:44 2008
@@ -27,9 +27,6 @@
* once in the central directory. Usually they are the same, but they don't have
* to be. {@link java.util.zip.ZipOutputStream java.util.zip.ZipOutputStream}
* will only use the local file data in both places.</p>
- *
- * @author <a href="stefan.bodewig@epost.de">Stefan Bodewig</a>
- * @version $Revision$
*/
public interface ZipExtraField
{
Modified: commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/ZipLong.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/ZipLong.java?rev=678234&r1=678233&r2=678234&view=diff
==============================================================================
--- commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/ZipLong.java (original)
+++ commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/ZipLong.java Sat Jul 19 15:18:44 2008
@@ -21,9 +21,6 @@
/**
* Utility class that represents a four byte integer with conversion rules for
* the big endian byte order of ZIP files.
- *
- * @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a>
- * @version $Revision$
*/
public final class ZipLong implements Cloneable
{
Modified: commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/ZipOutputStream.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/ZipOutputStream.java?rev=678234&r1=678233&r2=678234&view=diff
==============================================================================
--- commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/ZipOutputStream.java (original)
+++ commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/ZipOutputStream.java Sat Jul 19 15:18:44 2008
@@ -41,9 +41,6 @@
* them yourself. Unfortunately this is not possible for the STORED method, here
* setting the CRC and uncompressed size information is required before {@link
* #putNextEntry putNextEntry} will be called.</p>
- *
- * @author <a href="stefan.bodewig@epost.de">Stefan Bodewig</a>
- * @version $Revision$
*/
public class ZipOutputStream
extends DeflaterOutputStream
Modified: commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/ZipShort.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/ZipShort.java?rev=678234&r1=678233&r2=678234&view=diff
==============================================================================
--- commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/ZipShort.java (original)
+++ commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/archivers/zip/ZipShort.java Sat Jul 19 15:18:44 2008
@@ -21,9 +21,6 @@
/**
* Utility class that represents a two byte integer with conversion rules for
* the big endian byte order of ZIP files.
- *
- * @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a>
- * @version $Revision$
*/
public final class ZipShort implements Cloneable
{
Modified: commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/changes/Change.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/changes/Change.java?rev=678234&r1=678233&r2=678234&view=diff
==============================================================================
--- commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/changes/Change.java (original)
+++ commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/changes/Change.java Sat Jul 19 15:18:44 2008
@@ -18,7 +18,6 @@
*/
package org.apache.commons.compress.changes;
-import org.apache.commons.compress.archivers.ArchiveInputStream;
interface Change {
// public void perform(ArchiveInputStream input);
Modified: commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/compressors/CompressorOutputStream.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/compressors/CompressorOutputStream.java?rev=678234&r1=678233&r2=678234&view=diff
==============================================================================
--- commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/compressors/CompressorOutputStream.java (original)
+++ commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/compressors/CompressorOutputStream.java Sat Jul 19 15:18:44 2008
@@ -20,7 +20,6 @@
import java.io.OutputStream;
-
public abstract class CompressorOutputStream extends OutputStream {
// TODO
}
Modified: commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStream.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStream.java?rev=678234&r1=678233&r2=678234&view=diff
==============================================================================
--- commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStream.java (original)
+++ commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorInputStream.java Sat Jul 19 15:18:44 2008
@@ -23,17 +23,9 @@
import org.apache.commons.compress.compressors.CompressorInputStream;
-/*
- * This package is based on the work done by Keiron Liddle, Aftex Software
- * <ke...@aftexsw.com> to whom the Ant project is very grateful for his great
- * code.
- */
-
/**
* An input stream that decompresses from the BZip2 format (without the file
* header chars) to be read as any other stream.
- *
- * @author <a href="mailto:keiron@aftexsw.com">Keiron Liddle</a>
*/
public class BZip2CompressorInputStream extends CompressorInputStream implements BZip2Constants {
@@ -42,6 +34,7 @@
//throw new CCoruptionError();
}
+ /*
private static void badBGLengths() {
cadvise();
}
@@ -49,6 +42,7 @@
private static void bitStreamEOF() {
cadvise();
}
+ */
private static void compressedStreamEOF() {
cadvise();
Modified: commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorOutputStream.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorOutputStream.java?rev=678234&r1=678233&r2=678234&view=diff
==============================================================================
--- commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorOutputStream.java (original)
+++ commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2CompressorOutputStream.java Sat Jul 19 15:18:44 2008
@@ -23,16 +23,9 @@
import org.apache.commons.compress.compressors.CompressorOutputStream;
-/*
- * This package is based on the work done by Keiron Liddle, Aftex Software
- * <ke...@aftexsw.com> to whom the Ant project is very grateful for his great
- * code.
- */
/**
* An output stream that compresses into the BZip2 format (without the file
* header chars) into another stream. TODO: Update to BZip2 1.0.1
- *
- * @author <a href="mailto:keiron@aftexsw.com">Keiron Liddle</a>
*/
public class BZip2CompressorOutputStream extends CompressorOutputStream implements BZip2Constants {
protected static final int SETMASK = (1 << 21);
@@ -566,7 +559,8 @@
int v, t, i, j, gs, ge, totc, bt, bc, iter;
int nSelectors = 0, alphaSize, minLen, maxLen, selCtr;
- int nGroups, nBytes;
+ int nGroups;
+ //int nBytes;
alphaSize = nInUse + 2;
for (t = 0; t < N_GROUPS; t++) {
@@ -797,7 +791,7 @@
}
}
- nBytes = bytesOut;
+ //nBytes = bytesOut;
for (i = 0; i < 16; i++) {
if (inUse16[i]) {
bsW(1, 1);
@@ -821,7 +815,7 @@
}
/* Now the selectors. */
- nBytes = bytesOut;
+ //nBytes = bytesOut;
bsW (3, nGroups);
bsW (15, nSelectors);
for (i = 0; i < nSelectors; i++) {
@@ -832,7 +826,7 @@
}
/* Now the coding tables. */
- nBytes = bytesOut;
+ //nBytes = bytesOut;
for (t = 0; t < nGroups; t++) {
int curr = len[t][0];
@@ -851,7 +845,7 @@
}
/* And finally, the block data proper */
- nBytes = bytesOut;
+ //nBytes = bytesOut;
selCtr = 0;
gs = 0;
while (true) {
Modified: commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2Constants.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2Constants.java?rev=678234&r1=678233&r2=678234&view=diff
==============================================================================
--- commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2Constants.java (original)
+++ commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/compressors/bzip2/BZip2Constants.java Sat Jul 19 15:18:44 2008
@@ -19,17 +19,9 @@
package org.apache.commons.compress.compressors.bzip2;
-/*
- * This package is based on the work done by Keiron Liddle, Aftex Software
- * <ke...@aftexsw.com> to whom the Ant project is very grateful for his great
- * code.
- */
-
/**
* Base class for both the compress and decompress classes. Holds common arrays,
* and static data.
- *
- * @author <a href="mailto:keiron@aftexsw.com">Keiron Liddle</a>
*/
interface BZip2Constants {
Modified: commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/compressors/bzip2/CRC.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/compressors/bzip2/CRC.java?rev=678234&r1=678233&r2=678234&view=diff
==============================================================================
--- commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/compressors/bzip2/CRC.java (original)
+++ commons/sandbox/compress/branches/redesign/src/main/java/org/apache/commons/compress/compressors/bzip2/CRC.java Sat Jul 19 15:18:44 2008
@@ -18,17 +18,9 @@
*/
package org.apache.commons.compress.compressors.bzip2;
-/*
- * This package is based on the work done by Keiron Liddle, Aftex Software
- * <ke...@aftexsw.com> to whom the Ant project is very grateful for his great
- * code.
- */
-
/**
* A simple class the hold and calculate the CRC for sanity checking of the
* data.
- *
- * @author <a href="mailto:keiron@aftexsw.com">Keiron Liddle</a>
*/
class CRC {
private static int[] CRC32_TABLE = new int[] { 0x00000000, 0x04c11db7,
Added: commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/AbstractTestCase.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/AbstractTestCase.java?rev=678234&view=auto
==============================================================================
--- commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/AbstractTestCase.java (added)
+++ commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/AbstractTestCase.java Sat Jul 19 15:18:44 2008
@@ -0,0 +1,23 @@
+package org.apache.commons.compress;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+public abstract class AbstractTestCase extends TestCase {
+
+ protected File dir;
+
+ protected void setUp() throws Exception {
+ dir = File.createTempFile("dir", "");
+ dir.delete();
+ dir.mkdir();
+ }
+
+ protected void tearDown() throws Exception {
+ dir.delete();
+ dir = null;
+ }
+
+
+}
Propchange: commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/AbstractTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/AbstractTestCase.java
------------------------------------------------------------------------------
svn:keywords = Date Revision Author HeadURL Id
Propchange: commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/AbstractTestCase.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/DetectArchiverTestCase.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/DetectArchiverTestCase.java?rev=678234&view=auto
==============================================================================
--- commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/DetectArchiverTestCase.java (added)
+++ commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/DetectArchiverTestCase.java Sat Jul 19 15:18:44 2008
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.commons.compress;
+
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+
+import junit.framework.TestCase;
+
+import org.apache.commons.compress.archivers.ArchiveInputStream;
+import org.apache.commons.compress.archivers.ArchiveStreamFactory;
+import org.apache.commons.compress.archivers.ar.ArArchiveInputStream;
+import org.apache.commons.compress.archivers.jar.JarArchiveInputStream;
+import org.apache.commons.compress.archivers.tar.TarArchiveInputStream;
+import org.apache.commons.compress.archivers.zip.ZipArchiveInputStream;
+
+public final class DetectArchiverTestCase extends TestCase {
+ public void testDetection() throws Exception {
+ final ArchiveStreamFactory factory = new ArchiveStreamFactory();
+
+ final ArchiveInputStream ar = factory.createArchiveInputStream(
+ new BufferedInputStream(new FileInputStream(
+ new File(getClass().getClassLoader().getResource("bla.ar").getFile()))));
+ assertTrue(ar instanceof ArArchiveInputStream);
+
+ final ArchiveInputStream tar = factory.createArchiveInputStream(
+ new BufferedInputStream(new FileInputStream(
+ new File(getClass().getClassLoader().getResource("bla.tar").getFile()))));
+ assertTrue(tar instanceof TarArchiveInputStream);
+
+ final ArchiveInputStream zip = factory.createArchiveInputStream(
+ new BufferedInputStream(new FileInputStream(
+ new File(getClass().getClassLoader().getResource("bla.zip").getFile()))));
+ assertTrue(zip instanceof ZipArchiveInputStream);
+
+ final ArchiveInputStream jar = factory.createArchiveInputStream(
+ new BufferedInputStream(new FileInputStream(
+ new File(getClass().getClassLoader().getResource("bla.jar").getFile()))));
+ assertTrue(jar instanceof JarArchiveInputStream);
+
+// final ArchiveInputStream tgz = factory.createArchiveInputStream(
+// new BufferedInputStream(new FileInputStream(
+// new File(getClass().getClassLoader().getResource("bla.tgz").getFile()))));
+// assertTrue(tgz instanceof TarArchiveInputStream);
+
+ }
+
+}
Propchange: commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/DetectArchiverTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/DetectArchiverTestCase.java
------------------------------------------------------------------------------
svn:keywords = Date Revision Author HeadURL Id
Propchange: commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/DetectArchiverTestCase.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/DetectCompressorTestCase.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/DetectCompressorTestCase.java?rev=678234&view=auto
==============================================================================
--- commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/DetectCompressorTestCase.java (added)
+++ commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/DetectCompressorTestCase.java Sat Jul 19 15:18:44 2008
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.commons.compress;
+
+import junit.framework.TestCase;
+
+public final class DetectCompressorTestCase extends TestCase {
+ public void testDetection() throws Exception {
+ }
+}
Propchange: commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/DetectCompressorTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/DetectCompressorTestCase.java
------------------------------------------------------------------------------
svn:keywords = Date Revision Author HeadURL Id
Propchange: commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/DetectCompressorTestCase.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/archivers/ArTestCase.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/archivers/ArTestCase.java?rev=678234&view=auto
==============================================================================
--- commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/archivers/ArTestCase.java (added)
+++ commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/archivers/ArTestCase.java Sat Jul 19 15:18:44 2008
@@ -0,0 +1,85 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.commons.compress.archivers;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import org.apache.commons.compress.archivers.ar.ArArchiveEntry;
+import org.apache.commons.compress.utils.IOUtils;
+
+import org.apache.commons.compress.AbstractTestCase;
+
+public final class ArTestCase extends AbstractTestCase {
+ public void testArArchiveCreation() throws Exception {
+ final File output = new File(dir, "bla.ar");
+
+ final File file1 = new File(getClass().getClassLoader().getResource("test1.xml").getFile());
+ final File file2 = new File(getClass().getClassLoader().getResource("test2.xml").getFile());
+
+ final OutputStream out = new FileOutputStream(output);
+ final ArchiveOutputStream os = new ArchiveStreamFactory().createArchiveOutputStream("ar", out);
+ os.putArchiveEntry(new ArArchiveEntry("test1.xml", file1.length()));
+ IOUtils.copy(new FileInputStream(file1), os);
+ os.closeArchiveEntry();
+
+ os.putArchiveEntry(new ArArchiveEntry("test2.xml", file2.length()));
+ IOUtils.copy(new FileInputStream(file2), os);
+ os.closeArchiveEntry();
+
+ os.close();
+ }
+
+ public void testArUnarchive() throws Exception {
+ final File output = new File(dir, "bla.ar");
+ {
+ final File file1 = new File(getClass().getClassLoader().getResource("test1.xml").getFile());
+ final File file2 = new File(getClass().getClassLoader().getResource("test2.xml").getFile());
+
+ final OutputStream out = new FileOutputStream(output);
+ final ArchiveOutputStream os = new ArchiveStreamFactory().createArchiveOutputStream("ar", out);
+ os.putArchiveEntry(new ArArchiveEntry("test1.xml", file1.length()));
+ IOUtils.copy(new FileInputStream(file1), os);
+ os.closeArchiveEntry();
+
+ os.putArchiveEntry(new ArArchiveEntry("test2.xml", file2.length()));
+ IOUtils.copy(new FileInputStream(file2), os);
+ os.closeArchiveEntry();
+ os.close();
+ }
+
+ // UnArArchive Operation
+ final File input = output;
+ final InputStream is = new FileInputStream(input);
+ final ArchiveInputStream in = new ArchiveStreamFactory().createArchiveInputStream("ar", is);
+ final ArArchiveEntry entry = (ArArchiveEntry)in.getNextEntry();
+
+ File target = new File(dir, entry.getName());
+ final OutputStream out = new FileOutputStream(target);
+
+ IOUtils.copy(in, out);
+
+ out.close();
+ in.close();
+ }
+
+}
Propchange: commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/archivers/ArTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/archivers/ArTestCase.java
------------------------------------------------------------------------------
svn:keywords = Date Revision Author HeadURL Id
Propchange: commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/archivers/ArTestCase.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/archivers/JarTestCase.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/archivers/JarTestCase.java?rev=678234&view=auto
==============================================================================
--- commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/archivers/JarTestCase.java (added)
+++ commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/archivers/JarTestCase.java Sat Jul 19 15:18:44 2008
@@ -0,0 +1,84 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.commons.compress.archivers;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
+import org.apache.commons.compress.utils.IOUtils;
+
+import org.apache.commons.compress.AbstractTestCase;
+
+public final class JarTestCase extends AbstractTestCase {
+ public void testJarArchiveCreation() throws Exception {
+ final File output = new File(dir, "bla.jar");
+
+ final File file1 = new File(getClass().getClassLoader().getResource("test1.xml").getFile());
+ final File file2 = new File(getClass().getClassLoader().getResource("test2.xml").getFile());
+
+ final OutputStream out = new FileOutputStream(output);
+
+ final ArchiveOutputStream os = new ArchiveStreamFactory().createArchiveOutputStream("jar", out);
+
+ os.putArchiveEntry(new ZipArchiveEntry("testdata/test1.xml"));
+ IOUtils.copy(new FileInputStream(file1), os);
+ os.closeArchiveEntry();
+
+ os.putArchiveEntry(new ZipArchiveEntry("testdata/test2.xml"));
+ IOUtils.copy(new FileInputStream(file2), os);
+ os.closeArchiveEntry();
+
+ os.close();
+ }
+
+
+ public void testJarUnarchive() throws Exception {
+ final File input = new File(getClass().getClassLoader().getResource("bla.jar").getFile());
+ final InputStream is = new FileInputStream(input);
+ final ArchiveInputStream in = new ArchiveStreamFactory().createArchiveInputStream("jar", is);
+
+ ZipArchiveEntry entry = (ZipArchiveEntry)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();
+ o = new File(dir, entry.getName());
+ o.getParentFile().mkdirs();
+ out = new FileOutputStream(o);
+ IOUtils.copy(in, out);
+ out.close();
+
+ entry = (ZipArchiveEntry)in.getNextEntry();
+ o = new File(dir, entry.getName());
+ o.getParentFile().mkdirs();
+ out = new FileOutputStream(o);
+ IOUtils.copy(in, out);
+ out.close();
+
+ in.close();
+ }
+
+}
Propchange: commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/archivers/JarTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/archivers/JarTestCase.java
------------------------------------------------------------------------------
svn:keywords = Date Revision Author HeadURL Id
Propchange: commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/archivers/JarTestCase.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/archivers/TarTestCase.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/archivers/TarTestCase.java?rev=678234&view=auto
==============================================================================
--- commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/archivers/TarTestCase.java (added)
+++ commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/archivers/TarTestCase.java Sat Jul 19 15:18:44 2008
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.commons.compress.archivers;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import org.apache.commons.compress.AbstractTestCase;
+import org.apache.commons.compress.archivers.tar.TarArchiveEntry;
+import org.apache.commons.compress.utils.IOUtils;
+
+public final class TarTestCase extends AbstractTestCase {
+ public void testTarArchiveCreation() throws Exception {
+
+ final File output = new File(dir, "bla.tar");
+
+ final File file1 = new File(getClass().getClassLoader().getResource("test1.xml").getFile());
+
+ final OutputStream out = new FileOutputStream(output);
+
+ final ArchiveOutputStream os = new ArchiveStreamFactory().createArchiveOutputStream("tar", out);
+
+ final TarArchiveEntry entry = new TarArchiveEntry("testdata/test1.xml");
+ entry.setModTime(0);
+ entry.setSize(file1.length());
+ entry.setUserID(0);
+ entry.setGroupID(0);
+ entry.setUserName("avalon");
+ entry.setGroupName("excalibur");
+ entry.setMode(0100000);
+
+ os.putArchiveEntry(entry);
+ IOUtils.copy(new FileInputStream(file1), os);
+
+ os.closeArchiveEntry();
+ os.close();
+ }
+ public void testTarUnarchive() throws Exception {
+ final File input = new File(getClass().getClassLoader().getResource("bla.tar").getFile());
+ final InputStream is = new FileInputStream(input);
+ final ArchiveInputStream in = new ArchiveStreamFactory().createArchiveInputStream("tar", is);
+ final TarArchiveEntry entry = (TarArchiveEntry)in.getNextEntry();
+ final OutputStream out = new FileOutputStream(new File(dir, entry.getName()));
+ IOUtils.copy(in, out);
+ out.close();
+ in.close();
+ }
+
+}
Propchange: commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/archivers/TarTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/archivers/TarTestCase.java
------------------------------------------------------------------------------
svn:keywords = Date Revision Author HeadURL Id
Propchange: commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/archivers/TarTestCase.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/archivers/ZipTestCase.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/archivers/ZipTestCase.java?rev=678234&view=auto
==============================================================================
--- commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/archivers/ZipTestCase.java (added)
+++ commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/archivers/ZipTestCase.java Sat Jul 19 15:18:44 2008
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.commons.compress.archivers;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
+import org.apache.commons.compress.utils.IOUtils;
+
+import org.apache.commons.compress.AbstractTestCase;
+
+public final class ZipTestCase extends AbstractTestCase {
+ public void testZipArchiveCreation() throws Exception {
+
+ final File output = new File(dir, "bla.zip");
+
+ final File file1 = new File(getClass().getClassLoader().getResource("test1.xml").getFile());
+ final File file2 = new File(getClass().getClassLoader().getResource("test2.xml").getFile());
+
+ final OutputStream out = new FileOutputStream(output);
+
+ final ArchiveOutputStream os = new ArchiveStreamFactory().createArchiveOutputStream("zip", out);
+
+ os.putArchiveEntry(new ZipArchiveEntry("testdata/test1.xml"));
+ IOUtils.copy(new FileInputStream(file1), os);
+ os.closeArchiveEntry();
+
+ os.putArchiveEntry(new ZipArchiveEntry("testdata/test2.xml"));
+ IOUtils.copy(new FileInputStream(file2), os);
+ os.closeArchiveEntry();
+
+ os.close();
+ }
+ public void testZipUnarchive() throws Exception {
+
+ final File input = new File(getClass().getClassLoader().getResource("bla.zip").getFile());
+
+ final InputStream is = new FileInputStream(input);
+ final ArchiveInputStream in = new ArchiveStreamFactory().createArchiveInputStream("zip", is);
+
+ final ZipArchiveEntry entry = (ZipArchiveEntry)in.getNextEntry();
+ final OutputStream out = new FileOutputStream(new File(dir, entry.getName()));
+
+ IOUtils.copy(in, out);
+
+ out.close();
+ in.close();
+ }
+
+}
Propchange: commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/archivers/ZipTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/archivers/ZipTestCase.java
------------------------------------------------------------------------------
svn:keywords = Date Revision Author HeadURL Id
Propchange: commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/archivers/ZipTestCase.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/compressors/BZip2TestCase.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/compressors/BZip2TestCase.java?rev=678234&view=auto
==============================================================================
--- commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/compressors/BZip2TestCase.java (added)
+++ commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/compressors/BZip2TestCase.java Sat Jul 19 15:18:44 2008
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.commons.compress.compressors;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import org.apache.commons.compress.AbstractTestCase;
+import org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream;
+import org.apache.commons.compress.utils.IOUtils;
+
+public final class BZip2TestCase extends AbstractTestCase {
+ public void testBzipCreation() throws Exception {
+ final File output = new File(dir, "bla.txt.bz2");
+ System.out.println(dir);
+ final File file1 = new File(getClass().getClassLoader().getResource("test.txt").getFile());
+ final OutputStream out = new FileOutputStream(output);
+ CompressorOutputStream cos = new CompressorStreamFactory().createCompressorOutputStream("bzip2", out);
+ IOUtils.copy(new FileInputStream(file1), cos);
+ cos.close();
+ }
+
+ public void testBzip2Unarchive() throws Exception {
+ final File output = new File(dir, "test-entpackt.txt");
+ System.out.println(dir);
+ final File input = new File(getClass().getClassLoader().getResource("bla.txt.bz2").getFile());
+ final InputStream is = new FileInputStream(input);
+ //final CompressorInputStream in = new CompressorStreamFactory().createCompressorInputStream("bzip2", is);
+ final CompressorInputStream in = new BZip2CompressorInputStream(is);
+ IOUtils.copy(in, new FileOutputStream(output));
+ in.close();
+ }
+
+}
Propchange: commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/compressors/BZip2TestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/compressors/BZip2TestCase.java
------------------------------------------------------------------------------
svn:keywords = Date Revision Author HeadURL Id
Propchange: commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/compressors/BZip2TestCase.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/compressors/GZipTestCase.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/compressors/GZipTestCase.java?rev=678234&view=auto
==============================================================================
--- commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/compressors/GZipTestCase.java (added)
+++ commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/compressors/GZipTestCase.java Sat Jul 19 15:18:44 2008
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.commons.compress.compressors;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import org.apache.commons.compress.AbstractTestCase;
+import org.apache.commons.compress.utils.IOUtils;
+
+public final class GZipTestCase extends AbstractTestCase {
+ public void testGzipCreation() throws Exception {
+ final File output = new File(dir, "bla.gz");
+ final File file1 = new File(getClass().getClassLoader().getResource("test1.xml").getFile());
+ final OutputStream out = new FileOutputStream(output);
+ CompressorOutputStream cos = new CompressorStreamFactory().createCompressorOutputStream("gz", out);
+ IOUtils.copy(new FileInputStream(file1), cos);
+ cos.close();
+ }
+
+ public void testGzipUnarchive() throws Exception {
+ final File output = new File(dir, "bla-entpackt.tar");
+ final File input = new File(getClass().getClassLoader().getResource("bla.tgz").getFile());
+ final InputStream is = new FileInputStream(input);
+ final CompressorInputStream in = new CompressorStreamFactory().createCompressorInputStream("gz", is);
+ IOUtils.copy(in, new FileOutputStream(output));
+ in.close();
+ }
+
+}
Propchange: commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/compressors/GZipTestCase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/compressors/GZipTestCase.java
------------------------------------------------------------------------------
svn:keywords = Date Revision Author HeadURL Id
Propchange: commons/sandbox/compress/branches/redesign/src/test/java/org/apache/commons/compress/compressors/GZipTestCase.java
------------------------------------------------------------------------------
svn:mime-type = text/plain