You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by tc...@apache.org on 2006/07/31 12:55:13 UTC

svn commit: r427072 [5/5] - in /jakarta/commons/sandbox/compress/trunk: ./ src/examples/ src/examples/org/ src/examples/org/apache/ src/examples/org/apache/commons/ src/examples/org/apache/commons/compress/ src/examples/org/apache/commons/compress/exam...

Added: jakarta/commons/sandbox/compress/trunk/src/java/org/apache/commons/compress/compressors/bzip2/CRC.java
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/compress/trunk/src/java/org/apache/commons/compress/compressors/bzip2/CRC.java?rev=427072&view=auto
==============================================================================
--- jakarta/commons/sandbox/compress/trunk/src/java/org/apache/commons/compress/compressors/bzip2/CRC.java (added)
+++ jakarta/commons/sandbox/compress/trunk/src/java/org/apache/commons/compress/compressors/bzip2/CRC.java Mon Jul 31 03:55:10 2006
@@ -0,0 +1,127 @@
+/*
+ * Copyright 2002,2004 The Apache Software Foundation.
+ * 
+ * Licensed 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.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, 0x09823b6e, 0x0d4326d9,
+        0x130476dc, 0x17c56b6b, 0x1a864db2, 0x1e475005,
+        0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61,
+        0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd,
+        0x4c11db70, 0x48d0c6c7, 0x4593e01e, 0x4152fda9,
+        0x5f15adac, 0x5bd4b01b, 0x569796c2, 0x52568b75,
+        0x6a1936c8, 0x6ed82b7f, 0x639b0da6, 0x675a1011,
+        0x791d4014, 0x7ddc5da3, 0x709f7b7a, 0x745e66cd,
+        0x9823b6e0, 0x9ce2ab57, 0x91a18d8e, 0x95609039,
+        0x8b27c03c, 0x8fe6dd8b, 0x82a5fb52, 0x8664e6e5,
+        0xbe2b5b58, 0xbaea46ef, 0xb7a96036, 0xb3687d81,
+        0xad2f2d84, 0xa9ee3033, 0xa4ad16ea, 0xa06c0b5d,
+        0xd4326d90, 0xd0f37027, 0xddb056fe, 0xd9714b49,
+        0xc7361b4c, 0xc3f706fb, 0xceb42022, 0xca753d95,
+        0xf23a8028, 0xf6fb9d9f, 0xfbb8bb46, 0xff79a6f1,
+        0xe13ef6f4, 0xe5ffeb43, 0xe8bccd9a, 0xec7dd02d,
+        0x34867077, 0x30476dc0, 0x3d044b19, 0x39c556ae,
+        0x278206ab, 0x23431b1c, 0x2e003dc5, 0x2ac12072,
+        0x128e9dcf, 0x164f8078, 0x1b0ca6a1, 0x1fcdbb16,
+        0x018aeb13, 0x054bf6a4, 0x0808d07d, 0x0cc9cdca,
+        0x7897ab07, 0x7c56b6b0, 0x71159069, 0x75d48dde,
+        0x6b93dddb, 0x6f52c06c, 0x6211e6b5, 0x66d0fb02,
+        0x5e9f46bf, 0x5a5e5b08, 0x571d7dd1, 0x53dc6066,
+        0x4d9b3063, 0x495a2dd4, 0x44190b0d, 0x40d816ba,
+        0xaca5c697, 0xa864db20, 0xa527fdf9, 0xa1e6e04e,
+        0xbfa1b04b, 0xbb60adfc, 0xb6238b25, 0xb2e29692,
+        0x8aad2b2f, 0x8e6c3698, 0x832f1041, 0x87ee0df6,
+        0x99a95df3, 0x9d684044, 0x902b669d, 0x94ea7b2a,
+        0xe0b41de7, 0xe4750050, 0xe9362689, 0xedf73b3e,
+        0xf3b06b3b, 0xf771768c, 0xfa325055, 0xfef34de2,
+        0xc6bcf05f, 0xc27dede8, 0xcf3ecb31, 0xcbffd686,
+        0xd5b88683, 0xd1799b34, 0xdc3abded, 0xd8fba05a,
+        0x690ce0ee, 0x6dcdfd59, 0x608edb80, 0x644fc637,
+        0x7a089632, 0x7ec98b85, 0x738aad5c, 0x774bb0eb,
+        0x4f040d56, 0x4bc510e1, 0x46863638, 0x42472b8f,
+        0x5c007b8a, 0x58c1663d, 0x558240e4, 0x51435d53,
+        0x251d3b9e, 0x21dc2629, 0x2c9f00f0, 0x285e1d47,
+        0x36194d42, 0x32d850f5, 0x3f9b762c, 0x3b5a6b9b,
+        0x0315d626, 0x07d4cb91, 0x0a97ed48, 0x0e56f0ff,
+        0x1011a0fa, 0x14d0bd4d, 0x19939b94, 0x1d528623,
+        0xf12f560e, 0xf5ee4bb9, 0xf8ad6d60, 0xfc6c70d7,
+        0xe22b20d2, 0xe6ea3d65, 0xeba91bbc, 0xef68060b,
+        0xd727bbb6, 0xd3e6a601, 0xdea580d8, 0xda649d6f,
+        0xc423cd6a, 0xc0e2d0dd, 0xcda1f604, 0xc960ebb3,
+        0xbd3e8d7e, 0xb9ff90c9, 0xb4bcb610, 0xb07daba7,
+        0xae3afba2, 0xaafbe615, 0xa7b8c0cc, 0xa379dd7b,
+        0x9b3660c6, 0x9ff77d71, 0x92b45ba8, 0x9675461f,
+        0x8832161a, 0x8cf30bad, 0x81b02d74, 0x857130c3,
+        0x5d8a9099, 0x594b8d2e, 0x5408abf7, 0x50c9b640,
+        0x4e8ee645, 0x4a4ffbf2, 0x470cdd2b, 0x43cdc09c,
+        0x7b827d21, 0x7f436096, 0x7200464f, 0x76c15bf8,
+        0x68860bfd, 0x6c47164a, 0x61043093, 0x65c52d24,
+        0x119b4be9, 0x155a565e, 0x18197087, 0x1cd86d30,
+        0x029f3d35, 0x065e2082, 0x0b1d065b, 0x0fdc1bec,
+        0x3793a651, 0x3352bbe6, 0x3e119d3f, 0x3ad08088,
+        0x2497d08d, 0x2056cd3a, 0x2d15ebe3, 0x29d4f654,
+        0xc5a92679, 0xc1683bce, 0xcc2b1d17, 0xc8ea00a0,
+        0xd6ad50a5, 0xd26c4d12, 0xdf2f6bcb, 0xdbee767c,
+        0xe3a1cbc1, 0xe760d676, 0xea23f0af, 0xeee2ed18,
+        0xf0a5bd1d, 0xf464a0aa, 0xf9278673, 0xfde69bc4,
+        0x89b8fd09, 0x8d79e0be, 0x803ac667, 0x84fbdbd0,
+        0x9abc8bd5, 0x9e7d9662, 0x933eb0bb, 0x97ffad0c,
+        0xafb010b1, 0xab710d06, 0xa6322bdf, 0xa2f33668,
+        0xbcb4666d, 0xb8757bda, 0xb5365d03, 0xb1f740b4
+    };
+
+    private int m_globalCrc;
+
+    protected CRC()
+    {
+        initialiseCRC();
+    }
+
+    int getFinalCRC()
+    {
+        return ~m_globalCrc;
+    }
+
+    void initialiseCRC()
+    {
+        m_globalCrc = 0xffffffff;
+    }
+
+    void updateCRC( final int inCh )
+    {
+        int temp = ( m_globalCrc >> 24 ) ^ inCh;
+        if( temp < 0 )
+        {
+            temp = 256 + temp;
+        }
+        m_globalCrc = ( m_globalCrc << 8 ) ^ CRC32_TABLE[ temp ];
+    }
+}
+

Propchange: jakarta/commons/sandbox/compress/trunk/src/java/org/apache/commons/compress/compressors/bzip2/CRC.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/commons/sandbox/compress/trunk/src/java/org/apache/commons/compress/compressors/bzip2/CRC.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: jakarta/commons/sandbox/compress/trunk/src/java/org/apache/commons/compress/compressors/bzip2/CRC.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: jakarta/commons/sandbox/compress/trunk/src/java/org/apache/commons/compress/compressors/bzip2/package.html
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/compress/trunk/src/java/org/apache/commons/compress/compressors/bzip2/package.html?rev=427072&view=auto
==============================================================================
--- jakarta/commons/sandbox/compress/trunk/src/java/org/apache/commons/compress/compressors/bzip2/package.html (added)
+++ jakarta/commons/sandbox/compress/trunk/src/java/org/apache/commons/compress/compressors/bzip2/package.html Mon Jul 31 03:55:10 2006
@@ -0,0 +1,10 @@
+<html>
+  <head></head>
+  <body bgcolor="white">
+      <p>
+        Streams that compress and decompress the BZip2 format (without the
+        file header chars). Originally derived from code in the ant project.
+      </p>
+  </body>
+</html>
+

Propchange: jakarta/commons/sandbox/compress/trunk/src/java/org/apache/commons/compress/compressors/bzip2/package.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/commons/sandbox/compress/trunk/src/java/org/apache/commons/compress/compressors/bzip2/package.html
------------------------------------------------------------------------------
    svn:executable = *

Propchange: jakarta/commons/sandbox/compress/trunk/src/java/org/apache/commons/compress/compressors/bzip2/package.html
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/CompressUtilsTest.java
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/CompressUtilsTest.java?rev=427072&view=auto
==============================================================================
--- jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/CompressUtilsTest.java (added)
+++ jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/CompressUtilsTest.java Mon Jul 31 03:55:10 2006
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2002,2004 The Apache Software Foundation.
+ * 
+ * Licensed 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;
+
+/**
+ * Test for Compress Utils
+ * @author christian.grobmeier
+ */
+public class CompressUtilsTest extends TestCase {
+
+	public void testCompareByteArrays() {
+		byte[] source = { 0x0, 0x0, 0x0, 0x0, 0x0,0x0, 0x0, 0x0, 0x0, 0x0,0x0, 0x0, 0x0, 0x0, 0x0,0x0, 0x0, 0x0, 0x0, 0x0 };
+		byte[] match = { 0x0, 0x0, 0x0, 0x0, 0x0 };
+		
+		assertTrue(CompressUtils.compareByteArrays(source, match));
+		
+		byte[] match2 = { 0x0, 0x0, 0x0, 0x0, 0x10 };
+		assertFalse(CompressUtils.compareByteArrays(source, match2));
+		
+		byte[] source3 = { 0x50, 0x4b, 0x03, 0x04, 0x0,0x0, 0x0, 0x0, 0x0, 0x0,0x0, 0x0, 0x0, 0x0, 0x0,0x0, 0x0, 0x0, 0x0, 0x0 };
+		byte[] match3 = { 0x50, 0x4b, 0x03, 0x04};
+		assertTrue(CompressUtils.compareByteArrays(source3, match3));
+		
+		byte[] source4 = { 0x50, 0x4b, 0x03, 0x04, 0x0,0x0, 0x0, 0x0, 0x0, 0x0,0x0, 0x0, 0x0, 0x0, 0x0,0x0, 0x0, 0x0, 0x0, 0x0 };
+		byte[] match4 = { 0x52, 0x4b, 0x03, 0x04};
+		assertFalse(CompressUtils.compareByteArrays(source4, match4));
+	}
+}

