Package net.sf.jpluck.handlers

Examples of net.sf.jpluck.handlers.ContentHandler


        try {
            if (!spider.isRunning()) {
                return;
            }
            spider.fireParsingStarted(resource.getURI());
            ContentHandler contentHandler = getContentHandler();
            if (contentHandler == null) {
                logger.warning(resource.getMimeType() + " content not handled.");
                return;
            }
            contentHandler.handle();
            String[] pageLinks = contentHandler.getPageLinks();
            for (int i = 0; i < pageLinks.length; i++) {
                String link = pageLinks[i];
                spider.retrieve(link, LinkFilter.EXTERNAL_LINK, resource.getLevel() + 1, resource.getURI());
            }
            String[] imageLinks = contentHandler.getImageLinks();
            for (int i = 0; i < imageLinks.length; i++) {
                String image = imageLinks[i];
                spider.retrieve(image, LinkFilter.EMBEDDED_IMAGE_LINK, resource.getLevel(), resource.getURI());
            }
        } catch (HandlingException e) {
View Full Code Here

TOP

Related Classes of net.sf.jpluck.handlers.ContentHandler

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.