Index: other-projects/hathitrust/wcsa/vol-checker/COMPILE.sh
===================================================================
--- other-projects/hathitrust/wcsa/vol-checker/COMPILE.sh	(revision 31279)
+++ other-projects/hathitrust/wcsa/vol-checker/COMPILE.sh	(revision 31279)
@@ -0,0 +1,3 @@
+#!/bin.bash
+
+javac -cp jars/servlet-api.jar -d build/classes src/org/hathitrust/extractedfeatures/VolumeCheck.java 
Index: other-projects/hathitrust/wcsa/vol-checker/src/org/hathitrust/extractedfeatures/VolumeCheck.java
===================================================================
--- other-projects/hathitrust/wcsa/vol-checker/src/org/hathitrust/extractedfeatures/VolumeCheck.java	(revision 31279)
+++ other-projects/hathitrust/wcsa/vol-checker/src/org/hathitrust/extractedfeatures/VolumeCheck.java	(revision 31279)
@@ -0,0 +1,140 @@
+package org.hathitrust.extractedfeatures;
+
+import java.io.BufferedReader;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.HashMap;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * Servlet implementation class VolumeCheck
+ */
+@WebServlet("/VolumeCheck")
+public class VolumeCheck extends HttpServlet {
+	private static final long serialVersionUID = 1L;
+
+	protected static int HASHMAP_INIT_SIZE = 13800000;
+	protected static String DATA_DIR="D:/cygwin64/home/davidb/research/code-managed/hathitrust/wcsa/extracted-features-solr/trunk/solr-ingest";
+	protected static HashMap<String,Boolean> id_check_ = null;
+	
+    
+    public VolumeCheck() {
+    	if (id_check_ == null) {
+    		id_check_ = new HashMap<String,Boolean>(HASHMAP_INIT_SIZE);
+    		storeIDs(DATA_DIR + "/full-listing.txt");
+    	}
+    }
+
+    protected void storeIDs(String filename)
+    {    	
+    	try {
+    		FileReader fr = new FileReader(filename);
+    		BufferedReader br = new BufferedReader(fr);
+    		
+    		long line_num = 1;
+    	    String line;
+    	    System.err.println("Loading in volume IDS: " + filename);
+    	    
+    	    String opt_file_ext = ".json.bz2";
+	    	
+    	    while ((line = br.readLine()) != null) {
+    	    	
+    	    	String file_id = line.substring(line.lastIndexOf("/")+1);
+    	    	String id = null;
+    	    	if (file_id.endsWith(opt_file_ext)) {
+    	    		id = file_id.substring(0,file_id.lastIndexOf(opt_file_ext));
+    	    	}
+    	    	else {
+    	    		id = file_id;
+    	    	}
+    	    	
+    	    	id = id.replaceAll("\\+", ":").replaceAll("=", "/");
+    	    			 
+    	    	id_check_.put(id, true);
+    	    	
+    	    	if ((line_num % 100000) == 0) {
+    	    		System.err.println("sample id = " + id);
+    	    		System.err.println("Passed line: " + line_num);
+    	    	}
+    	    	line_num++;
+    	    	
+    	    }
+    	    
+    	    br.close();
+    	}
+    	catch (Exception e) {
+    		e.printStackTrace();
+    	}
+    	
+    }
+	/**
+	 * @see Servlet#init(ServletConfig)
+	 */
+	public void init(ServletConfig config) throws ServletException {
+		// currently everything we need to happen at start up can be done in the constructor
+	}
+
+	/**
+	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
+	 */
+	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+		PrintWriter pw = response.getWriter();
+		
+		String cgi_ids = request.getParameter("ids");
+		String cgi_id = request.getParameter("id");
+		
+		if (cgi_ids != null) {
+			response.setContentType("application/json");
+	
+			String[] ids = cgi_ids.split(",");
+		    int ids_len = ids.length;
+		    
+		    pw.append("{");
+			
+		    for (int i=0; i<ids_len; i++) {
+		    	String id = ids[i];
+		    	
+		    	Boolean exists = id_check_.get(id);
+		    	boolean status = (exists != null) ? exists : false;
+		    	
+		    	if (i>0) {
+		    		pw.append(",");
+		    	}
+		    	pw.append("\"" + id + "\":" + status );
+		    }
+		    pw.append("}");
+			
+		}
+		else if (cgi_id != null) {
+			response.setContentType("application/json");
+			
+			String id = cgi_id;
+			Boolean exists = id_check_.get(id);
+			boolean status = (exists != null) ? exists : false;
+			pw.append("{'" + id + "':" + status + "}");
+		}
+		else {
+
+			pw.append("General Info: Number of HTRC Volumes in check-list = " + id_check_.size());
+						
+		}
+		//pw.close();
+		
+	}
+
+	/**
+	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
+	 */
+	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+		doGet(request, response);
+	}
+
+}