Propchange: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/CompressUtilsTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/CompressUtilsTest.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/CompressUtilsTest.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/tar/TarTestCase.java
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/tar/TarTestCase.java?rev=427072&view=auto
==============================================================================
--- jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/tar/TarTestCase.java (added)
+++ jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/tar/TarTestCase.java Mon Jul 31 03:55:10 2006
@@ -0,0 +1,319 @@
+/*
+ * Copyright 2002,2004 The Apache Software Foundation.
+ * 
+ * Licensed 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.tar;
+
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import junit.framework.TestCase;
+
+import org.apache.commons.compress.archivers.tar.TarEntry;
+import org.apache.commons.compress.archivers.tar.TarInputStream;
+
+/**
+ * Test case for all tar resources.
+ *
+ * @todo Find V7 tar and do tests against it
+ * @author <a href="mailto:peter@apache.org">Peter Donald</a>
+ * @version $Revision: 155439 $ $Date$
+ */
+public final class TarTestCase
+    extends TestCase
+{
+    private static final char SP = File.separatorChar;
+    private static final String BASE_DATA_NAME = "data.txt";
+    private static final String LFN_PART = "a-b-c-d-e-f-g-h-i-j/";
+    private static final String LONG_FILE_NAME =
+        LFN_PART + LFN_PART + LFN_PART + LFN_PART + LFN_PART + "a";
+
+    private static final String BASEDIR = calcBaseDir();
+
+    private static final File BASEDIR_FILE = new File( BASEDIR );
+    private static final File POSIX_TAR_FILE =
+        new File( BASEDIR_FILE, "posix.tar" );
+    //    private static final File V7_TAR_FILE =
+    //        new File( BASEDIR_FILE, "v7.tar" );
+    private static final File GNU_TAR_FILE =
+        new File( BASEDIR_FILE, "gnu.tar" );
+    private static final File DATA_FILE1 =
+        new File( BASEDIR_FILE, BASE_DATA_NAME );
+    private static final String USER_NAME = "avalon";
+    private static final String GROUP_NAME = "excalibur";
+    private static final long SIZE = DATA_FILE1.length();
+    private static final int GROUP_ID = 0;
+    private static final int USER_ID = 0;
+    private static final int MODE = 0100000;
+    private static final int MOD_TIME = 0;
+
+    public TarTestCase()
+    {
+        this( "Tar Test Case" );
+    }
+
+    public TarTestCase( String name )
+    {
+        super( name );
+    }
+
+    private static String calcBaseDir()
+    {
+        final String name = TarTestCase.class.getName();
+        final int size = name.length();
+        final String filename =
+            name.substring( 0, size - 11 ).replace( '.', SP );
+        return "src" + SP + "test" + SP +
+                SP + filename + SP;
+    }
+
+    public void testReadPosixTar()
+        throws Exception
+    {
+        compareTar( BASE_DATA_NAME, POSIX_TAR_FILE );
+    }
+
+    public void testReadGnuTar()
+        throws Exception
+    {
+        compareTar( LONG_FILE_NAME, GNU_TAR_FILE );
+    }
+
+    public void testWritePosixTar()
+        throws Exception
+    {
+        //final File temp = new File( BASEDIR_FILE, "posix2.tar" );
+        final File temp = File.createTempFile( "delete-me", "tar" );
+        final FileOutputStream fileOutput = new FileOutputStream( temp );
+        final TarOutputStream output = new TarOutputStream( fileOutput );
+        //output.setBufferDebug( true );
+        final TarEntry entry = new TarEntry( BASE_DATA_NAME );
+        setupEntry( entry );
+        output.putNextEntry( entry );
+
+        final FileInputStream fileInput = new FileInputStream( DATA_FILE1 );
+        output.copyEntryContents( fileInput );
+        output.closeEntry();
+        shutdownStream( fileInput );
+        shutdownStream( output );
+        shutdownStream( fileOutput );
+
+        assertTrue( "Tar files Equal", contentEquals( temp, POSIX_TAR_FILE ) );
+        temp.delete();
+    }
+
+    public void testWriteGnuTar()
+        throws Exception
+    {
+        //final File temp = new File( BASEDIR_FILE, "gnu2.tar" );
+        final File temp = File.createTempFile( "delete-me", "tar" );
+        final FileOutputStream fileOutput = new FileOutputStream( temp );
+        final TarOutputStream output = new TarOutputStream( fileOutput );
+        //output.setBufferDebug( true );
+        output.setLongFileMode( TarOutputStream.LONGFILE_GNU );
+        final TarEntry entry = new TarEntry( LONG_FILE_NAME );
+        setupEntry( entry );
+        output.putNextEntry( entry );
+
+        final FileInputStream fileInput = new FileInputStream( DATA_FILE1 );
+        output.copyEntryContents( fileInput );
+        output.closeEntry();
+        shutdownStream( fileInput );
+        shutdownStream( output );
+        shutdownStream( fileOutput );
+
+        //Have to compare it this way as the contents will differ
+        //due to entry created for second part of name
+        compareTar( LONG_FILE_NAME, temp );
+        temp.delete();
+    }
+
+    private void setupEntry( final TarEntry entry )
+    {
+        entry.setModTime( MOD_TIME );
+        entry.setSize( SIZE );
+        entry.setUserID( USER_ID );
+        entry.setGroupID( GROUP_ID );
+        entry.setUserName( USER_NAME );
+        entry.setGroupName( GROUP_NAME );
+        entry.setMode( MODE );
+    }
+
+    private void checkEntry( final TarEntry entry )
+    {
+        assertEquals( "Entry size", SIZE, entry.getSize() );
+        assertEquals( "Entry User ID", USER_ID, entry.getUserID() );
+        assertEquals( "Entry Group ID", GROUP_ID, entry.getGroupID() );
+        assertEquals( "Entry User name", USER_NAME, entry.getUserName() );
+        assertEquals( "Entry group name", GROUP_NAME, entry.getGroupName() );
+        assertEquals( "Entry mode", MODE, entry.getMode() );
+        assertEquals( "Entry mode", MOD_TIME, entry.getModTime().getTime() / 1000 );
+    }
+
+    /**
+     * Read tar entry with specified name from tar file1 and compare
+     * against data file DATA_FILE1.
+     *
+     * @param entryName the expected name of entry
+     * @param file1 the tar file comparing
+     * @throws IOException if an error occurs
+     */
+    private void compareTar( final String entryName,
+                             final File file1 )
+        throws IOException
+    {
+        final FileInputStream fileInput = new FileInputStream( file1 );
+        final TarInputStream input = new TarInputStream( fileInput );
+        //input.setDebug( true );
+        final TarEntry entry = input.getNextEntry();
+
+        assertEquals( "Entry name", entryName, entry.getName() );
+        checkEntry( entry );
+
+        final File temp = new File( BASEDIR_FILE, entryName.length() + "data.txt" );//File.createTempFile( "delete-me", "tar" );
+        final FileOutputStream output = new FileOutputStream( temp );
+        input.copyEntryContents( output );
+        shutdownStream( output );
+
+        assertNull( "Next Entry", input.getNextEntry() );
+
+        shutdownStream( input );
+
+        assertTrue( "Data Equals", contentEquals( temp, DATA_FILE1 ) );
+        temp.delete();
+    }
+
+    /**
+     * Compare the contents of two files to determine if they are equal or not.
+     *
+     * @param file1 the first file
+     * @param file2 the second file
+     * @return true if the content of the files are equal or they both don't exist, false otherwise
+     */
+    private boolean contentEquals( final File file1, final File file2 )
+        throws IOException
+    {
+        final boolean file1Exists = file1.exists();
+        if( file1Exists != file2.exists() )
+        {
+            return false;
+        }
+
+        if( !file1Exists )
+        {
+            // two not existing files are equal
+            return true;
+        }
+
+        if( file1.isDirectory() || file2.isDirectory() )
+        {
+            // don't want to compare directory contents
+            return false;
+        }
+
+        InputStream input1 = null;
+        InputStream input2 = null;
+        try
+        {
+            input1 = new FileInputStream( file1 );
+            input2 = new FileInputStream( file2 );
+            return contentEquals( input1, input2 );
+
+        }
+        finally
+        {
+            shutdownStream( input1 );
+            shutdownStream( input2 );
+        }
+    }
+
+    /**
+     * Compare the contents of two Streams to determine if they are equal or not.
+     *
+     * @param input1 the first stream
+     * @param input2 the second stream
+     * @return true if the content of the streams are equal or they both don't exist, false otherwise
+     */
+    private boolean contentEquals( final InputStream input1,
+                                   final InputStream input2 )
+        throws IOException
+    {
+        final InputStream bufferedInput1 = new BufferedInputStream( input1 );
+        final InputStream bufferedInput2 = new BufferedInputStream( input2 );
+
+        int count = 0;
+        int ch = bufferedInput1.read();
+        while( -1 != ch )
+        {
+            final int ch2 = bufferedInput2.read();
+            count++;
+            if( ch != ch2 )
+            {
+                System.out.println( "count = " + count );
+                System.out.println( "ch2 = " + ch2 );
+                System.out.println( "ch = " + ch );
+                return false;
+            }
+            ch = bufferedInput1.read();
+        }
+
+        final int ch2 = bufferedInput2.read();
+        if( -1 != ch2 )
+        {
+            return false;
+        }
+        else
+        {
+            return true;
+        }
+    }
+
+    private void shutdownStream( final InputStream input )
+    {
+        if( null == input )
+        {
+            return;
+        }
+
+        try
+        {
+            input.close();
+        }
+        catch( final IOException ioe )
+        {
+        }
+    }
+
+    private void shutdownStream( final OutputStream output )
+    {
+        if( null == output )
+        {
+            return;
+        }
+
+        try
+        {
+            output.close();
+        }
+        catch( final IOException ioe )
+        {
+        }
+    }
+}

