[Htmlparser-cvs] htmlparser/src/org/htmlparser/parserapplications SiteCapturer.java,1.5,1.6
Brought to you by:
derrickoswald
From: Derrick O. <der...@us...> - 2004-07-29 01:50:28
|
Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/parserapplications In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9575/src/org/htmlparser/parserapplications Modified Files: SiteCapturer.java Log Message: Fix bug #998195 SiteCatpurer just crashed After EncodingChangeException try again with the encoding now set correctly. Index: SiteCapturer.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/parserapplications/SiteCapturer.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SiteCapturer.java 19 Jan 2004 23:14:18 -0000 1.5 --- SiteCapturer.java 29 Jul 2004 01:50:19 -0000 1.6 *************** *** 52,55 **** --- 52,56 ---- import org.htmlparser.tags.LinkTag; import org.htmlparser.tags.MetaTag; + import org.htmlparser.util.EncodingChangeException; import org.htmlparser.util.NodeIterator; import org.htmlparser.util.NodeList; *************** *** 439,445 **** // fetch the page and gather the list of nodes mParser.setURL (url); ! list = new NodeList (); ! for (NodeIterator e = mParser.elements (); e.hasMoreNodes (); ) ! list.add (e.nextNode ()); // URL conversion occurs in the tags // handle robots meta tag according to http://www.robotstxt.org/wc/meta-user.html --- 440,459 ---- // fetch the page and gather the list of nodes mParser.setURL (url); ! try ! { ! list = new NodeList (); ! for (NodeIterator e = mParser.elements (); e.hasMoreNodes (); ) ! list.add (e.nextNode ()); // URL conversion occurs in the tags ! } ! catch (EncodingChangeException ece) ! { ! // fix bug #998195 SiteCatpurer just crashed ! // try again with the encoding now set correctly ! // hopefully mPages, mImages, mCopied and mFinished won't be corrupted ! mParser.reset (); ! list = new NodeList (); ! for (NodeIterator e = mParser.elements (); e.hasMoreNodes (); ) ! list.add (e.nextNode ()); ! } // handle robots meta tag according to http://www.robotstxt.org/wc/meta-user.html |