Package org.apache.tika.parser.pkg.tar

Examples of org.apache.tika.parser.pkg.tar.TarInputStream


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

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

        xhtml.endDocument();
    }
View Full Code Here

TOP

Related Classes of org.apache.tika.parser.pkg.tar.TarInputStream

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.