Propchange: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/tar/TarTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/tar/TarTestCase.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/tar/TarTestCase.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/tar/TarTestSuite.java
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/tar/TarTestSuite.java?rev=427072&view=auto
==============================================================================
--- jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/tar/TarTestSuite.java (added)
+++ jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/tar/TarTestSuite.java Mon Jul 31 03:55:10 2006
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2002,2004 The Apache Software Foundation.
+ * 
+ * Licensed 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.tar;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * A basic test suite that tests all the tar package.
+ */
+public class TarTestSuite
+{
+    public static Test suite()
+    {
+        final TestSuite suite = new TestSuite( "Tar Utilities" );
+        return suite;
+    }
+}

Propchange: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/tar/TarTestSuite.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/tar/TarTestSuite.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/tar/TarTestSuite.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/tar/data.txt
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/tar/data.txt?rev=427072&view=auto
==============================================================================
--- jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/tar/data.txt (added)
+++ jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/tar/data.txt Mon Jul 31 03:55:10 2006
@@ -0,0 +1,15 @@
+    One of the greatest benefactors of all lifekind was a man who
+couldn't keep his mind on the job at hand.
+    Brilliant?
+    Certainly.
+    One of the foremost genetic engineers of his or any other
+generation, including a number he had designed himself?
+    Without a doubt.
+    The problem was that he was far too interested in things which
+he shouldn't be interested in, at least as people would tell him,
+not now.
+    He was also, partly because of this, of a rather irritable
+disposition.
+    So when the world was threatened by terrible invaders from a
+distant star, who were still a fair way off but traveling fast,
+he, Blart Versenwald III...
\ No newline at end of file

