Index: src/plugin/urlfilter-regex/src/java/org/apache/nutch/net/RegexURLFilter.java
===================================================================
--- src/plugin/urlfilter-regex/src/java/org/apache/nutch/net/RegexURLFilter.java	(revision 367595)
+++ src/plugin/urlfilter-regex/src/java/org/apache/nutch/net/RegexURLFilter.java	(working copy)
@@ -21,6 +21,7 @@
 
 import org.apache.nutch.plugin.Extension;
 import org.apache.nutch.plugin.PluginRepository;
+import org.apache.nutch.plugin.PluginRuntimeException;
 
 import java.io.Reader;
 import java.io.FileReader;
@@ -54,25 +55,6 @@
 
   // read in attribute "file" of this plugin.
   private static String attributeFile = null;
-  static {
-    String pluginName = "urlfilter-regex";
-    Extension[] extensions = PluginRepository.getInstance()
-      .getExtensionPoint(URLFilter.class.getName()).getExtensions();
-    for (int i=0; i < extensions.length; i++) {
-      Extension extension = extensions[i];
-      if (extension.getDescriptor().getPluginId().equals(pluginName)) {
-        attributeFile = extension.getAttribute("file");
-        break;
-      }
-    }
-    if (attributeFile != null && attributeFile.trim().equals(""))
-      attributeFile = null;
-    if (attributeFile != null) {
-      LOG.info("Attribute \"file\" is defined for plugin "+pluginName+" as "+attributeFile);
-    } else {
-      //LOG.warning("Attribute \"file\" is not defined in plugin.xml for plugin "+pluginName);
-    }
-  }
 
   private static class Rule {
     public Pattern pattern;
@@ -82,18 +64,10 @@
 
   private List rules;
 
+  private NutchConf nutchConf;
+
+
   public RegexURLFilter() throws IOException, PatternSyntaxException {
-    String file = NutchConf.get().get("urlfilter.regex.file");
-    // attribute "file" takes precedence if defined
-    if (attributeFile != null)
-      file = attributeFile;
-    Reader reader = NutchConf.get().getConfResourceAsReader(file);
-
-    if (reader == null) {
-      LOG.severe("Can't find resource: " + file);
-    } else {
-      rules=readConfigurationFile(reader);
-    }
   }
 
   public RegexURLFilter(String filename)
@@ -124,7 +98,7 @@
   // where plus means go ahead and index it and minus means no.
   // 
 
-  private static List readConfigurationFile(Reader reader)
+  private List readConfigurationFile(Reader reader)
     throws IOException, PatternSyntaxException {
 
     BufferedReader in=new BufferedReader(reader);
@@ -179,4 +153,59 @@
     }
   }
 
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.nutch.util.NutchConfigurable#setConf(org.apache.nutch.util.NutchConf)
+     */
+    public void setConf(NutchConf conf) {
+        this.nutchConf = conf;
+        String pluginName = "urlfilter-regex";
+        Extension[] extensions = conf.getPluginRepository().getExtensionPoint(URLFilter.class.getName()).getExtensions();
+        for (int i=0; i < extensions.length; i++) {
+          Extension extension = extensions[i];
+          if (extension.getDescriptor().getPluginId().equals(pluginName)) {
+            attributeFile = extension.getAttribute("file");
+            break;
+          }
+        }
+        if (attributeFile != null && attributeFile.trim().equals(""))
+          attributeFile = null;
+        if (attributeFile != null) {
+          LOG.info("Attribute \"file\" is defined for plugin "+pluginName+" as "+attributeFile);
+        } else {
+          //LOG.warning("Attribute \"file\" is not defined in plugin.xml for plugin "+pluginName);
+        }
+        String file = conf.get("urlfilter.regex.file");
+        // attribute "file" takes precedence if defined
+        if (attributeFile != null)
+          file = attributeFile;
+        Reader reader = conf.getConfResourceAsReader(file);
+
+        if (reader == null) {
+          LOG.severe("Can't find resource: " + file);
+        } else {
+          try {
+            rules=readConfigurationFile(reader);
+        } catch (IOException e) {
+            LOG.severe(e.getMessage());
+            //TODO mb: throw Exception?
+            throw new RuntimeException(e.getMessage());
+        } catch (PatternSyntaxException e) {
+            LOG.severe(e.getMessage());
+//          TODO mb: throw Exception?
+            throw new RuntimeException(e.getMessage());
+        }
+        }
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.nutch.util.NutchConfigurable#getConf()
+     */
+    public NutchConf getConf() {
+        return this.nutchConf;
+    }
+
 }
