/** * Creates a Parser object with the location of the resource (URL or file) * You would typically create a DefaultHTMLParserFeedback object and pass * it in. * @see #Parser(URLConnection,ParserFeedback) * @param resourceLocn Either the URL or the filename (autodetects). * A standard HTTP GET is performed to read the content of the URL. * @param feedback The HTMLParserFeedback object to use when information, * warning and error messages are produced. If <em>null</em> no feedback * is provided. * @throws ParserException If the URL is invalid. */ public Parser (String resourceLocn, ParserFeedback feedback) throws ParserException { this (getConnectionManager ().openConnection (resourceLocn), feedback); }
/** * Set the URL for this parser. * This method creates a new Lexer reading from the given URL. * Trying to set the url to null or an empty string is a no-op. * @param url The new URL for the parser. * @throws ParserException If the url is invalid or creation of the * underlying Lexer cannot be performed. * @exception ParserException if a problem occurs in connecting. * @see #getURL */ public void setURL (String url) throws ParserException { if ((null != url) && !"".equals (url)) setConnection (getConnectionManager ().openConnection (url)); }
/** * Set the URL for this parser. * This method creates a new Lexer reading from the given URL. * Trying to set the url to null or an empty string is a no-op. * @param url The new URL for the parser. * @throws ParserException If the url is invalid or creation of the * underlying Lexer cannot be performed. */ public void setURL (String url) throws ParserException { if ((null != url) && !"".equals (url)) setConnection (getConnectionManager ().openConnection (url)); }
getConnectionManager ().setMonitor (parser);
getConnectionManager ().setMonitor (parser); getConnectionManager ().setRedirectionProcessingEnabled (true); getConnectionManager ().setCookieProcessingEnabled (true); parser.setResource (args[0]); System.out.println (parser.parse (filter));
setLexer (new Lexer (new Page (resource))); else setLexer (new Lexer (getConnectionManager ().openConnection (resource)));