Propchange: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/tar/data.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/tar/data.txt
------------------------------------------------------------------------------
    svn:executable = *

Propchange: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/tar/data.txt
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/tar/gnu.tar
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/tar/gnu.tar?rev=427072&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/tar/gnu.tar
------------------------------------------------------------------------------
    svn:executable = *

Propchange: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/tar/gnu.tar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/tar/posix.tar
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/tar/posix.tar?rev=427072&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/tar/posix.tar
------------------------------------------------------------------------------
    svn:executable = *

Propchange: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/tar/posix.tar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/tar/update-tars.bat
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/tar/update-tars.bat?rev=427072&view=auto
==============================================================================
--- jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/tar/update-tars.bat (added)
+++ jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/tar/update-tars.bat Mon Jul 31 03:55:10 2006
@@ -0,0 +1,3 @@
+copy gnu2.tar gnu.tar
+copy posix2.tar posix.tar
+pause
\ No newline at end of file

Propchange: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/tar/update-tars.bat
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/tar/update-tars.bat
------------------------------------------------------------------------------
    svn:executable = *

Propchange: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/tar/update-tars.bat
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/zip/AsiExtraFieldTestCase.java
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/zip/AsiExtraFieldTestCase.java?rev=427072&view=auto
==============================================================================
--- jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/zip/AsiExtraFieldTestCase.java (added)
+++ jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/zip/AsiExtraFieldTestCase.java Mon Jul 31 03:55:10 2006
@@ -0,0 +1,178 @@
+/*
+ * Copyright 2002,2004 The Apache Software Foundation.
+ * 
+ * Licensed 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.zip;
+
+import java.util.zip.ZipException;
+
+import org.apache.commons.compress.archivers.zip.AsiExtraField;
+import org.apache.commons.compress.archivers.zip.UnixStat;
+
+import junit.framework.TestCase;
+
+/**
+ * JUnit testcases AsiExtraField.
+ *
+ * @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a>
+ */
+public class AsiExtraFieldTestCase
+    extends TestCase
+    implements UnixStat
+{
+    public AsiExtraFieldTestCase( final String name )
+    {
+        super( name );
+    }
+
+    /**
+     * Test file mode magic.
+     */
+    public void testModes()
+    {
+        final AsiExtraField field = new AsiExtraField();
+        field.setMode( 0123 );
+        assertEquals( "plain file", 0100123, field.getMode() );
+        field.setDirectory( true );
+        assertEquals( "directory", 040123, field.getMode() );
+        field.setLinkedFile( "test" );
+        assertEquals( "symbolic link", 0120123, field.getMode() );
+    }
+
+    private AsiExtraField createField()
+    {
+        final AsiExtraField field = new AsiExtraField();
+        field.setMode( 0123 );
+        field.setUserID( 5 );
+        field.setGroupId( 6 );
+        return field;
+    }
+
+    public void testContent1()
+    {
+        final AsiExtraField field = createField();
+        final byte[] data = field.getLocalFileDataData();
+
+        // CRC manually calculated, sorry
+        final byte[] expect = {(byte)0xC6, 0x02, 0x78, (byte)0xB6, // CRC
+                               0123, (byte)0x80, // mode
+                               0, 0, 0, 0, // link length
+                               5, 0, 6, 0};                        // uid, gid
+        assertEquals( "no link", expect.length, data.length );
+        for( int i = 0; i < expect.length; i++ )
+        {
+            assertEquals( "no link, byte " + i, expect[ i ], data[ i ] );
+        }
+
+        field.setLinkedFile( "test" );
+    }
+
+    public void testContent2()
+    {
+        final AsiExtraField field = createField();
+        field.setLinkedFile( "test" );
+
+        final byte[] data = field.getLocalFileDataData();
+        final byte[] expect = new byte[]{0x75, (byte)0x8E, 0x41, (byte)0xFD, // CRC
+                                         0123, (byte)0xA0, // mode
+                                         4, 0, 0, 0, // link length
+                                         5, 0, 6, 0, // uid, gid
+                                         (byte)'t', (byte)'e', (byte)'s', (byte)'t'};
+        assertEquals( "no link", expect.length, data.length );
+        for( int i = 0; i < expect.length; i++ )
+        {
+            assertEquals( "no link, byte " + i, expect[ i ], data[ i ] );
+        }
+
+    }
+
+    public void testReparse1()
+        throws ZipException
+    {
+        // CRC manually calculated, sorry
+        final byte[] data = {(byte)0xC6, 0x02, 0x78, (byte)0xB6, // CRC
+                             0123, (byte)0x80, // mode
+                             0, 0, 0, 0, // link length
+                             5, 0, 6, 0};                        // uid, gid
+        final AsiExtraField field = new AsiExtraField();
+        field.parseFromLocalFileData( data, 0, data.length );
+
+        assertEquals( "length plain file", data.length,
+                      field.getLocalFileDataLength().getValue() );
+        assertTrue( "plain file, no link", !field.isLink() );
+        assertTrue( "plain file, no dir", !field.isDirectory() );
+        assertEquals( "mode plain file", FILE_FLAG | 0123, field.getMode() );
+        assertEquals( "uid plain file", 5, field.getUserID() );
+        assertEquals( "gid plain file", 6, field.getGroupID() );
+    }
+
+    public void testReparse2()
+        throws ZipException
+    {
+        final byte[] data = new byte[]{0x75, (byte)0x8E, 0x41, (byte)0xFD, // CRC
+                                       0123, (byte)0xA0, // mode
+                                       4, 0, 0, 0, // link length
+                                       5, 0, 6, 0, // uid, gid
+                                       (byte)'t', (byte)'e', (byte)'s', (byte)'t'};
+        final AsiExtraField field = new AsiExtraField();
+        field.parseFromLocalFileData( data, 0, data.length );
+        assertEquals( "length link", data.length,
+                      field.getLocalFileDataLength().getValue() );
+        assertTrue( "link, is link", field.isLink() );
+        assertTrue( "link, no dir", !field.isDirectory() );
+        assertEquals( "mode link", LINK_FLAG | 0123, field.getMode() );
+        assertEquals( "uid link", 5, field.getUserID() );
+        assertEquals( "gid link", 6, field.getGroupID() );
+        assertEquals( "test", field.getLinkedFile() );
+    }
+
+    public void testReparse3()
+        throws ZipException
+    {
+        final byte[] data = new byte[]{(byte)0x8E, 0x01, (byte)0xBF, (byte)0x0E, // CRC
+                                       0123, (byte)0x40, // mode
+                                       0, 0, 0, 0, // link
+                                       5, 0, 6, 0};                          // uid, gid
+        final AsiExtraField field = new AsiExtraField();
+        field.parseFromLocalFileData( data, 0, data.length );
+        assertEquals( "length dir", data.length,
+                      field.getLocalFileDataLength().getValue() );
+        assertTrue( "dir, no link", !field.isLink() );
+        assertTrue( "dir, is dir", field.isDirectory() );
+        assertEquals( "mode dir", DIR_FLAG | 0123, field.getMode() );
+        assertEquals( "uid dir", 5, field.getUserID() );
+        assertEquals( "gid dir", 6, field.getGroupID() );
+    }
+
+    public void testReparse4()
+        throws Exception
+    {
+        final byte[] data = new byte[]{0, 0, 0, 0, // bad CRC
+                                       0123, (byte)0x40, // mode
+                                       0, 0, 0, 0, // link
+                                       5, 0, 6, 0};                          // uid, gid
+        final AsiExtraField field = new AsiExtraField();
+        try
+        {
+            field.parseFromLocalFileData( data, 0, data.length );
+            fail( "should raise bad CRC exception" );
+        }
+        catch( Exception e )
+        {
+            assertEquals( "bad CRC checksum 0 instead of ebf018e",
+                          e.getMessage() );
+        }
+    }
+}

