Examples of ChmExtractor


Examples of org.apache.tika.parser.chm.core.ChmExtractor

    }

    public void parse(InputStream stream, ContentHandler handler,
            Metadata metadata, ParseContext context) throws IOException,
            SAXException, TikaException {
        ChmExtractor chmExtractor = new ChmExtractor(stream);

        // metadata
        metadata.set(Metadata.CONTENT_TYPE, "application/vnd.ms-htmlhelp");

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

        Iterator<DirectoryListingEntry> it =
                chmExtractor.getChmDirList().getDirectoryListingEntryList().iterator();
        while (it.hasNext()) {
            DirectoryListingEntry entry = it.next();
            if (entry.getName().endsWith(".html") || entry.getName().endsWith(".htm")) {
                xhtml.characters(extract(chmExtractor.extractChmEntry(entry)));
            }
        }

        xhtml.endDocument();
    }
View Full Code Here

Examples of org.apache.tika.parser.chm.core.ChmExtractor

public class TestChmExtractor {
    private ChmExtractor chmExtractor = null;

    @Before
    public void setUp() throws Exception {
        chmExtractor = new ChmExtractor(
                new ByteArrayInputStream(TestParameters.chmData));
    }
View Full Code Here

Examples of org.apache.tika.parser.chm.core.ChmExtractor

     * @throws TikaException
     * @throws IOException
     */
    public static CHMDocumentInformation load(InputStream is) throws TikaException, IOException {
        CHMDocumentInformation document = new CHMDocumentInformation();
        document.setChmExtractor(new ChmExtractor(is));
        return document;
    }
View Full Code Here

Examples of org.apache.tika.parser.chm.core.ChmExtractor

public class TestChmExtractor extends TestCase {
    private ChmExtractor chmExtractor = null;

    public void setUp() throws Exception {
        chmExtractor = new ChmExtractor(
                new ByteArrayInputStream(TestParameters.chmData));
    }
View Full Code Here

Examples of org.apache.tika.parser.chm.core.ChmExtractor

    }

    public void parse(InputStream stream, ContentHandler handler,
            Metadata metadata, ParseContext context) throws IOException,
            SAXException, TikaException {
        ChmExtractor chmExtractor = new ChmExtractor(stream);

        // metadata
        metadata.set(Metadata.CONTENT_TYPE, "application/vnd.ms-htmlhelp");

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

        for (DirectoryListingEntry entry : chmExtractor.getChmDirList().getDirectoryListingEntryList()) {
            if (entry.getName().endsWith(".html") || entry.getName().endsWith(".htm")) {
                xhtml.characters(extract(chmExtractor.extractChmEntry(entry)));
            }
        }

        xhtml.endDocument();
    }
View Full Code Here

Examples of org.apache.tika.parser.chm.core.ChmExtractor

public class TestChmExtractor {
    private ChmExtractor chmExtractor = null;

    @Before
    public void setUp() throws Exception {
        chmExtractor = new ChmExtractor(
                new ByteArrayInputStream(TestParameters.chmData));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.