org.sapia.filestorm.http
Class StoreServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.sapia.filestorm.http.StoreServlet
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig, Proto

public class StoreServlet
extends javax.servlet.http.HttpServlet
implements Proto

An instance of this class wraps a FileStore, delegating incoming put/get/delete HTTP requests to the instance.

This servlet takes the following initialization parameters:

Note that all above caching-related parameters are translated by this servlet in terms of the Cache-Control HTTP response header (see RFC2616).

Author:
yduchesne
See Also:
Serialized Form

Field Summary
static int DEFAULT_BUF_SIZE
           
static String HEADER_CACHE_CONTROL
           
static String HEADER_CONTENT_LENGTH
           
static String STORE_BASE_DIR
           
static String STORE_BUF_SIZE
           
static String STORE_CACHING_DELAY_HOURS
           
static String STORE_CACHING_DELAY_MINS
           
static String STORE_CACHING_DELAY_SECS
           
static String STORE_DELETE_ENABLED
           
static String STORE_PUT_ENABLED
           
 
Fields inherited from interface org.sapia.filestorm.http.Proto
HEADER_SAPIA_STORE_OP, OP_CONTAINS, OP_CONTENT_LEN, OP_LAST_MODIFIED, OP_LIST
 
Constructor Summary
StoreServlet()
           
 
Method Summary
 void destroy()
           
protected  void doDelete(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
           
protected  void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
           
protected  void doPut(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
           
 Store getStore()
           
 void init(javax.servlet.ServletConfig conf)
           
 
Methods inherited from class javax.servlet.http.HttpServlet
doHead, doOptions, doPost, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
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

STORE_BASE_DIR

public static final String STORE_BASE_DIR
See Also:
Constant Field Values

STORE_BUF_SIZE

public static final String STORE_BUF_SIZE
See Also:
Constant Field Values

STORE_CACHING_DELAY_SECS

public static final String STORE_CACHING_DELAY_SECS
See Also:
Constant Field Values

STORE_CACHING_DELAY_MINS

public static final String STORE_CACHING_DELAY_MINS
See Also:
Constant Field Values

STORE_CACHING_DELAY_HOURS

public static final String STORE_CACHING_DELAY_HOURS
See Also:
Constant Field Values

STORE_PUT_ENABLED

public static final String STORE_PUT_ENABLED
See Also:
Constant Field Values

STORE_DELETE_ENABLED

public static final String STORE_DELETE_ENABLED
See Also:
Constant Field Values

DEFAULT_BUF_SIZE

public static final int DEFAULT_BUF_SIZE
See Also:
Constant Field Values

HEADER_CACHE_CONTROL

public static final String HEADER_CACHE_CONTROL
See Also:
Constant Field Values

HEADER_CONTENT_LENGTH

public static final String HEADER_CONTENT_LENGTH
See Also:
Constant Field Values
Constructor Detail

StoreServlet

public StoreServlet()
Method Detail

init

public void init(javax.servlet.ServletConfig conf)
          throws javax.servlet.ServletException
Specified by:
init in interface javax.servlet.Servlet
Overrides:
init in class javax.servlet.GenericServlet
Throws:
javax.servlet.ServletException

destroy

public void destroy()
Specified by:
destroy in interface javax.servlet.Servlet
Overrides:
destroy in class javax.servlet.GenericServlet

getStore

public Store getStore()
Returns:
this instance's Store.

doGet

protected void doGet(javax.servlet.http.HttpServletRequest req,
                     javax.servlet.http.HttpServletResponse res)
              throws javax.servlet.ServletException,
                     IOException
Overrides:
doGet in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException
IOException

doPut

protected void doPut(javax.servlet.http.HttpServletRequest req,
                     javax.servlet.http.HttpServletResponse res)
              throws javax.servlet.ServletException,
                     IOException
Overrides:
doPut in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException
IOException

doDelete

protected void doDelete(javax.servlet.http.HttpServletRequest req,
                        javax.servlet.http.HttpServletResponse res)
                 throws javax.servlet.ServletException,
                        IOException
Overrides:
doDelete in class javax.servlet.http.HttpServlet
Throws:
javax.servlet.ServletException
IOException


Copyright © 2007 Sapia Open Community, Inc. All Rights Reserved.