Propchange: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/zip/AsiExtraFieldTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/zip/AsiExtraFieldTestCase.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/zip/AsiExtraFieldTestCase.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/zip/ExtraFieldUtilsTestCase.java
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/zip/ExtraFieldUtilsTestCase.java?rev=427072&view=auto
==============================================================================
--- jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/zip/ExtraFieldUtilsTestCase.java (added)
+++ jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/zip/ExtraFieldUtilsTestCase.java Mon Jul 31 03:55:10 2006
@@ -0,0 +1,130 @@
+/*
+ * Copyright 2002,2004 The Apache Software Foundation.
+ * 
+ * Licensed 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.zip;
+
+import org.apache.commons.compress.archivers.zip.AsiExtraField;
+import org.apache.commons.compress.archivers.zip.ExtraFieldUtils;
+import org.apache.commons.compress.archivers.zip.UnixStat;
+import org.apache.commons.compress.archivers.zip.UnrecognizedExtraField;
+import org.apache.commons.compress.archivers.zip.ZipExtraField;
+import org.apache.commons.compress.archivers.zip.ZipShort;
+
+import junit.framework.TestCase;
+
+/**
+ * JUnit testcases ExtraFieldUtils.
+ *
+ * @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a>
+ */
+public class ExtraFieldUtilsTestCase
+    extends TestCase
+    implements UnixStat
+{
+    private AsiExtraField m_field;
+    private UnrecognizedExtraField m_dummy;
+    private byte[] m_data;
+    private byte[] m_local;
+
+    public ExtraFieldUtilsTestCase( final String name )
+    {
+        super( name );
+    }
+
+    public void setUp()
+    {
+        m_field = new AsiExtraField();
+        m_field.setMode( 0755 );
+        m_field.setDirectory( true );
+        m_dummy = new UnrecognizedExtraField();
+        m_dummy.setHeaderID( new ZipShort( 1 ) );
+        m_dummy.setLocalFileDataData( new byte[ 0 ] );
+        m_dummy.setCentralDirectoryData( new byte[]{0} );
+
+        m_local = m_field.getLocalFileDataData();
+        final byte[] dummyLocal = m_dummy.getLocalFileDataData();
+        m_data = new byte[ 4 + m_local.length + 4 + dummyLocal.length ];
+        System.arraycopy( m_field.getHeaderID().getBytes(), 0, m_data, 0, 2 );
+        System.arraycopy( m_field.getLocalFileDataLength().getBytes(), 0, m_data, 2, 2 );
+        System.arraycopy( m_local, 0, m_data, 4, m_local.length );
+        System.arraycopy( m_dummy.getHeaderID().getBytes(), 0, m_data,
+                          4 + m_local.length, 2 );
+        System.arraycopy( m_dummy.getLocalFileDataLength().getBytes(), 0, m_data,
+                          4 + m_local.length + 2, 2 );
+        System.arraycopy( dummyLocal, 0, m_data,
+                          4 + m_local.length + 4, dummyLocal.length );
+
+    }
+
+    /**
+     * test parser.
+     */
+    public void testParse() throws Exception
+    {
+        final ZipExtraField[] extraField = ExtraFieldUtils.parse( m_data );
+        assertEquals( "number of fields", 2, extraField.length );
+        assertTrue( "type field 1", extraField[ 0 ] instanceof AsiExtraField );
+        assertEquals( "mode field 1", 040755,
+                      ( (AsiExtraField)extraField[ 0 ] ).getMode() );
+        assertTrue( "type field 2", extraField[ 1 ] instanceof UnrecognizedExtraField );
+        assertEquals( "data length field 2", 0,
+                      extraField[ 1 ].getLocalFileDataLength().getValue() );
+
+        final byte[] data2 = new byte[ m_data.length - 1 ];
+        System.arraycopy( m_data, 0, data2, 0, data2.length );
+        try
+        {
+            ExtraFieldUtils.parse( data2 );
+            fail( "data should be invalid" );
+        }
+        catch( Exception e )
+        {
+            assertEquals( "message",
+                          "data starting at " + ( 4 + m_local.length ) + " is in unknown format",
+                          e.getMessage() );
+        }
+    }
+
+    /**
+     * Test merge methods
+     */
+    public void testMerge()
+    {
+        final byte[] local =
+            ExtraFieldUtils.mergeLocalFileDataData( new ZipExtraField[]{m_field, m_dummy} );
+        assertEquals( "local length", m_data.length, local.length );
+        for( int i = 0; i < local.length; i++ )
+        {
+            assertEquals( "local byte " + i, m_data[ i ], local[ i ] );
+        }
+
+        final byte[] dummyCentral = m_dummy.getCentralDirectoryData();
+        final byte[] data2 = new byte[ 4 + m_local.length + 4 + dummyCentral.length ];
+        System.arraycopy( m_data, 0, data2, 0, 4 + m_local.length + 2 );
+        System.arraycopy( m_dummy.getCentralDirectoryLength().getBytes(), 0,
+                          data2, 4 + m_local.length + 2, 2 );
+        System.arraycopy( dummyCentral, 0, data2,
+                          4 + m_local.length + 4, dummyCentral.length );
+
+        final byte[] central =
+            ExtraFieldUtils.mergeCentralDirectoryData( new ZipExtraField[]{m_field, m_dummy} );
+        assertEquals( "central length", data2.length, central.length );
+        for( int i = 0; i < central.length; i++ )
+        {
+            assertEquals( "central byte " + i, data2[ i ], central[ i ] );
+        }
+    }
+}

