public abstract class AbstractWebdavServlet extends javax.servlet.http.HttpServlet implements DavConstants
AbstractWebdavServlet
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_AUTHENTICATE_HEADER
Default value for the 'WWW-Authenticate' header, that is set, if request
results in a
401 (Unauthorized)
error. |
static String |
INIT_PARAM_AUTHENTICATE_HEADER
Name of the optional init parameter that defines the value of the
'WWW-Authenticate' header.
|
static String |
INIT_PARAM_CREATE_ABSOLUTE_URI
Name of the 'createAbsoluteURI' init parameter that defines whether hrefs
should be created with a absolute URI or as absolute Path (ContextPath).
|
static String |
INIT_PARAM_CSRF_PROTECTION
Name of the parameter that specifies the configuration of the CSRF protection.
|
static String |
INIT_PARAM_MISSING_AUTH_MAPPING
the 'missing-auth-mapping' init parameter
|
creationDateFormat, DEPTH_0, DEPTH_1, DEPTH_INFINITY, DEPTH_INFINITY_S, HEADER_AUTHORIZATION, HEADER_CONTENT_LANGUAGE, HEADER_CONTENT_LENGTH, HEADER_CONTENT_TYPE, HEADER_DAV, HEADER_DEPTH, HEADER_DESTINATION, HEADER_ETAG, HEADER_IF, HEADER_LAST_MODIFIED, HEADER_LOCK_TOKEN, HEADER_OVERWRITE, HEADER_TIMEOUT, INFINITE_TIMEOUT, modificationDateFormat, NAMESPACE, OPAQUE_LOCK_TOKEN_PREFIX, PROPERTY_CREATIONDATE, PROPERTY_DISPLAYNAME, PROPERTY_GETCONTENTLANGUAGE, PROPERTY_GETCONTENTLENGTH, PROPERTY_GETCONTENTTYPE, PROPERTY_GETETAG, PROPERTY_GETLASTMODIFIED, PROPERTY_LOCKDISCOVERY, PROPERTY_RESOURCETYPE, PROPERTY_SOURCE, PROPERTY_SUPPORTEDLOCK, PROPFIND_ALL_PROP, PROPFIND_ALL_PROP_INCLUDE, PROPFIND_BY_PROPERTY, PROPFIND_PROPERTY_NAMES, TIMEOUT_INFINITE, UNDEFINED_TIME, UNDEFINED_TIMEOUT, XML_ACTIVELOCK, XML_ALLPROP, XML_COLLECTION, XML_DEPTH, XML_DST, XML_EXCLUSIVE, XML_HREF, XML_INCLUDE, XML_KEEPALIVE, XML_LINK, XML_LOCKENTRY, XML_LOCKINFO, XML_LOCKROOT, XML_LOCKSCOPE, XML_LOCKTOKEN, XML_LOCKTYPE, XML_MULTISTATUS, XML_OMIT, XML_OWNER, XML_PROP, XML_PROPERTYBEHAVIOR, XML_PROPERTYUPDATE, XML_PROPFIND, XML_PROPNAME, XML_PROPSTAT, XML_REMOVE, XML_RESPONSE, XML_RESPONSEDESCRIPTION, XML_SET, XML_SHARED, XML_SOURCE, XML_STATUS, XML_TIMEOUT, XML_WRITE
Constructor and Description |
---|
AbstractWebdavServlet() |
Modifier and Type | Method and Description |
---|---|
protected void |
doAcl(WebdavRequest request,
WebdavResponse response,
DavResource resource)
The ACL method
|
protected void |
doBaselineControl(WebdavRequest request,
WebdavResponse response,
DavResource resource)
The BASELINECONTROL method
|
protected void |
doBind(WebdavRequest request,
WebdavResponse response,
DavResource resource)
The BIND method
|
protected void |
doCheckin(WebdavRequest request,
WebdavResponse response,
DavResource resource)
The CHECKIN method
|
protected void |
doCheckout(WebdavRequest request,
WebdavResponse response,
DavResource resource)
The CHECKOUT method
|
protected void |
doCopy(WebdavRequest request,
WebdavResponse response,
DavResource resource)
The COPY method
|
protected void |
doDelete(WebdavRequest request,
WebdavResponse response,
DavResource resource)
The DELETE method
|
protected void |
doGet(WebdavRequest request,
WebdavResponse response,
DavResource resource)
The GET method
|
protected void |
doHead(WebdavRequest request,
WebdavResponse response,
DavResource resource)
The HEAD method
|
protected void |
doLabel(WebdavRequest request,
WebdavResponse response,
DavResource resource)
The LABEL method
|
protected void |
doLock(WebdavRequest request,
WebdavResponse response,
DavResource resource)
The LOCK method
|
protected void |
doMerge(WebdavRequest request,
WebdavResponse response,
DavResource resource)
The MERGE method
|
protected void |
doMkActivity(WebdavRequest request,
WebdavResponse response,
DavResource resource)
The MKACTIVITY method
|
protected void |
doMkCol(WebdavRequest request,
WebdavResponse response,
DavResource resource)
The MKCOL method
|
protected void |
doMkWorkspace(WebdavRequest request,
WebdavResponse response,
DavResource resource)
The MKWORKSPACE method
|
protected void |
doMove(WebdavRequest request,
WebdavResponse response,
DavResource resource)
The MOVE method
|
protected void |
doOptions(WebdavRequest request,
WebdavResponse response,
DavResource resource)
The OPTION method
|
protected void |
doOrderPatch(WebdavRequest request,
WebdavResponse response,
DavResource resource)
The ORDERPATCH method
|
protected void |
doPoll(WebdavRequest request,
WebdavResponse response,
DavResource resource)
The POLL method
|
protected void |
doPost(WebdavRequest request,
WebdavResponse response,
DavResource resource)
The POST method.
|
protected void |
doPropFind(WebdavRequest request,
WebdavResponse response,
DavResource resource)
The PROPFIND method
|
protected void |
doPropPatch(WebdavRequest request,
WebdavResponse response,
DavResource resource)
The PROPPATCH method
|
protected void |
doPut(WebdavRequest request,
WebdavResponse response,
DavResource resource)
The PUT method
|
protected void |
doRebind(WebdavRequest request,
WebdavResponse response,
DavResource resource)
The REBIND method
|
protected void |
doReport(WebdavRequest request,
WebdavResponse response,
DavResource resource)
The REPORT method
|
protected void |
doSearch(WebdavRequest request,
WebdavResponse response,
DavResource resource)
The SEARCH method
|
protected void |
doSubscribe(WebdavRequest request,
WebdavResponse response,
DavResource resource)
The SUBSCRIBE method
|
protected void |
doUnbind(WebdavRequest request,
WebdavResponse response,
DavResource resource)
The UNBIND method
|
protected void |
doUncheckout(WebdavRequest request,
WebdavResponse response,
DavResource resource)
The UNCHECKOUT method
|
protected void |
doUnlock(WebdavRequest request,
WebdavResponse response,
DavResource resource)
The UNLOCK method
|
protected void |
doUnsubscribe(WebdavRequest request,
WebdavResponse response,
DavResource resource)
The UNSUBSCRIBE method
|
protected void |
doUpdate(WebdavRequest request,
WebdavResponse response,
DavResource resource)
The UPDATE method
|
protected void |
doVersionControl(WebdavRequest request,
WebdavResponse response,
DavResource resource)
The VERSION-CONTROL method
|
protected boolean |
execute(WebdavRequest request,
WebdavResponse response,
int method,
DavResource resource)
Executes the respective method in the given webdav context
|
String |
getAuthenticateHeaderValue()
Returns the value of the 'WWW-Authenticate' header, that is returned in
case of 401 error: the value is retrireved from the corresponding init
param or defaults to
DEFAULT_AUTHENTICATE_HEADER . |
static List<String> |
getContentCodings(javax.servlet.http.HttpServletRequest request)
Obtain the (ordered!) list of content codings that have been used in the
request
|
abstract DavSessionProvider |
getDavSessionProvider()
Returns the
DavSessionProvider . |
protected InputContext |
getInputContext(DavServletRequest request,
InputStream in)
Return a new
InputContext used for adding resource members |
abstract DavLocatorFactory |
getLocatorFactory()
Returns the
DavLocatorFactory . |
protected OutputContext |
getOutputContext(DavServletResponse response,
OutputStream out)
Return a new
OutputContext used for spooling resource properties and
the resource content |
abstract DavResourceFactory |
getResourceFactory()
Returns the
DavResourceFactory . |
protected static String |
getSingletonField(javax.servlet.http.HttpServletRequest request,
String fieldName)
Get field value of a singleton field
|
void |
init() |
protected boolean |
isCreateAbsoluteURI()
Returns if a absolute URI should be created for hrefs.
|
protected abstract boolean |
isPreconditionValid(WebdavRequest request,
DavResource resource)
Checks if the precondition for this request and resource is valid.
|
protected void |
sendUnauthorized(WebdavRequest request,
WebdavResponse response,
DavException error)
Sets the "WWW-Authenticate" header and writes the appropriate error
to the given webdav response.
|
protected void |
service(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Service the given request.
|
abstract void |
setDavSessionProvider(DavSessionProvider davSessionProvider)
Returns the
DavSessionProvider . |
abstract void |
setLocatorFactory(DavLocatorFactory locatorFactory)
Sets the
DavLocatorFactory . |
abstract void |
setResourceFactory(DavResourceFactory resourceFactory)
Sets the
DavResourceFactory . |
protected int |
validateDestination(DavResource destResource,
WebdavRequest request,
boolean checkHeader)
Validate the given destination resource and return the proper status
code: Any return value greater/equal than
HttpServletResponse.SC_NO_CONTENT
indicates an error. |
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
public static final String INIT_PARAM_MISSING_AUTH_MAPPING
public static final String INIT_PARAM_AUTHENTICATE_HEADER
If the parameter is omitted the default value
"Basic Realm=Jackrabbit Webdav Server"
is used.
public static final String DEFAULT_AUTHENTICATE_HEADER
401 (Unauthorized)
error.public static final String INIT_PARAM_CSRF_PROTECTION
public static final String INIT_PARAM_CREATE_ABSOLUTE_URI
public void init() throws javax.servlet.ServletException
init
in class javax.servlet.GenericServlet
javax.servlet.ServletException
protected abstract boolean isPreconditionValid(WebdavRequest request, DavResource resource)
request
- resource
- public abstract DavSessionProvider getDavSessionProvider()
DavSessionProvider
.public abstract void setDavSessionProvider(DavSessionProvider davSessionProvider)
DavSessionProvider
.davSessionProvider
- public abstract DavLocatorFactory getLocatorFactory()
DavLocatorFactory
.public abstract void setLocatorFactory(DavLocatorFactory locatorFactory)
DavLocatorFactory
.locatorFactory
- public abstract DavResourceFactory getResourceFactory()
DavResourceFactory
.public abstract void setResourceFactory(DavResourceFactory resourceFactory)
DavResourceFactory
.resourceFactory
- public String getAuthenticateHeaderValue()
DEFAULT_AUTHENTICATE_HEADER
.DEFAULT_AUTHENTICATE_HEADER
.INIT_PARAM_AUTHENTICATE_HEADER
protected boolean isCreateAbsoluteURI()
protected void service(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException
service
in class javax.servlet.http.HttpServlet
request
- response
- javax.servlet.ServletException
IOException
protected void sendUnauthorized(WebdavRequest request, WebdavResponse response, DavException error) throws IOException
request
- The webdav request.response
- The webdav response.error
- The DavException that leads to the unauthorized response.IOException
protected boolean execute(WebdavRequest request, WebdavResponse response, int method, DavResource resource) throws javax.servlet.ServletException, IOException, DavException
request
- response
- method
- resource
- javax.servlet.ServletException
IOException
DavException
protected void doOptions(WebdavRequest request, WebdavResponse response, DavResource resource) throws IOException, DavException
request
- response
- resource
- IOException
DavException
protected void doHead(WebdavRequest request, WebdavResponse response, DavResource resource) throws IOException
request
- response
- resource
- IOException
protected void doGet(WebdavRequest request, WebdavResponse response, DavResource resource) throws IOException, DavException
request
- response
- resource
- IOException
DavException
protected void doPropFind(WebdavRequest request, WebdavResponse response, DavResource resource) throws IOException, DavException
request
- response
- resource
- IOException
DavException
protected void doPropPatch(WebdavRequest request, WebdavResponse response, DavResource resource) throws IOException, DavException
request
- response
- resource
- IOException
DavException
protected void doPost(WebdavRequest request, WebdavResponse response, DavResource resource) throws IOException, DavException
request
- response
- resource
- IOException
DavException
protected void doPut(WebdavRequest request, WebdavResponse response, DavResource resource) throws IOException, DavException
request
- response
- resource
- IOException
DavException
protected void doMkCol(WebdavRequest request, WebdavResponse response, DavResource resource) throws IOException, DavException
request
- response
- resource
- IOException
DavException
protected void doDelete(WebdavRequest request, WebdavResponse response, DavResource resource) throws IOException, DavException
request
- response
- resource
- IOException
DavException
protected void doCopy(WebdavRequest request, WebdavResponse response, DavResource resource) throws IOException, DavException
request
- response
- resource
- IOException
DavException
protected void doMove(WebdavRequest request, WebdavResponse response, DavResource resource) throws IOException, DavException
request
- response
- resource
- IOException
DavException
protected void doBind(WebdavRequest request, WebdavResponse response, DavResource resource) throws IOException, DavException
request
- response
- resource
- the collection resource to which a new member will be addedIOException
DavException
protected void doRebind(WebdavRequest request, WebdavResponse response, DavResource resource) throws IOException, DavException
request
- response
- resource
- the collection resource to which a new member will be addedIOException
DavException
protected void doUnbind(WebdavRequest request, WebdavResponse response, DavResource resource) throws IOException, DavException
request
- response
- resource
- the collection resource from which a member will be removedIOException
DavException
protected int validateDestination(DavResource destResource, WebdavRequest request, boolean checkHeader) throws DavException
HttpServletResponse.SC_NO_CONTENT
indicates an error.destResource
- destination resource to be validated.request
- checkHeader
- flag indicating if the destination header must be present.DavException
protected void doLock(WebdavRequest request, WebdavResponse response, DavResource resource) throws IOException, DavException
request
- response
- resource
- IOException
DavException
protected void doUnlock(WebdavRequest request, WebdavResponse response, DavResource resource) throws DavException
request
- response
- resource
- DavException
protected void doOrderPatch(WebdavRequest request, WebdavResponse response, DavResource resource) throws IOException, DavException
request
- response
- resource
- IOException
DavException
protected void doSubscribe(WebdavRequest request, WebdavResponse response, DavResource resource) throws IOException, DavException
request
- response
- resource
- IOException
DavException
protected void doUnsubscribe(WebdavRequest request, WebdavResponse response, DavResource resource) throws IOException, DavException
request
- response
- resource
- IOException
DavException
protected void doPoll(WebdavRequest request, WebdavResponse response, DavResource resource) throws IOException, DavException
request
- response
- resource
- IOException
DavException
protected void doVersionControl(WebdavRequest request, WebdavResponse response, DavResource resource) throws DavException, IOException
request
- response
- resource
- DavException
IOException
protected void doLabel(WebdavRequest request, WebdavResponse response, DavResource resource) throws DavException, IOException
request
- response
- resource
- DavException
IOException
protected void doReport(WebdavRequest request, WebdavResponse response, DavResource resource) throws DavException, IOException
request
- response
- resource
- DavException
IOException
protected void doCheckin(WebdavRequest request, WebdavResponse response, DavResource resource) throws DavException, IOException
request
- response
- resource
- DavException
IOException
protected void doCheckout(WebdavRequest request, WebdavResponse response, DavResource resource) throws DavException, IOException
request
- response
- resource
- DavException
IOException
protected void doUncheckout(WebdavRequest request, WebdavResponse response, DavResource resource) throws DavException, IOException
request
- response
- resource
- DavException
IOException
protected void doMerge(WebdavRequest request, WebdavResponse response, DavResource resource) throws DavException, IOException
request
- response
- resource
- DavException
IOException
protected void doUpdate(WebdavRequest request, WebdavResponse response, DavResource resource) throws DavException, IOException
request
- response
- resource
- DavException
IOException
protected void doMkWorkspace(WebdavRequest request, WebdavResponse response, DavResource resource) throws DavException, IOException
request
- response
- resource
- DavException
IOException
protected void doMkActivity(WebdavRequest request, WebdavResponse response, DavResource resource) throws DavException, IOException
request
- response
- resource
- DavException
IOException
protected void doBaselineControl(WebdavRequest request, WebdavResponse response, DavResource resource) throws DavException, IOException
request
- response
- resource
- DavException
IOException
protected void doSearch(WebdavRequest request, WebdavResponse response, DavResource resource) throws DavException, IOException
request
- response
- resource
- DavException
IOException
protected void doAcl(WebdavRequest request, WebdavResponse response, DavResource resource) throws DavException, IOException
request
- response
- resource
- DavException
IOException
protected InputContext getInputContext(DavServletRequest request, InputStream in)
InputContext
used for adding resource membersrequest
- in
- spoolResource(WebdavRequest, WebdavResponse, DavResource, boolean)
protected OutputContext getOutputContext(DavServletResponse response, OutputStream out)
OutputContext
used for spooling resource properties and
the resource contentresponse
- out
- doPut(WebdavRequest, WebdavResponse, DavResource)
,
doMkCol(WebdavRequest, WebdavResponse, DavResource)
public static List<String> getContentCodings(javax.servlet.http.HttpServletRequest request)
protected static String getSingletonField(javax.servlet.http.HttpServletRequest request, String fieldName)
request
- HTTP requestfieldName
- field namenull
when field not presentIllegalArgumentException
- when multiple field lines presentCopyright © 2004–2024 The Apache Software Foundation. All rights reserved.