org.sapia.filestorm.http
Class StoreServlet
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
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:
- store.basedir: the base directory of the
FileStore that
this instance will use. The value of this parameter can take variables
(using the ${var_name} notation) which will be interpolated at runtime with Java
system properties.
- store.bufsize: the size of the byte buffers that are used to perform
data transfer (defaults to 1024).
- store.response.caching.seconds: the number of seconds that response data should
be cached on the client-side.
- store.response.caching.minutes: the number of minutes that response data should
be cached on the client-side.
- store.response.caching.hours: the number of hours that response data should
be cached on the client-side.
- store.put.enabled: indicates if PUT requests will be allowed - "true" if yes,
otherwise set "false" (false by default).
- store.delete.enabled: indicates if DELETE requests will be allowed - "true" if yes,
otherwise set "false" (false by default).
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
|
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 |
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
StoreServlet
public StoreServlet()
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.