/*
 * 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.tika.parser.pkg;

import java.io.IOException;
import java.io.InputStream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;

import org.apache.commons.io.input.CloseShieldInputStream;
import org.apache.tika.exception.TikaException;
import org.apache.tika.metadata.Metadata;
import org.apache.tika.sax.XHTMLContentHandler;
import org.xml.sax.ContentHandler;
import org.xml.sax.SAXException;

/**
 * Zip File Parser.
 */
public class ZipParser extends PackageParser {

    /**
     * Parses the given stream as a Zip file.
     */
    public void parse(
            InputStream stream, ContentHandler handler, Metadata metadata)
            throws IOException, TikaException, SAXException {
        metadata.set(Metadata.CONTENT_TYPE, "application/zip");

        XHTMLContentHandler xhtml = new XHTMLContentHandler(handler, metadata);
        xhtml.startDocument();

        // At the end we want to close the Zip stream to release any associated
        // resources, but the underlying document stream should not be closed
        ZipInputStream zip =
            new ZipInputStream(new CloseShieldInputStream(stream));
        try {
            ZipEntry entry = zip.getNextEntry();
            while (entry != null) {
                Metadata entrydata = new Metadata();
                entrydata.set(Metadata.RESOURCE_NAME_KEY, entry.getName());
                parseEntry(zip, xhtml, entrydata);
                entry = zip.getNextEntry();
            }
        } finally {
            zip.close();
        }

        xhtml.endDocument();
    }

}

@@ -892,63 +892,120 @@
 am;%0A
+%0A
 import 
-java.util.zip.ZipEntry;%0Aimport java.util
+org.apache.commons.compress.archivers.ArchiveEntry;%0Aimport org.apache.commons.compress.archivers
 .zip.Zip
 Inpu
@@ -1000,16 +1000,23 @@
 .zip.Zip
+Archive
 InputStr
@@ -1012,33 +1012,32 @@
 iveInputStream;%0A
-%0A
 import org.apach
@@ -1926,24 +1926,31 @@
 %0A        Zip
+Archive
 InputStream 
@@ -1974,16 +1974,23 @@
  new Zip
+Archive
 InputStr
@@ -2056,19 +2056,23 @@
         
-Zip
+Archive
 Entry en

Use commons-compress for parsing packages