// Path: apache-rat-core/src/main/java/org/apache/rat/document/impl/ArchiveEntryDocument.java
// public class ArchiveEntryDocument implements Document {
// 
//     private final byte[] contents;
//     private final String name;
// 
//     private final MetaData metaData = new MetaData();
// 
//     public ArchiveEntryDocument(File file, byte[] contents) throws RatException {
//         super();
//         name = DocumentImplUtils.toName(file);
//         this.contents = contents;
//     }
// 
//     public MetaData getMetaData() {
//         return metaData;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public InputStream inputStream() throws IOException {
//         return new ByteArrayInputStream(contents);
//     }
// 
//     public boolean isComposite() {
//         return DocumentImplUtils.isZipStream(new ByteArrayInputStream(contents));
//     }
// 
//     public Reader reader() throws IOException {
//         return new InputStreamReader(new ByteArrayInputStream(contents));
//     }
// 
// 
//     /**
//      * Representations suitable for logging.
//      * @return a <code>String</code> representation 
//      * of this object.
//      */
//     @Override
//     public String toString()
//     {
//         return "TarEntryDocument ( "
//             + "name = " + this.name + " "
//             + "metaData = " + this.metaData + " "
//             + " )";
//     }
// }


import org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream;
import org.apache.rat.api.Document;
import org.apache.rat.api.RatException;
import org.apache.rat.document.impl.ArchiveEntryDocument;
import org.apache.rat.report.IReportable;
import org.apache.rat.report.RatReport;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FilenameFilter;
import java.io.IOException;
import org.apache.commons.compress.archivers.ArchiveEntry;
import org.apache.commons.compress.archivers.ArchiveInputStream;
import org.apache.commons.compress.archivers.tar.TarArchiveInputStream;
import org.apache.commons.compress.archivers.zip.ZipArchiveInputStream;
import org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream;
                input = new TarArchiveInputStream(new GzipCompressorInputStream(new FileInputStream(file)));
            } catch (IOException e) {
                try {
                    input = new TarArchiveInputStream(new BZip2CompressorInputStream(new FileInputStream(file)));
                } catch (IOException e2) {
                    input = new ZipArchiveInputStream(new FileInputStream(file));
                }
            }

            ArchiveEntry entry = input.getNextEntry();
            while (entry != null) {
                File f = new File(entry.getName());
                byte[] contents = new byte[(int) entry.getSize()];
                int offset = 0;
                int length = contents.length;

                while (offset < entry.getSize()) {
                    int actualRead = input.read(contents, offset, length);
                    length -= actualRead;
                    offset += actualRead;
                }

                if (!entry.isDirectory() && isNotIgnored(f)) {
                    report(report, contents, f);
                }

                entry = input.getNextEntry();
            }

            input.close();
// Path: apache-rat-core/src/main/java/org/apache/rat/document/impl/ArchiveEntryDocument.java
// public class ArchiveEntryDocument implements Document {
// 
//     private final byte[] contents;
//     private final String name;
// 
//     private final MetaData metaData = new MetaData();
// 
//     public ArchiveEntryDocument(File file, byte[] contents) throws RatException {
//         super();
//         name = DocumentImplUtils.toName(file);
//         this.contents = contents;
//     }
// 
//     public MetaData getMetaData() {
//         return metaData;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public InputStream inputStream() throws IOException {
//         return new ByteArrayInputStream(contents);
//     }
// 
//     public boolean isComposite() {
//         return DocumentImplUtils.isZipStream(new ByteArrayInputStream(contents));
//     }
// 
//     public Reader reader() throws IOException {
//         return new InputStreamReader(new ByteArrayInputStream(contents));
//     }
// 
// 
//     /**
//      * Representations suitable for logging.
//      * @return a <code>String</code> representation 
//      * of this object.
//      */
//     @Override
//     public String toString()
//     {
//         return "TarEntryDocument ( "
//             + "name = " + this.name + " "
//             + "metaData = " + this.metaData + " "
//             + " )";
//     }
// }


// Path: apache-rat-core/src/main/java/org/apache/rat/walker/ArchiveWalker.java
import org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream;
import org.apache.rat.api.Document;
import org.apache.rat.api.RatException;
import org.apache.rat.document.impl.ArchiveEntryDocument;
import org.apache.rat.report.IReportable;
import org.apache.rat.report.RatReport;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FilenameFilter;
import java.io.IOException;
import org.apache.commons.compress.archivers.ArchiveEntry;
import org.apache.commons.compress.archivers.ArchiveInputStream;
import org.apache.commons.compress.archivers.tar.TarArchiveInputStream;
import org.apache.commons.compress.archivers.zip.ZipArchiveInputStream;
import org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream;

                input = new TarArchiveInputStream(new GzipCompressorInputStream(new FileInputStream(file)));
            } catch (IOException e) {
                try {
                    input = new TarArchiveInputStream(new BZip2CompressorInputStream(new FileInputStream(file)));
                } catch (IOException e2) {
                    input = new ZipArchiveInputStream(new FileInputStream(file));
                }
            }

            ArchiveEntry entry = input.getNextEntry();
            while (entry != null) {
                File f = new File(entry.getName());
                byte[] contents = new byte[(int) entry.getSize()];
                int offset = 0;
                int length = contents.length;

                while (offset < entry.getSize()) {
                    int actualRead = input.read(contents, offset, length);
                    length -= actualRead;
                    offset += actualRead;
                }

                if (!entry.isDirectory() && isNotIgnored(f)) {
                    report(report, contents, f);
                }

                entry = input.getNextEntry();
            }

            input.close();
        } catch (IOException e) {