You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by vg...@apache.org on 2002/02/01 15:41:39 UTC
cvs commit: xml-cocoon2/src/java/org/apache/cocoon/components/crawler SimpleCocoonCrawlerImpl.java
vgritsenko 02/02/01 06:41:38
Modified: src/java/org/apache/cocoon/components/crawler
SimpleCocoonCrawlerImpl.java
Log:
Minor debug/formatting changes
Revision Changes Path
1.3 +18 -18 xml-cocoon2/src/java/org/apache/cocoon/components/crawler/SimpleCocoonCrawlerImpl.java
Index: SimpleCocoonCrawlerImpl.java
===================================================================
RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/crawler/SimpleCocoonCrawlerImpl.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- SimpleCocoonCrawlerImpl.java 23 Jan 2002 19:06:38 -0000 1.2
+++ SimpleCocoonCrawlerImpl.java 1 Feb 2002 14:41:38 -0000 1.3
@@ -13,7 +13,6 @@
import org.apache.avalon.framework.configuration.ConfigurationException;
import org.apache.avalon.framework.logger.AbstractLoggable;
import org.apache.avalon.framework.parameters.Parameters;
-import org.apache.avalon.framework.thread.ThreadSafe;
import org.apache.avalon.excalibur.pool.Recyclable;
@@ -40,10 +39,10 @@
* A simple cocoon crawler.
*
* @author <a href="mailto:berni_huber@a1.net">Bernhard Huber</a>
- * @version CVS $Id: SimpleCocoonCrawlerImpl.java,v 1.2 2002/01/23 19:06:38 vgritsenko Exp $
+ * @version CVS $Id: SimpleCocoonCrawlerImpl.java,v 1.3 2002/02/01 14:41:38 vgritsenko Exp $
*/
public class SimpleCocoonCrawlerImpl extends AbstractLoggable
- implements CocoonCrawler, Configurable, Disposable, Recyclable
+ implements CocoonCrawler, Configurable, Disposable, Recyclable
{
/**
@@ -206,10 +205,14 @@
this.includeCrawlingURL.add(new RE(tokenized_pattern));
}
} catch (RESyntaxException rese) {
- getLogger().error("Cannot create includeing regular-expression for " +
- pattern, rese);
+ getLogger().error("Cannot create including regular-expression for " +
+ pattern, rese);
}
}
+ } else {
+ if (getLogger().isDebugEnabled()) {
+ getLogger().debug("Include all URLs");
+ }
}
children = configuration.getChildren(EXCLUDE_CONFIG);
@@ -225,12 +228,15 @@
}
} catch (RESyntaxException rese) {
getLogger().error("Cannot create excluding regular-expression for " +
- pattern, rese);
+ pattern, rese);
}
}
} else {
excludeCrawlingURL = new HashSet();
setDefaultExcludeFromCrawling();
+ if (getLogger().isDebugEnabled()) {
+ getLogger().debug("Exclude default URLs only");
+ }
}
Configuration child;
@@ -487,11 +493,8 @@
* @since
*/
private boolean isExcludedURL(String url) {
- // by default include URL for crawling
+ // by default do not exclude URL for crawling
if (excludeCrawlingURL == null) {
- if (getLogger().isDebugEnabled()) {
- getLogger().debug("exclude no URL " + url);
- }
return false;
}
@@ -501,13 +504,13 @@
RE pattern = (RE) i.next();
if (pattern.match(s)) {
if (getLogger().isDebugEnabled()) {
- getLogger().debug("exclude URL " + url);
+ getLogger().debug("Excluded URL " + url);
}
return true;
}
}
if (getLogger().isDebugEnabled()) {
- getLogger().debug("exclude not URL " + url);
+ getLogger().debug("Not excluded URL " + url);
}
return false;
}
@@ -523,9 +526,6 @@
private boolean isIncludedURL(String url) {
// by default include URL for crawling
if (includeCrawlingURL == null) {
- if (getLogger().isDebugEnabled()) {
- getLogger().debug("include all URL " + url);
- }
return true;
}
@@ -535,13 +535,13 @@
RE pattern = (RE) i.next();
if (pattern.match(s)) {
if (getLogger().isDebugEnabled()) {
- getLogger().debug("include URL " + url);
+ getLogger().debug("Included URL " + url);
}
return true;
}
}
if (getLogger().isDebugEnabled()) {
- getLogger().debug("include not URL " + url);
+ getLogger().debug("Not included URL " + url);
}
return false;
}
@@ -555,7 +555,7 @@
* </p>
*
* @author <a href="mailto:berni_huber@a1.net>Bernhard Huber</a>
- * @version $Id: SimpleCocoonCrawlerImpl.java,v 1.2 2002/01/23 19:06:38 vgritsenko Exp $
+ * @version $Id: SimpleCocoonCrawlerImpl.java,v 1.3 2002/02/01 14:41:38 vgritsenko Exp $
*/
public static class CocoonCrawlerIterator implements Iterator
{
----------------------------------------------------------------------
In case of troubles, e-mail: webmaster@xml.apache.org
To unsubscribe, e-mail: cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org