Propchange: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/zip/ExtraFieldUtilsTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/zip/ExtraFieldUtilsTestCase.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/zip/ExtraFieldUtilsTestCase.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/zip/ZipEntryTestCase.java
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/zip/ZipEntryTestCase.java?rev=427072&view=auto
==============================================================================
--- jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/zip/ZipEntryTestCase.java (added)
+++ jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/zip/ZipEntryTestCase.java Mon Jul 31 03:55:10 2006
@@ -0,0 +1,110 @@
+/*
+ * Copyright 2002,2004 The Apache Software Foundation.
+ * 
+ * Licensed 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.zip;
+
+import java.util.NoSuchElementException;
+
+import org.apache.commons.compress.archivers.zip.AsiExtraField;
+import org.apache.commons.compress.archivers.zip.UnrecognizedExtraField;
+import org.apache.commons.compress.archivers.zip.ZipEntry;
+import org.apache.commons.compress.archivers.zip.ZipExtraField;
+import org.apache.commons.compress.archivers.zip.ZipShort;
+
+import junit.framework.TestCase;
+
+/**
+ * JUnit testcases ZipEntry.
+ *
+ * @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a>
+ */
+public class ZipEntryTestCase
+    extends TestCase
+{
+    public ZipEntryTestCase( final String name )
+    {
+        super( name );
+    }
+
+    /**
+     * test handling of extra fields
+     */
+    public void testExtraFields()
+    {
+        final AsiExtraField field = createField();
+        final UnrecognizedExtraField extraField = createExtraField();
+
+        final ZipEntry entry = new ZipEntry( "test/" );
+        entry.setExtraFields( new ZipExtraField[]{field, extraField} );
+        final byte[] data1 = entry.getExtra();
+        ZipExtraField[] result = entry.getExtraFields();
+        assertEquals( "first pass", 2, result.length );
+        assertSame( field, result[ 0 ] );
+        assertSame( extraField, result[ 1 ] );
+
+        UnrecognizedExtraField u2 = new UnrecognizedExtraField();
+        u2.setHeaderID( new ZipShort( 1 ) );
+        u2.setLocalFileDataData( new byte[]{1} );
+
+        entry.addExtraField( u2 );
+        byte[] data2 = entry.getExtra();
+        result = entry.getExtraFields();
+        assertEquals( "second pass", 2, result.length );
+        assertSame( field, result[ 0 ] );
+        assertSame( u2, result[ 1 ] );
+        assertEquals( "length second pass", data1.length + 1, data2.length );
+
+        UnrecognizedExtraField u3 = new UnrecognizedExtraField();
+        u3.setHeaderID( new ZipShort( 2 ) );
+        u3.setLocalFileDataData( new byte[]{1} );
+        entry.addExtraField( u3 );
+        result = entry.getExtraFields();
+        assertEquals( "third pass", 3, result.length );
+
+        entry.removeExtraField( new ZipShort( 1 ) );
+        byte[] data3 = entry.getExtra();
+        result = entry.getExtraFields();
+        assertEquals( "fourth pass", 2, result.length );
+        assertSame( field, result[ 0 ] );
+        assertSame( u3, result[ 1 ] );
+        assertEquals( "length fourth pass", data2.length, data3.length );
+
+        try
+        {
+            entry.removeExtraField( new ZipShort( 1 ) );
+            fail( "should be no such element" );
+        }
+        catch( final NoSuchElementException nse )
+        {
+        }
+    }
+
+    private UnrecognizedExtraField createExtraField()
+    {
+        UnrecognizedExtraField extraField = new UnrecognizedExtraField();
+        extraField.setHeaderID( new ZipShort( 1 ) );
+        extraField.setLocalFileDataData( new byte[ 0 ] );
+        return extraField;
+    }
+
+    private AsiExtraField createField()
+    {
+        final AsiExtraField field = new AsiExtraField();
+        field.setDirectory( true );
+        field.setMode( 0755 );
+        return field;
+    }
+}

Propchange: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/zip/ZipEntryTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/zip/ZipEntryTestCase.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/zip/ZipEntryTestCase.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/zip/ZipLongTestCase.java
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/zip/ZipLongTestCase.java?rev=427072&view=auto
==============================================================================
--- jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/zip/ZipLongTestCase.java (added)
+++ jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/zip/ZipLongTestCase.java Mon Jul 31 03:55:10 2006
@@ -0,0 +1,90 @@
+/*
+ * Copyright 2002,2004 The Apache Software Foundation.
+ * 
+ * Licensed 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.zip;
+
+import org.apache.commons.compress.archivers.zip.ZipLong;
+
+import junit.framework.TestCase;
+
+/**
+ * JUnit 3 testcases for org.apache.tools.zip.ZipLong.
+ *
+ * @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a>
+ */
+public class ZipLongTestCase
+    extends TestCase
+{
+
+    public ZipLongTestCase( final String name )
+    {
+        super( name );
+    }
+
+    /**
+     * Test conversion to bytes.
+     */
+    public void testToBytes()
+    {
+        final ZipLong zipLong = new ZipLong( 0x12345678 );
+        final byte[] result = zipLong.getBytes();
+        assertEquals( "length getBytes", 4, result.length );
+        assertEquals( "first byte getBytes", 0x78, result[ 0 ] );
+        assertEquals( "second byte getBytes", 0x56, result[ 1 ] );
+        assertEquals( "third byte getBytes", 0x34, result[ 2 ] );
+        assertEquals( "fourth byte getBytes", 0x12, result[ 3 ] );
+    }
+
+    /**
+     * Test conversion from bytes.
+     */
+    public void testFromBytes()
+    {
+        final byte[] value = new byte[]{0x78, 0x56, 0x34, 0x12};
+        final ZipLong zipLong = new ZipLong( value );
+        assertEquals( "value from bytes", 0x12345678, zipLong.getValue() );
+    }
+
+    /**
+     * Test the contract of the equals method.
+     */
+    public void testEquals()
+    {
+        final ZipLong zipLong1 = new ZipLong( 0x12345678 );
+        final ZipLong zipLong2 = new ZipLong( 0x12345678 );
+        final ZipLong zipLong3 = new ZipLong( 0x87654321 );
+
+        assertTrue( "reflexive", zipLong1.equals( zipLong1 ) );
+
+        assertTrue( "works", zipLong1.equals( zipLong2 ) );
+        assertTrue( "works, part two", !zipLong1.equals( zipLong3 ) );
+
+        assertTrue( "symmetric", zipLong2.equals( zipLong1 ) );
+
+        assertTrue( "null handling", !zipLong1.equals( null ) );
+        assertTrue( "non ZipLong handling", !zipLong1.equals( new Integer( 0x1234 ) ) );
+    }
+
+    /**
+     * Test sign handling.
+     */
+    public void testSign()
+    {
+        final ZipLong zipLong =
+            new ZipLong( new byte[]{(byte)0xFF, (byte)0xFF, (byte)0xFF, (byte)0xFF} );
+        assertEquals( 0x00000000FFFFFFFFl, zipLong.getValue() );
+    }
+}

