org.matalon.pagerankhits.servlet
Class UploadVectorServlet

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended byorg.matalon.pagerankhits.servlet.UploadVectorServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class UploadVectorServlet
extends javax.servlet.http.HttpServlet

This servlet is responsible for uploading the result vector(s) to the server.

Author:
Yonatan Matalon
See Also:
Serialized Form

Field Summary
private static long serialVersionUID
           
 
Fields inherited from class javax.servlet.http.HttpServlet
 
Fields inherited from class javax.servlet.GenericServlet
 
Constructor Summary
UploadVectorServlet()
           
 
Method Summary
private  void handleResultVector(java.lang.String resultVector, java.lang.String resultsOutputFile)
          Parses and extracts the given result vector stream into 2 maps.
static void main(java.lang.String[] args)
          Tests UploadVectorServlet's functionality.
protected  void service(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

UploadVectorServlet

public UploadVectorServlet()
Method Detail

service

protected void service(javax.servlet.http.HttpServletRequest request,
                       javax.servlet.http.HttpServletResponse response)
                throws javax.servlet.ServletException,
                       java.io.IOException
Throws:
javax.servlet.ServletException
java.io.IOException

handleResultVector

private void handleResultVector(java.lang.String resultVector,
                                java.lang.String resultsOutputFile)
                         throws java.io.FileNotFoundException,
                                java.io.IOException
Parses and extracts the given result vector stream into 2 maps. The first map maps from the URL of the page to its rank, and the second map maps from a rank to URL(s) having this rank. These maps are saved as 2 java.util.Map Objects to the given resultsOutputFile.

Parameters:
resultVector -
resultsOutputFile -
Throws:
java.io.FileNotFoundException - - Thrown if the given resultsOutputFile was not found.
java.io.IOException

main

public static void main(java.lang.String[] args)
Tests UploadVectorServlet's functionality.

Parameters:
args -