On 25/08/06, Michael Wechner <[EMAIL PROTECTED]> wrote:

>> Index: nutch-0.8/src/java/org/apache/nutch/searcher/NutchBean.java
>> ===================================================================
>> --- nutch-0.8/src/java/org/apache/nutch/searcher/NutchBean.java
>> (Revision 436787)
>> +++ nutch-0.8/src/java/org/apache/nutch/searcher/NutchBean.java
>> (Arbeitskopie)
>> @@ -95,6 +95,9 @@
>>         if (dir == null) {
>>             dir = new Path(this.conf.get("searcher.dir", "crawl"));
>>         }
>> +       if (!new java.io.File(dir.toString()).exists()) {
>> +            LOG.warn("No such directory: " + new java.io.File
>> (dir.toString()));
>> +        }
>>         Path servers = new Path(dir, "search-servers.txt");
>>         if (fs.exists(servers)) {
>>             if (LOG.isInfoEnabled())


Is this not what java.io.FileNotFoundException is for? In other words, in
addition to putting a log message, you should throw a FileNotFoundException
as well. You might also want to terminate the process altogether, as I see
no use in doing anything without a search directory. Another approach is to
throw an exception. The caller of the function then catches said exception
and generates the searcher.dir.
--
Cheers,
Hasan Diwan <[EMAIL PROTECTED]>
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Nutch-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nutch-developers

Reply via email to