Propchange: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/zip/ZipLongTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/zip/ZipLongTestCase.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/zip/ZipLongTestCase.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/zip/ZipShortTestCase.java
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/zip/ZipShortTestCase.java?rev=427072&view=auto
==============================================================================
--- jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/zip/ZipShortTestCase.java (added)
+++ jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/zip/ZipShortTestCase.java Mon Jul 31 03:55:10 2006
@@ -0,0 +1,86 @@
+/*
+ * Copyright 2002,2004 The Apache Software Foundation.
+ * 
+ * Licensed 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.zip;
+
+import org.apache.commons.compress.archivers.zip.ZipShort;
+
+import junit.framework.TestCase;
+
+/**
+ * JUnit 3 testcases for org.apache.tools.zip.ZipShort.
+ *
+ * @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a>
+ */
+public class ZipShortTestCase
+    extends TestCase
+{
+    public ZipShortTestCase( String name )
+    {
+        super( name );
+    }
+
+    /**
+     * Test conversion to bytes.
+     */
+    public void testToBytes()
+    {
+        final ZipShort zipShort = new ZipShort( 0x1234 );
+        byte[] result = zipShort.getBytes();
+        assertEquals( "length getBytes", 2, result.length );
+        assertEquals( "first byte getBytes", 0x34, result[ 0 ] );
+        assertEquals( "second byte getBytes", 0x12, result[ 1 ] );
+    }
+
+    /**
+     * Test conversion from bytes.
+     */
+    public void testFromBytes()
+    {
+        byte[] val = new byte[]{0x34, 0x12};
+        final ZipShort zipShort = new ZipShort( val );
+        assertEquals( "value from bytes", 0x1234, zipShort.getValue() );
+    }
+
+    /**
+     * Test the contract of the equals method.
+     */
+    public void testEquals()
+    {
+        final ZipShort zipShort = new ZipShort( 0x1234 );
+        final ZipShort zipShort2 = new ZipShort( 0x1234 );
+        final ZipShort zipShort3 = new ZipShort( 0x5678 );
+
+        assertTrue( "reflexive", zipShort.equals( zipShort ) );
+
+        assertTrue( "works", zipShort.equals( zipShort2 ) );
+        assertTrue( "works, part two", !zipShort.equals( zipShort3 ) );
+
+        assertTrue( "symmetric", zipShort2.equals( zipShort ) );
+
+        assertTrue( "null handling", !zipShort.equals( null ) );
+        assertTrue( "non ZipShort handling", !zipShort.equals( new Integer( 0x1234 ) ) );
+    }
+
+    /**
+     * Test sign handling.
+     */
+    public void testSign()
+    {
+        final ZipShort zipShort = new ZipShort( new byte[]{(byte)0xFF, (byte)0xFF} );
+        assertEquals( 0x0000FFFF, zipShort.getValue() );
+    }
+}

Propchange: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/zip/ZipShortTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/zip/ZipShortTestCase.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/archivers/zip/ZipShortTestCase.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/compressors/bzip2/BzipTestCase.java
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/compressors/bzip2/BzipTestCase.java?rev=427072&view=auto
==============================================================================
--- jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/compressors/bzip2/BzipTestCase.java (added)
+++ jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/compressors/bzip2/BzipTestCase.java Mon Jul 31 03:55:10 2006
@@ -0,0 +1,265 @@
+/*
+ * Copyright 2002,2004 The Apache Software Foundation.
+ * 
+ * Licensed 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.bzip2;
+
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import junit.framework.TestCase;
+
+import org.apache.commons.compress.CompressUtils;
+import org.apache.commons.compress.compressors.bzip2.BZip2InputStream;
+import org.apache.commons.compress.compressors.bzip2.BZip2OutputStream;
+
+/**
+ * A test the stress tested the BZip implementation to verify
+ * that it behaves correctly.
+ *
+ * @author <a href="mailto:peter@apache.org">Peter Donald</a>
+ * @version $Revision: 280140 $ $Date$
+ */
+public class BzipTestCase
+    extends TestCase
+{
+    private static final byte[] HEADER = new byte[]{(byte)'B', (byte)'Z'};
+
+    public BzipTestCase( final String name )
+    {
+        super( name );
+    }
+
+    public void testBzipOutputStream()
+        throws Exception
+    {
+        final InputStream input = getInputStream( "asf-logo-huge.tar" );
+        final File outputFile = getOutputFile( ".tar.bz2" );
+        final OutputStream output = new FileOutputStream( outputFile );
+        final BZip2OutputStream packedOutput = getPackedOutput( output );
+        CompressUtils.copy( input, packedOutput );
+        shutdownStream( input );
+        shutdownStream( packedOutput );
+        shutdownStream( output );
+        compareContents( "asf-logo-huge.tar.bz2", outputFile );
+        forceDelete( outputFile );
+    }
+
+    private void forceDelete( final File outputFile ) throws IOException
+    {
+        if( !outputFile.delete() )
+        {
+            final String message = "File " + outputFile + " unable to be deleted.";
+            throw new IOException( message );
+        }
+    }
+
+    public void testBzipInputStream()
+        throws Exception
+    {
+        final InputStream input = getInputStream( "asf-logo-huge.tar.bz2" );
+        final File outputFile = getOutputFile( ".tar" );
+        final OutputStream output = new FileOutputStream( outputFile );
+        final BZip2InputStream packedInput = getPackedInput( input );
+        CompressUtils.copy( packedInput, output );
+        shutdownStream( input );
+        shutdownStream( packedInput );
+        shutdownStream( output );
+        compareContents( "asf-logo-huge.tar", outputFile );
+        forceDelete( outputFile );
+    }
+
+    public void testCBZip2InputStreamClose()
+        throws Exception
+    {
+        final InputStream input = getInputStream( "asf-logo-huge.tar.bz2" );
+        final File outputFile = getOutputFile( ".tar.bz2" );
+        final OutputStream output = new FileOutputStream( outputFile );
+        CompressUtils.copy( input, output );
+        shutdownStream( input );
+        shutdownStream( output );
+        assertTrue( "Check output file exists." , outputFile.exists() );
+        final InputStream input2 = new FileInputStream( outputFile );
+        final InputStream packedInput = getPackedInput( input2 );
+        shutdownStream( packedInput );
+        try
+        {
+            input2.read();
+            assertTrue("Source input stream is still opened.", false);
+        } catch ( Exception e )
+        {
+            // Read closed stream.
+        }
+        forceDelete( outputFile );
+    }
+
+    /**
+     * Copy bytes from an <code>InputStream</code> to an <code>OutputStream</code>.
+     */
+    private void copy( final InputStream input,
+                       final OutputStream output )
+        throws IOException
+    {
+        final byte[] buffer = new byte[ 8024 ];
+        int n = 0;
+        while( -1 != ( n = input.read( buffer ) ) )
+        {
+            output.write( buffer, 0, n );
+        }
+    }
+
+    private void compareContents( final String initial, final File generated )
+        throws Exception
+    {
+        final InputStream input1 = getInputStream( initial );
+        final InputStream input2 = new FileInputStream( generated );
+        final boolean test = contentEquals( input1, input2 );
+        shutdownStream( input1 );
+        shutdownStream( input2 );
+        assertTrue( "Contents of " + initial + " matches generated version " + generated, test );
+    }
+
+    private BZip2InputStream getPackedInput( final InputStream input )
+        throws IOException
+    {
+        final int b1 = input.read();
+        final int b2 = input.read();
+        assertEquals( "Equal header byte1", b1, 'B' );
+        assertEquals( "Equal header byte2", b2, 'Z' );
+        return new BZip2InputStream( input );
+    }
+
+    private BZip2OutputStream getPackedOutput( final OutputStream output )
+        throws IOException
+    {
+        output.write( HEADER );
+        return new BZip2OutputStream( output );
+    }
+
+    private File getOutputFile( final String postfix )
+        throws IOException
+    {
+        final File cwd = new File( "." );
+        return File.createTempFile( "ant-test", postfix, cwd );
+    }
+
+    private InputStream getInputStream( final String resource )
+        throws Exception
+    {
+        final String filename =
+            "src" + File.separator + "test" + File.separator +
+            getClass().getName().replace( '.', File.separatorChar );
+        final String path = getPath( filename );
+        final File input = new File( path, resource );
+        return new FileInputStream( input );
+//        final ClassLoader loader = getClass().getClassLoader();
+//        return loader.getResourceAsStream( resource );
+    }
+
+    /**
+     * Compare the contents of two Streams to determine if they are equal or not.
+     *
+     * @param input1 the first stream
+     * @param input2 the second stream
+     * @return true if the content of the streams are equal or they both don't exist, false otherwise
+     */
+    private boolean contentEquals( final InputStream input1,
+                                   final InputStream input2 )
+        throws IOException
+    {
+        final InputStream bufferedInput1 = new BufferedInputStream( input1 );
+        final InputStream bufferedInput2 = new BufferedInputStream( input2 );
+
+        int ch = bufferedInput1.read();
+        while( -1 != ch )
+        {
+            final int ch2 = bufferedInput2.read();
+            if( ch != ch2 )
+            {
+                return false;
+            }
+            ch = bufferedInput1.read();
+        }
+
+        final int ch2 = bufferedInput2.read();
+        if( -1 != ch2 )
+        {
+            return false;
+        }
+        else
+        {
+            return true;
+        }
+    }
+
+    private String getPath( final String filepath )
+    {
+        final int index = filepath.lastIndexOf( File.separatorChar );
+        if( -1 == index )
+        {
+            return "";
+        }
+        else
+        {
+            return filepath.substring( 0, index );
+        }
+    }
+
+    /**
+     * Unconditionally close an <code>OutputStream</code>.
+     * Equivalent to {@link java.io.OutputStream#close()}, except any exceptions will be ignored.
+     * @param output A (possibly null) OutputStream
+     */
+    private static void shutdownStream( final OutputStream output )
+    {
+        if( null == output )
+        {
+            return;
+        }
+
+        try
+        {
+            output.close();
+        }
+        catch( final IOException ioe )
+        {
+        }
+    }
+
+    /**
+     * Unconditionally close an <code>InputStream</code>.
+     * Equivalent to {@link InputStream#close()}, except any exceptions will be ignored.
+     * @param input A (possibly null) InputStream
+     */
+    private static void shutdownStream( final InputStream input )
+    {
+        if( null == input )
+        {
+            return;
+        }
+
+        try
+        {
+            input.close();
+        }
+        catch( final IOException ioe )
+        {
+        }
+    }
+}

