Package org.jasen.core

Examples of org.jasen.core.StandardParserData


    /*
     * (non-Javadoc)
     * @see org.jasen.interfaces.HTMLParser#parse(javax.mail.internet.MimeMessage, org.jasen.interfaces.JasenMessage, org.jasen.interfaces.MimeMessageTokenizer)
     */
    public ParserData parse(MimeMessage mm, JasenMessage message, MimeMessageTokenizer tokenizer) throws JasenException {
        StandardParserData parserData = (StandardParserData)super.parse(mm, message, tokenizer);
        parserData.setConcealedHtmlCount(getConcealedHtmlCount());
        parserData.setImageCount(getImageCount());
        parserData.setSrcCgiCount(getSrcCgiCount());
        parserData.setSrcPortCount(getSrcPortCount());
        parserData.setPorts(getUrlPorts());
        parserData.setFalseAnchorCount(getFalseAnchorCount());
        return parserData;
    }
View Full Code Here


        int count = 0;

        if(data instanceof StandardParserData) {

            StandardParserData spData = (StandardParserData)data;

            if(spData.getSrcPortCount() > 0 && spData.getPorts() != null) {

                String port = null;


                // Check against the list of known ports...
                for (int i = 0; i < spData.getPorts().size(); i++)
                {
                    port = (String)spData.getPorts().get(i);

                    if(Arrays.binarySearch(knownPorts, port) <= -1) {
                        // not a known port
                        count++;
                    }
View Full Code Here

        result.setMin(min);
        result.setMax(max);
        result.setThreshold(threshold);

        if(data instanceof StandardParserData) {
            StandardParserData spData = (StandardParserData)data;
            result.setPoints(spData.getFalseAnchorCount());
        }

        return result;
    }
View Full Code Here

   * @see org.jasen.interfaces.HTMLParser#parse(javax.mail.internet.MimeMessage, org.jasen.interfaces.JasenMessage, org.jasen.interfaces.MimeMessageTokenizer)
   */
    public ParserData parse(MimeMessage mm, JasenMessage message, MimeMessageTokenizer tokenizer) throws JasenException {
        String rawHtml = message.getHtmlPart();
        String rawText = message.getTextPart();
        StandardParserData parserData = new StandardParserData();

        if(rawHtml != null) {
            String htmlText = extractText(rawHtml);
            parserData.setHtmlAsText(htmlText);
            quit = false;
        }

        if(rawText != null) {
            String text = extractText(rawText);
            parserData.setTextParsed(text);
        }

        // Now, tokenize the html and text parts of the message
        parserData.setMessageTokens(tokenizer.tokenize(mm, message, parserData));

        return parserData;
    }
View Full Code Here

TOP

Related Classes of org.jasen.core.StandardParserData

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.