|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.opencms.webdav.CmsWebdavServlet
public class CmsWebdavServlet
Servlet which adds support for WebDAV level 2.
Field Summary | |
---|---|
static java.lang.String |
AUTHORIZATION_BASIC_PREFIX
Basic authorization prefix constant. |
static int |
BUFFER_SIZE
Size of file transfer buffer in bytes. |
protected static java.text.DateFormat |
HTTP_DATE_FORMAT
Date format for the last modified date. |
protected static java.text.DateFormat |
ISO8601_FORMAT
Date format for the creation date. |
protected int |
m_input
The input buffer size to use when serving resources. |
protected static java.security.MessageDigest |
m_md5Helper
MD5 message digest provider. |
protected int |
m_output
The output buffer size to use when serving resources. |
protected static CmsMD5Encoder |
MD5_ENCODER
The MD5 helper object for this class. |
protected static java.lang.String |
METHOD_COPY
WebDAV method: COPY. |
protected static java.lang.String |
METHOD_DELETE
HTTP Method: DELETE. |
protected static java.lang.String |
METHOD_GET
HTTP Method: GET. |
protected static java.lang.String |
METHOD_HEAD
HTTP Method: HEAD. |
protected static java.lang.String |
METHOD_LOCK
WebDAV method: LOCK. |
protected static java.lang.String |
METHOD_MKCOL
WebDAV method: MKCOL. |
protected static java.lang.String |
METHOD_MOVE
WebDAV method: MOVE. |
protected static java.lang.String |
METHOD_OPTIONS
HTTP Method: OPTIONS. |
protected static java.lang.String |
METHOD_POST
HTTP Method: POST. |
protected static java.lang.String |
METHOD_PROPFIND
WebDAV method: PROPFIND. |
protected static java.lang.String |
METHOD_PROPPATCH
WebDAV method: PROPPATCH. |
protected static java.lang.String |
METHOD_PUT
HTTP Method: PUT. |
protected static java.lang.String |
METHOD_TRACE
HTTP Method: TRACE. |
protected static java.lang.String |
METHOD_UNLOCK
WebDAV method: UNLOCK. |
protected static java.lang.String |
MIME_SEPARATION
MIME multipart separation string. |
static java.lang.String |
SEPARATOR_CREDENTIALS
Credentials separator constant. |
protected static java.util.BitSet |
URL_SAFE_CHARS
Chars which are safe for urls. |
Constructor Summary | |
---|---|
CmsWebdavServlet()
|
Method Summary | |
---|---|
static org.dom4j.Element |
addElement(org.dom4j.Element parent,
java.lang.String name)
Adds an xml element to the given parent and sets the appropriate namespace and prefix. |
protected void |
copy(I_CmsRepositoryItem item,
java.io.InputStream is,
java.io.PrintWriter writer)
Copy the contents of the specified input stream to the specified output stream, and ensure that both streams are closed before returning (even in the face of an exception). |
protected void |
copy(I_CmsRepositoryItem item,
java.io.InputStream is,
javax.servlet.ServletOutputStream ostream)
Copy the contents of the specified input stream to the specified output stream, and ensure that both streams are closed before returning (even in the face of an exception). |
protected void |
copy(I_CmsRepositoryItem item,
java.io.PrintWriter writer,
CmsWebdavRange range)
Copy the contents of the specified input stream to the specified output stream, and ensure that both streams are closed before returning (even in the face of an exception). |
protected void |
copy(I_CmsRepositoryItem item,
java.io.PrintWriter writer,
java.util.Iterator ranges,
java.lang.String contentType)
Copy the contents of the specified input stream to the specified output stream, and ensure that both streams are closed before returning (even in the face of an exception). |
protected void |
copy(I_CmsRepositoryItem item,
javax.servlet.ServletOutputStream ostream,
CmsWebdavRange range)
Copy the contents of the specified input stream to the specified output stream, and ensure that both streams are closed before returning (even in the face of an exception). |
protected void |
copy(I_CmsRepositoryItem item,
javax.servlet.ServletOutputStream ostream,
java.util.Iterator ranges,
java.lang.String contentType)
Copy the contents of the specified input stream to the specified output stream, and ensure that both streams are closed before returning (even in the face of an exception). |
protected java.io.IOException |
copyRange(java.io.InputStream istream,
javax.servlet.ServletOutputStream ostream)
Copy the contents of the specified input stream to the specified output stream, and ensure that both streams are closed before returning (even in the face of an exception). |
protected java.io.IOException |
copyRange(java.io.InputStream istream,
javax.servlet.ServletOutputStream ostream,
long start,
long end)
Copy the contents of the specified input stream to the specified output stream, and ensure that both streams are closed before returning (even in the face of an exception). |
protected java.io.IOException |
copyRange(java.io.Reader reader,
java.io.PrintWriter writer)
Copy the contents of the specified input stream to the specified output stream, and ensure that both streams are closed before returning (even in the face of an exception). |
protected java.io.IOException |
copyRange(java.io.Reader reader,
java.io.PrintWriter writer,
long start,
long end)
Copy the contents of the specified input stream to the specified output stream, and ensure that both streams are closed before returning (even in the face of an exception). |
protected void |
doCopy(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Process a COPY WebDAV request for the specified resource. |
protected void |
doDelete(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Process a DELETE WebDAV request for the specified resource. |
protected void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Process a GET request for the specified resource. |
protected void |
doHead(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Process a HEAD request for the specified resource. |
protected void |
doLock(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Process a LOCK WebDAV request for the specified resource. |
protected void |
doMkcol(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Process a MKCOL WebDAV request for the specified resource. |
protected void |
doMove(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Process a MOVE WebDAV request for the specified resource. |
protected void |
doOptions(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Process a OPTIONS WebDAV request for the specified resource. |
protected void |
doPropfind(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Process a PROPFIND WebDAV request for the specified resource. |
protected void |
doProppatch(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Process a PROPPATCH WebDAV request for the specified resource. |
protected void |
doPut(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Process a POST request for the specified resource. |
protected void |
doUnlock(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Process a UNLOCK WebDAV request for the specified resource. |
protected java.io.File |
executePartialPut(javax.servlet.http.HttpServletRequest req,
CmsWebdavRange range,
java.lang.String path)
Handle a partial PUT. |
protected java.lang.String |
getETag(I_CmsRepositoryItem item)
Get the ETag associated with a file. |
void |
init()
Initialize this servlet. |
protected java.util.ArrayList |
parseRange(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
I_CmsRepositoryItem item)
Parse the range header. |
protected java.io.InputStream |
renderHtml(java.lang.String contextPath,
java.lang.String path)
Return an InputStream to an HTML representation of the contents of this directory. |
protected java.lang.String |
renderSize(long size)
Render the specified file size (in bytes). |
protected java.lang.String |
rewriteUrl(java.lang.String path)
URL rewriter. |
protected void |
serveResource(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
boolean content)
Serve the specified resource, optionally including the data content. |
protected void |
service(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Handles the special WebDAV methods. |
Methods inherited from class javax.servlet.http.HttpServlet |
---|
doPost, doTrace, getLastModified, 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 |
---|
public static final java.lang.String AUTHORIZATION_BASIC_PREFIX
public static final int BUFFER_SIZE
public static final java.lang.String SEPARATOR_CREDENTIALS
protected static final java.text.DateFormat HTTP_DATE_FORMAT
protected static final java.text.DateFormat ISO8601_FORMAT
protected static java.security.MessageDigest m_md5Helper
protected static final CmsMD5Encoder MD5_ENCODER
protected static final java.lang.String METHOD_COPY
protected static final java.lang.String METHOD_DELETE
protected static final java.lang.String METHOD_GET
protected static final java.lang.String METHOD_HEAD
protected static final java.lang.String METHOD_LOCK
protected static final java.lang.String METHOD_MKCOL
protected static final java.lang.String METHOD_MOVE
protected static final java.lang.String METHOD_OPTIONS
protected static final java.lang.String METHOD_POST
protected static final java.lang.String METHOD_PROPFIND
protected static final java.lang.String METHOD_PROPPATCH
protected static final java.lang.String METHOD_PUT
protected static final java.lang.String METHOD_TRACE
protected static final java.lang.String METHOD_UNLOCK
protected static final java.lang.String MIME_SEPARATION
protected static final java.util.BitSet URL_SAFE_CHARS
protected int m_input
protected int m_output
Constructor Detail |
---|
public CmsWebdavServlet()
Method Detail |
---|
public static org.dom4j.Element addElement(org.dom4j.Element parent, java.lang.String name)
parent
- the parent node to add the elementname
- the name of the new element
public void init() throws javax.servlet.ServletException
init
in class javax.servlet.GenericServlet
javax.servlet.ServletException
- if something goes wrongprotected void copy(I_CmsRepositoryItem item, java.io.InputStream is, java.io.PrintWriter writer) throws java.io.IOException
item
- the RepositoryItemis
- the input stream to copy fromwriter
- the writer to write to
java.io.IOException
- if an input/output error occursprotected void copy(I_CmsRepositoryItem item, java.io.InputStream is, javax.servlet.ServletOutputStream ostream) throws java.io.IOException
item
- the RepositoryItemis
- the input stream to copy fromostream
- the output stream to write to
java.io.IOException
- if an input/output error occursprotected void copy(I_CmsRepositoryItem item, java.io.PrintWriter writer, CmsWebdavRange range) throws java.io.IOException
item
- the RepositoryItemwriter
- the writer to write torange
- the range the client wants to retrieve
java.io.IOException
- if an input/output error occursprotected void copy(I_CmsRepositoryItem item, java.io.PrintWriter writer, java.util.Iterator ranges, java.lang.String contentType) throws java.io.IOException
item
- the RepositoryItemwriter
- the writer to write toranges
- iterator of the ranges the client wants to retrievecontentType
- the content type of the resource
java.io.IOException
- if an input/output error occursprotected void copy(I_CmsRepositoryItem item, javax.servlet.ServletOutputStream ostream, CmsWebdavRange range) throws java.io.IOException
item
- the RepositoryItemostream
- the output stream to write torange
- the range the client wants to retrieve
java.io.IOException
- if an input/output error occursprotected void copy(I_CmsRepositoryItem item, javax.servlet.ServletOutputStream ostream, java.util.Iterator ranges, java.lang.String contentType) throws java.io.IOException
item
- the RepositoryItemostream
- the output stream to write toranges
- iterator of the ranges the client wants to retrievecontentType
- the content type of the resource
java.io.IOException
- if an input/output error occursprotected java.io.IOException copyRange(java.io.InputStream istream, javax.servlet.ServletOutputStream ostream)
istream
- the input stream to read fromostream
- the output stream to write to
protected java.io.IOException copyRange(java.io.InputStream istream, javax.servlet.ServletOutputStream ostream, long start, long end)
istream
- the input stream to read fromostream
- the output stream to write tostart
- the start of the range which will be copiedend
- the end of the range which will be copied
protected java.io.IOException copyRange(java.io.Reader reader, java.io.PrintWriter writer)
reader
- the reader to read fromwriter
- the writer to write to
protected java.io.IOException copyRange(java.io.Reader reader, java.io.PrintWriter writer, long start, long end)
reader
- the reader to read fromwriter
- the writer to write tostart
- the start of the range which will be copiedend
- the end of the range which will be copied
protected void doCopy(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
req
- the servlet request we are processingresp
- the servlet response we are creatingprotected void doDelete(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws java.io.IOException
doDelete
in class javax.servlet.http.HttpServlet
req
- the servlet request we are processingresp
- the servlet response we are creating
java.io.IOException
- if an input/output error occursprotected void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.io.IOException
doGet
in class javax.servlet.http.HttpServlet
request
- the servlet request we are processingresponse
- the servlet response we are creating
java.io.IOException
- if an input/output error occursprotected void doHead(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.io.IOException
doHead
in class javax.servlet.http.HttpServlet
request
- the servlet request we are processingresponse
- the servlet response we are creating
java.io.IOException
- if an input/output error occursprotected void doLock(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws java.io.IOException
req
- the servlet request we are processingresp
- the servlet response we are creating
java.io.IOException
- if an input/output error occursprotected void doMkcol(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws java.io.IOException
req
- the servlet request we are processingresp
- the servlet response we are creating
java.io.IOException
- if an input/output error occursprotected void doMove(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
req
- the servlet request we are processingresp
- the servlet response we are creatingprotected void doOptions(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
doOptions
in class javax.servlet.http.HttpServlet
req
- the servlet request we are processingresp
- the servlet response we are creatingprotected void doPropfind(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws java.io.IOException
req
- the servlet request we are processingresp
- the servlet response we are creating
java.io.IOException
- if an input/output error occursprotected void doProppatch(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
Not implemented yet.
req
- the servlet request we are processingresp
- the servlet response we are creatingprotected void doPut(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws java.io.IOException
doPut
in class javax.servlet.http.HttpServlet
req
- the servlet request we are processingresp
- the servlet response we are creating
java.io.IOException
- if an input/output error occursprotected void doUnlock(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
req
- the servlet request we are processingresp
- the servlet response we are creatingprotected java.io.File executePartialPut(javax.servlet.http.HttpServletRequest req, CmsWebdavRange range, java.lang.String path) throws java.io.IOException
New content specified in request is appended to existing content in oldRevisionContent (if present). This code does not support simultaneous partial updates to the same resource.
req
- the servlet request we are processingrange
- the range of the content in the filepath
- the path where to find the resource
java.io.IOException
- if an input/output error occursprotected java.lang.String getETag(I_CmsRepositoryItem item)
item
- the WebDavItem
protected java.util.ArrayList parseRange(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, I_CmsRepositoryItem item)
request
- the servlet request we are processingresponse
- the servlet response we are creatingitem
- the WebdavItem with the information
protected java.io.InputStream renderHtml(java.lang.String contextPath, java.lang.String path) throws java.io.IOException
contextPath
- context path to which our internal paths are relativepath
- the path of the resource to render the html for
java.io.IOException
- if an input/output error occursprotected java.lang.String renderSize(long size)
size
- file size (in bytes)
protected java.lang.String rewriteUrl(java.lang.String path) throws java.io.UnsupportedEncodingException
path
- path which has to be rewritten
java.io.UnsupportedEncodingException
- if something goes wrong while encoding the urlprotected void serveResource(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, boolean content) throws java.io.IOException
request
- the servlet request we are processingresponse
- the servlet response we are creatingcontent
- should the content be included?
java.io.IOException
- if an input/output error occursprotected void service(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws javax.servlet.ServletException, java.io.IOException
service
in class javax.servlet.http.HttpServlet
req
- the servlet request we are processingresp
- the servlet response we are creating
java.io.IOException
- if an input/output error occurs
javax.servlet.ServletException
- if a servlet-specified error occurs
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |