org.purl.sword.server
Class DepositServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.purl.sword.server.DepositServlet
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
Direct Known Subclasses:
AtomDocumentServlet

public class DepositServlet
extends javax.servlet.http.HttpServlet

DepositServlet

Author:
Stuart Lewis
See Also:
Serialized Form

Field Summary
protected  SWORDServer myRepository
          Sword repository
 
Constructor Summary
DepositServlet()
           
 
Method Summary
protected  boolean authenticateWithBasic()
          Utility method to decide if we are using HTTP Basic authentication
protected  void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Process the Get request.
protected  void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Process a post request.
protected static String getUrl(javax.servlet.http.HttpServletRequest req)
          Utility method to construct the URL called for this Servlet
protected  String getUsernamePassword(javax.servlet.http.HttpServletRequest request)
          Utility method to return the username and password (separated by a colon ':')
 void init()
          Initialise the servlet
protected  void makeErrorDocument(String errorURI, int status, String summary, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Utility method to construct a SWORDErrorDocumentTest
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myRepository

protected SWORDServer myRepository
Sword repository

Constructor Detail

DepositServlet

public DepositServlet()
Method Detail

init

public void init()
          throws javax.servlet.ServletException
Initialise the servlet

Overrides:
init in class javax.servlet.GenericServlet
Throws:
javax.servlet.ServletException

doGet

protected void doGet(javax.servlet.http.HttpServletRequest request,
                     javax.servlet.http.HttpServletResponse response)
              throws javax.servlet.ServletException,
                     IOException
Process the Get request. This will return an unimplemented response.

Overrides:
doGet in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException
IOException

doPost

protected void doPost(javax.servlet.http.HttpServletRequest request,
                      javax.servlet.http.HttpServletResponse response)
               throws javax.servlet.ServletException,
                      IOException
Process a post request.

Overrides:
doPost in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException
IOException

makeErrorDocument

protected void makeErrorDocument(String errorURI,
                                 int status,
                                 String summary,
                                 javax.servlet.http.HttpServletRequest request,
                                 javax.servlet.http.HttpServletResponse response)
                          throws IOException
Utility method to construct a SWORDErrorDocumentTest

Parameters:
errorURI - The error URI to pass
status - The HTTP status to return
summary - The textual description to give the user
request - The HttpServletRequest object
response - The HttpServletResponse to send the error document to
Throws:
IOException

getUsernamePassword

protected String getUsernamePassword(javax.servlet.http.HttpServletRequest request)
Utility method to return the username and password (separated by a colon ':')

Parameters:
request -
Returns:
The username and password combination

authenticateWithBasic

protected boolean authenticateWithBasic()
Utility method to decide if we are using HTTP Basic authentication

Returns:
if HTTP Basic authentication is in use or not

getUrl

protected static String getUrl(javax.servlet.http.HttpServletRequest req)
Utility method to construct the URL called for this Servlet

Parameters:
req - The request object
Returns:
The URL


Copyright © 2010 DuraSpace. All Rights Reserved.