Propchange: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/compressors/bzip2/BzipTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/compressors/bzip2/BzipTestCase.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/compressors/bzip2/BzipTestCase.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/compressors/bzip2/asf-logo-huge.tar
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/compressors/bzip2/asf-logo-huge.tar?rev=427072&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/compressors/bzip2/asf-logo-huge.tar
------------------------------------------------------------------------------
    svn:executable = *

Propchange: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/compressors/bzip2/asf-logo-huge.tar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/compressors/bzip2/asf-logo-huge.tar.bz2
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/compressors/bzip2/asf-logo-huge.tar.bz2?rev=427072&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/compressors/bzip2/asf-logo-huge.tar.bz2
------------------------------------------------------------------------------
    svn:executable = *

Propchange: jakarta/commons/sandbox/compress/trunk/src/test/org/apache/commons/compress/compressors/bzip2/asf-logo-huge.tar.bz2
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: jakarta/commons/sandbox/compress/trunk/xdocs/navigation.xml
URL: http://svn.apache.org/viewvc/jakarta/commons/sandbox/compress/trunk/xdocs/navigation.xml?rev=427072&r1=427071&r2=427072&view=diff
==============================================================================
--- jakarta/commons/sandbox/compress/trunk/xdocs/navigation.xml (original)
+++ jakarta/commons/sandbox/compress/trunk/xdocs/navigation.xml Mon Jul 31 03:55:10 2006
@@ -14,33 +14,17 @@
    See the License for the specific language governing permissions and
    limitations under the License.
   -->
-<!DOCTYPE org.apache.commons.menus SYSTEM 'http://jakarta.apache.org/commons/build/maven-build.dtd'>
+<!DOCTYPE org.apache.commons.menus SYSTEM '../../commons-build/menus/menus.dtd'>
 <project name="Commons&#xA0;Compress">
   <title>Commons&#xA0;Compress</title>
   <body>
-
-    <links>
-      <item name="Apache"             href="http://www.apache.org"/>
-      <item name="Jakarta"            href="http://jakarta.apache.org"/>
-      <item name="Commons"            href="http://jakarta.apache.org/commons/"/>
-    </links>
-
     <menu name="Commons&#xA0;Compress">
-      <item name="Overview"           href="/index.html"/>
-      <item name="Download"           href="/downloads.html"/>
-      <item name="Javadoc"            href="apidocs/index.html"/>
-      <item name="Wiki"               href="http://wiki.apache.org/jakarta-commons/Compress"/>
+      <item name="Overview" href="/index.html"/>
+      <item name="Javadoc" href="apidocs/index.html"/>
+      <item name="Mailing lists" href="/mail-lists.html"/>
+      <item name="Team" href="/team-list.html"/>
+      <item name="SVN" href="http://svn.apache.org/viewcvs/jakarta/commons/sandbox/compress/"/>
     </menu>
-
-    <menu name="Development">
-      <item name="Mailing Lists"      href="/mail-lists.html"/>
-      <item name="Issue Tracking"     href="/issue-tracking.html"/>
-      <item name="Team"               href="/team-list.html"/>
-      <item name="Source Repository"  href="/cvs-usage.html"/>
-      <item name="Javadoc (latest)"   href="http://jakarta.apache.org/commons/chain/apidocs/"/>
-    </menu>
-
-    &commons;
-
+    &common-menus;
   </body>
 </project>



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org