Package org.apache.jackrabbit.webdav
Interface DavServletRequest
-
- All Superinterfaces:
HttpServletRequest,ServletRequest
- All Known Subinterfaces:
DeltaVServletRequest,ObservationDavServletRequest,OrderingDavServletRequest,TransactionDavServletRequest,WebdavRequest
- All Known Implementing Classes:
WebdavRequestImpl
public interface DavServletRequest extends HttpServletRequest
DavServletRequestextends the HttpServletRequest by Webdav specific METHODS.
-
-
Field Summary
-
Fields inherited from interface javax.servlet.http.HttpServletRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DavSessiongetDavSession()Returns theDavSessioncreated for this request.intgetDepth()Return the integer representation of the givenDepth header.intgetDepth(int defaultValue)Returns the integer representation of theDepth headeror the given defaultValue, if the Depth header is missing.DavResourceLocatorgetDestinationLocator()Parse theDestination headerand return the locator of the correspondingresource.LockInfogetLockInfo()Return the parsed 'lockinfo' request body, theTimeout headerand theDepth headerof a LOCK request asLockInfoobject.java.lang.StringgetLockToken()Returns the token present in theLock-Token Headerornullif no such header is available.
Note: The 'Lock-Token' header is sent with UNLOCK requests and with lock responses only.DavPropertyNameSetgetPropFindProperties()Return the set of properties the client requested with a PROPFIND request or an empty set if the type of PROPFIND request wasDavConstants.PROPFIND_ALL_PROPorDavConstants.PROPFIND_PROPERTY_NAMES.intgetPropFindType()Return the type of PROPFIND request as indicated by the PROPFIND request body.java.util.List<? extends PropEntry>getPropPatchChangeList()Return aListof property change operations.org.w3c.dom.DocumentgetRequestDocument()Parse the Xml request body and return aDocument.DavResourceLocatorgetRequestLocator()Return the locator of the requestedresource.longgetTimeout()Return the timeout requested in theTimeout headeraslong.booleanisOverwrite()Returns true if theOverwrite headeris set to 'T' thus instructing the server to overwrite the state of a non-null destination resource during a COPY or MOVE.booleanmatchesIfHeader(java.lang.String href, java.lang.String token, java.lang.String eTag)Returns true, if theIf headerpresent with the request matches to the given href, token and eTag.booleanmatchesIfHeader(DavResource resource)Returns true, if theIf headerpresent with the request matches the given resource.voidsetDavSession(DavSession session)Sets theDavSessionto this request.-
Methods inherited from interface javax.servlet.http.HttpServletRequest
authenticate, changeSessionId, getAuthType, getContextPath, getCookies, getDateHeader, getHeader, getHeaderNames, getHeaders, getIntHeader, getMethod, getPart, getParts, getPathInfo, getPathTranslated, getQueryString, getRemoteUser, getRequestedSessionId, getRequestURI, getRequestURL, getServletPath, getSession, getSession, getUserPrincipal, isRequestedSessionIdFromCookie, isRequestedSessionIdFromUrl, isRequestedSessionIdFromURL, isRequestedSessionIdValid, isUserInRole, login, logout, upgrade
-
Methods inherited from interface javax.servlet.ServletRequest
getAsyncContext, getAttribute, getAttributeNames, getCharacterEncoding, getContentLength, getContentLengthLong, getContentType, getDispatcherType, getInputStream, getLocalAddr, getLocale, getLocales, getLocalName, getLocalPort, getParameter, getParameterMap, getParameterNames, getParameterValues, getProtocol, getReader, getRealPath, getRemoteAddr, getRemoteHost, getRemotePort, getRequestDispatcher, getScheme, getServerName, getServerPort, getServletContext, isAsyncStarted, isAsyncSupported, isSecure, removeAttribute, setAttribute, setCharacterEncoding, startAsync, startAsync
-
-
-
-
Method Detail
-
setDavSession
void setDavSession(DavSession session)
Sets theDavSessionto this request.- Parameters:
session-
-
getDavSession
DavSession getDavSession()
Returns theDavSessioncreated for this request.- Returns:
- session for this resource
-
getRequestLocator
DavResourceLocator getRequestLocator()
Return the locator of the requestedresource.- Returns:
- locator of the requested
resource.
-
getDestinationLocator
DavResourceLocator getDestinationLocator() throws DavException
Parse theDestination headerand return the locator of the correspondingresource.- Returns:
- locator of the resource specified with the Destination header.
- Throws:
DavException- See Also:
DavConstants.HEADER_DESTINATION
-
isOverwrite
boolean isOverwrite()
Returns true if theOverwrite headeris set to 'T' thus instructing the server to overwrite the state of a non-null destination resource during a COPY or MOVE. A Overwrite header value of 'F' will return false.- Returns:
- true if the Overwrite header is set to 'T', false if it is set to 'F'.
- See Also:
DavConstants.HEADER_OVERWRITE
-
getDepth
int getDepth()
Return the integer representation of the givenDepth header. 'Infinity' is represented byDavConstants.DEPTH_INFINITY.- Returns:
- integer representation of the
Depth header. - See Also:
DavConstants.HEADER_DEPTH
-
getDepth
int getDepth(int defaultValue)
Returns the integer representation of theDepth headeror the given defaultValue, if the Depth header is missing.- Parameters:
defaultValue- to be returned if no Depth header is present.- Returns:
- integer representation of the
Depth headeror the given defaultValue. - See Also:
DavConstants.HEADER_DEPTH
-
getLockToken
java.lang.String getLockToken()
Returns the token present in theLock-Token Headerornullif no such header is available.
Note: The 'Lock-Token' header is sent with UNLOCK requests and with lock responses only. For any other request that may be affected by a lock the 'If' header field is responsible.- Returns:
- the token present in the Lock-Token header.
- See Also:
DavConstants.HEADER_LOCK_TOKEN
-
getTimeout
long getTimeout()
Return the timeout requested in theTimeout headeraslong. The representation of the 'Infinite' timeout is left to the implementation.- Returns:
- long value representation of the Timeout header.
- See Also:
DavConstants.HEADER_TIMEOUT,DavConstants.TIMEOUT_INFINITE
-
getRequestDocument
org.w3c.dom.Document getRequestDocument() throws DavExceptionParse the Xml request body and return aDocument.- Returns:
- Document representing the Xml request body or
nullif no request body is present. - Throws:
DavException- If the request body cannot be parsed into an Xml Document.
-
getPropFindType
int getPropFindType() throws DavExceptionReturn the type of PROPFIND request as indicated by the PROPFIND request body.- Returns:
- type of PROPFIND request
- Throws:
DavException- If the propfind type could not be determined due to an invalid request body.- See Also:
DavConstants.PROPFIND_ALL_PROP,DavConstants.PROPFIND_BY_PROPERTY,DavConstants.PROPFIND_PROPERTY_NAMES,DavConstants.PROPFIND_ALL_PROP_INCLUDE
-
getPropFindProperties
DavPropertyNameSet getPropFindProperties() throws DavException
Return the set of properties the client requested with a PROPFIND request or an empty set if the type of PROPFIND request wasDavConstants.PROPFIND_ALL_PROPorDavConstants.PROPFIND_PROPERTY_NAMES.- Returns:
- set of properties the client requested with a PROPFIND request
- Throws:
DavException- In case of invalid request body
-
getPropPatchChangeList
java.util.List<? extends PropEntry> getPropPatchChangeList() throws DavException
Return aListof property change operations. Each entry is either of typeDavPropertyName, indicating a <remove> operation, or of typeDavProperty, indicating a <set> operation. Note that ordering is significant here.- Returns:
Listof property change operations- Throws:
DavException- In case of invalid request body
-
getLockInfo
LockInfo getLockInfo() throws DavException
Return the parsed 'lockinfo' request body, theTimeout headerand theDepth headerof a LOCK request asLockInfoobject.- Returns:
LockInfoobject encapsulating the information present in the LOCK request.- Throws:
DavException- See Also:
DavConstants.HEADER_TIMEOUT,DavConstants.HEADER_DEPTH,DavConstants.XML_LOCKINFO
-
matchesIfHeader
boolean matchesIfHeader(DavResource resource)
Returns true, if theIf headerpresent with the request matches the given resource.- Parameters:
resource-- Returns:
- true, if the test is successful, false otherwise.
-
matchesIfHeader
boolean matchesIfHeader(java.lang.String href, java.lang.String token, java.lang.String eTag)Returns true, if theIf headerpresent with the request matches to the given href, token and eTag.- Parameters:
href-token-eTag-- Returns:
- true, if the test is successful, false otherwise.
-
-