Package org.jivesoftware.openfire.webdav
Class WebDAVLiteServlet
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- org.jivesoftware.openfire.webdav.WebDAVLiteServlet
-
- All Implemented Interfaces:
Serializable
,javax.servlet.Servlet
,javax.servlet.ServletConfig
public class WebDAVLiteServlet extends javax.servlet.http.HttpServlet
Implements a very light WebDAV-ish servlet for specific purposes. It does not support WebDAV extensions to the HTTP protocol. Instead, it supports the set of commands: GET, PUT, and DELETE. This serves as a WebDAV like storage interface for MUC shared files. It handles part of XEP-0129: WebDAV File Transfers, but not all of it. We don't handle the PROPPATCH command, for example, as the user has no rights to set the permissions on MUC shared files. TODO: How to handle a remote account? As posed in the WebDAV XEP, we should send a message and wait for response. TODO: How to handle SparkWeb? Reasking for a username and password would suck. Need some form of SSO. Maybe the SSO could be some special token provided during sign-on that the client could store and use for auth.- Author:
- Daniel Henninger
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description WebDAVLiteServlet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doDelete(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Handles a DELETE request for deleting files.protected void
doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Handles a GET request for files or for a file listing.protected void
doPut(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Handles a PUT request for uploading files.void
init(javax.servlet.ServletConfig servletConfig)
Initialize the WebDAV servlet, auto-creating it's file root if it doesn't exist.-
Methods inherited from class javax.servlet.http.HttpServlet
doHead, doOptions, doPost, doTrace, getLastModified, service, service
-
-
-
-
Method Detail
-
init
public void init(javax.servlet.ServletConfig servletConfig) throws javax.servlet.ServletException
Initialize the WebDAV servlet, auto-creating it's file root if it doesn't exist.- Specified by:
init
in interfacejavax.servlet.Servlet
- Overrides:
init
in classjavax.servlet.GenericServlet
- Parameters:
servletConfig
- Configuration settings of the servlet from web.xml.- Throws:
javax.servlet.ServletException
- If there was an exception setting up the servlet.
-
doGet
protected void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException
Handles a GET request for files or for a file listing.- Overrides:
doGet
in classjavax.servlet.http.HttpServlet
- Parameters:
request
- Object representing the HTTP request.response
- Object representing the HTTP response.- Throws:
javax.servlet.ServletException
- If there was a servlet related exception.IOException
- If there was an IO error while setting the error.
-
doPut
protected void doPut(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException
Handles a PUT request for uploading files.- Overrides:
doPut
in classjavax.servlet.http.HttpServlet
- Parameters:
request
- Object representing the HTTP request.response
- Object representing the HTTP response.- Throws:
javax.servlet.ServletException
- If there was a servlet related exception.IOException
- If there was an IO error while setting the error.
-
doDelete
protected void doDelete(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException
Handles a DELETE request for deleting files.- Overrides:
doDelete
in classjavax.servlet.http.HttpServlet
- Parameters:
request
- Object representing the HTTP request.response
- Object representing the HTTP response.- Throws:
javax.servlet.ServletException
- If there was a servlet related exception.IOException
- If there was an IO error while setting the error.
-
-