public class DAVServlet
extends javax.servlet.http.HttpServlet
| Constructor and Description |
|---|
DAVServlet() |
| Modifier and Type | Method and Description |
|---|---|
protected static String |
decodeFromURL(String in)
Sugar-coating for URLDecoder.decode, used all over.
|
protected void |
doOptions(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Handler for HTTP OPTIONS method.
|
protected static boolean |
getAuthFromCookie(Context context,
javax.servlet.http.HttpServletRequest request)
Get Session Cookie.
|
protected static void |
putAuthCookie(Context context,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
boolean force)
Set a new cookie -- only bother if there is no existing cookie or it's at
least halfway stale, so you're not churning it..
|
protected void |
service(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
override service() to add DAV methods.
|
protected static boolean |
serviceInternal(String method,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Pass this request along to the appropriate resource and method.
|
doDelete, doGet, doHead, doPost, doPut, doTrace, getLastModified, serviceprotected static boolean getAuthFromCookie(Context context, javax.servlet.http.HttpServletRequest request) throws SQLException
DAVServlet rolls its own session cookie because the Servlet container's session cannot be constrained to use ONLY cookies and NOT URL-rewriting, and the latter would break the DAV protocol so we cannot use it. Since we really only need to cache the authenticated EPerson (an integer ID) anyway, it's easy enough so simply stuff that into a cookie.
Cookie format is:
{timestamp}!{epersonID}!{client-IP}!{MAC}
where timestamp and eperson are integers; client IP is dotted IP
notation, and MAC is the hex MD5 of the preceding fields plus the
"cookieSecret" string. The MAC ensures that the cookie was issued by this
servlet.
Look for authentication cookie and try to get a previously-authenticated EPerson from it if found. Also check the timestamp to be sure the cookie isn't "stale".
NOTE This is also used by the SOAP servlet.
context - -
set user in this contextrequest - -
HTTP request.SQLException - the SQL exceptionprotected static void putAuthCookie(Context context, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, boolean force)
context - -
get user from contextrequest - the requestresponse - the responseforce - the forceprotected void service(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException,
IOException
service in class javax.servlet.http.HttpServletrequest - the requestresponse - the responsejavax.servlet.ServletException - the servlet exceptionIOException - Signals that an I/O exception has occurred.protected static boolean serviceInternal(String method, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException
method - the methodrequest - the requestresponse - the responseIOException - Signals that an I/O exception has occurred.protected void doOptions(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException,
IOException
doOptions in class javax.servlet.http.HttpServletrequest - the requestresponse - the responsejavax.servlet.ServletException - the servlet exceptionIOException - Signals that an I/O exception has occurred.Copyright © 2015 DuraSpace. All Rights Reserved.