Index: src/edu/ucsb/nceas/metacat/harvesterClient/Harvester.java
===================================================================
--- src/edu/ucsb/nceas/metacat/harvesterClient/Harvester.java	(revision 2383)
+++ src/edu/ucsb/nceas/metacat/harvesterClient/Harvester.java	(revision 2384)
@@ -27,7 +27,6 @@
 import com.oreilly.servlet.MailMessage;
 import edu.ucsb.nceas.utilities.Options;
 import java.io.File;
-import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.PrintStream;
 import java.sql.Connection;
@@ -63,6 +62,7 @@
   public static final String marker =
 "*****************************************************************************";
   public static Options options = null;
+  private static String schemaLocation = null;
    
 
   /* 
@@ -118,6 +118,10 @@
     Integer p;                               // Used in determining the period
     long startTime;                          // time that a harvest run starts
     boolean test = false;                    // Passed to loadOption()
+    
+    if (args[0] != null) {
+      schemaLocation = args[0];
+    }
 
     System.out.println(marker);
     System.out.println("Starting Harvester");
@@ -525,6 +529,11 @@
 
     for (int i = 0; i < harvestSiteScheduleList.size(); i++) {
       harvestSiteSchedule = (HarvestSiteSchedule)harvestSiteScheduleList.get(i);
+      
+      if (Harvester.schemaLocation != null) {
+        harvestSiteSchedule.setSchemaLocation(Harvester.schemaLocation);
+      }
+      
       harvestSiteSchedule.harvestDocumentList();
     }
   }
Index: src/edu/ucsb/nceas/metacat/harvesterClient/HarvesterServlet.java
===================================================================
--- src/edu/ucsb/nceas/metacat/harvesterClient/HarvesterServlet.java	(nonexistent)
+++ src/edu/ucsb/nceas/metacat/harvesterClient/HarvesterServlet.java	(revision 2384)
@@ -0,0 +1,82 @@
+/**
+ *  '$RCSfile$'
+ *  Copyright: 2004 University of New Mexico and the 
+ *             Regents of the University of California
+ *
+ *   '$Author$'
+ *     '$Date$'
+ * '$Revision$'
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+package edu.ucsb.nceas.metacat.harvesterClient;
+
+import javax.servlet.*;
+import javax.servlet.http.*;
+
+/**
+ * HarvesterServlet class allows Harvester to be run as a background
+ * process. This eliminates the need to run Harvester in a terminal window.
+ * To activate this servlet, uncomment the HarvesterServlet entry in the
+ * appropriate 'lib/web.xml.tomcat*' file.
+ * 
+ * @author costa
+ */
+public class HarvesterServlet extends HttpServlet implements Runnable {
+
+  Thread harvesterThread;                // background Harvester thread
+
+  /**
+   * Initializes the servlet by starting a separate thread in which to
+   * run the Harvester main program.
+   */
+  public void init() throws ServletException {
+    harvesterThread = new Thread(this);
+    harvesterThread.setPriority(Thread.MIN_PRIORITY);  // be a good citizen
+    harvesterThread.start();
+  }
+
+  
+  /**
+   * Runs the Harvester main program in a separate thread. First sleeps for
+   * 30 seconds to give Metacat a chance to fully initialize.
+   */
+  public void run() {
+      String[] args = new String[1];
+      String schemaLocation = "eml://ecoinformatics.org/harvestList " +
+       "http://cvs.ecoinformatics.org/cvs/cvsweb.cgi/~checkout~" +
+       "/metacat/lib/harvester/harvestList.xsd?rev=1.1&content-type=text" +
+       "/plain&only_with_tag=HEAD";
+      args[0] = schemaLocation;
+
+      try {
+        Thread.sleep(30000);    // Sleep 30 seconds before starting Harvester
+      }
+      catch (InterruptedException e) {
+        System.err.println("InterruptedException: " + e.getMessage());
+      }
+
+      Harvester.main(args);
+  }
+
+  
+  /**
+   * Stops the Harvester thread when the servlet shuts down.
+   */
+  public void destroy() {
+    harvesterThread.stop();
+  }
+}

Property changes on: src/edu/ucsb/nceas/metacat/harvesterClient/HarvesterServlet.java
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Revision
\ No newline at end of property
