public class WebdavRequestImpl extends java.lang.Object implements WebdavRequest, DavConstants
WebdavRequestImpl
...BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
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 |
---|
WebdavRequestImpl(HttpServletRequest httpRequest,
DavLocatorFactory factory)
Creates a new
DavServletRequest with the given parameters. |
WebdavRequestImpl(HttpServletRequest httpRequest,
DavLocatorFactory factory,
boolean createAbsoluteURI)
Creates a new
DavServletRequest with the given parameters. |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getAttribute(java.lang.String s) |
java.util.Enumeration<?> |
getAttributeNames() |
java.lang.String |
getAuthType() |
BindInfo |
getBindInfo()
Returns the
BindInfo present with the request |
java.lang.String |
getCharacterEncoding() |
int |
getContentLength() |
java.lang.String |
getContentType() |
java.lang.String |
getContextPath() |
Cookie[] |
getCookies() |
long |
getDateHeader(java.lang.String s) |
DavSession |
getDavSession()
Returns the
DavSession created for this request. |
int |
getDepth()
Return the integer representation of the given
Depth header . |
int |
getDepth(int defaultValue)
Returns the integer representation of the
Depth header or the given defaultValue, if the Depth header is missing. |
DavResourceLocator |
getDestinationLocator()
Parse the destination header field and return the path of the destination
resource.
|
java.lang.String |
getHeader(java.lang.String s) |
java.util.Enumeration<?> |
getHeaderNames() |
java.util.Enumeration<?> |
getHeaders(java.lang.String s) |
DavResourceLocator |
getHrefLocator(java.lang.String href)
Parse a href and return the path of the resource.
|
ServletInputStream |
getInputStream() |
int |
getIntHeader(java.lang.String s) |
java.lang.String |
getLabel()
Returns the Label header or
null |
LabelInfo |
getLabelInfo()
Return the request body as
LabelInfo object or null
if parsing the request body or the creation of the label info failed. |
java.lang.String |
getLocalAddr() |
java.util.Locale |
getLocale() |
java.util.Enumeration<?> |
getLocales() |
java.lang.String |
getLocalName() |
int |
getLocalPort() |
LockInfo |
getLockInfo()
LockInfo object encapsulating the information passed with a LOCK
request if the LOCK request body was valid. |
java.lang.String |
getLockToken()
Retrieve the lock token from the 'Lock-Token' header.
|
DavResourceLocator |
getMemberLocator(java.lang.String segment)
Returns the path of the member resource of the request resource which is identified by the segment parameter.
|
MergeInfo |
getMergeInfo()
Return the request body as
MergeInfo object or null
if the creation failed due to invalid format. |
java.lang.String |
getMethod() |
OptionsInfo |
getOptionsInfo()
Returns the
OptionsInfo present with the request or null . |
java.lang.String |
getOrderingType()
Returns the
Ordering-Type header . |
OrderPatch |
getOrderPatch()
Return a
OrderPatch object encapsulating the request body
of an ORDERPATCH request or null if the request body was
either missing or could not be parsed. |
java.lang.String |
getParameter(java.lang.String s) |
java.util.Map<?,?> |
getParameterMap() |
java.util.Enumeration<?> |
getParameterNames() |
java.lang.String[] |
getParameterValues(java.lang.String s) |
java.lang.String |
getPathInfo() |
java.lang.String |
getPathTranslated() |
long |
getPollTimeout()
Returns the
PollTimeout header
or 0 (zero) if no such header is present. |
Position |
getPosition()
Return a
Position object encapsulating the Position header field or null if no Position header is present
or does not contain a valid format. |
DavPropertyNameSet |
getPropFindProperties()
Returns the set of properties requested by the PROPFIND body or an
empty set if the
type is either 'allprop' or
'propname'. |
int |
getPropFindType()
Returns the type of PROPFIND as indicated by the request body.
|
java.util.List<? extends PropEntry> |
getPropPatchChangeList()
Return a
List of property change operations. |
java.lang.String |
getProtocol() |
java.lang.String |
getQueryString() |
java.io.BufferedReader |
getReader() |
java.lang.String |
getRealPath(java.lang.String s) |
RebindInfo |
getRebindInfo()
Returns the
RebindInfo present with the request |
java.lang.String |
getRemoteAddr() |
java.lang.String |
getRemoteHost() |
int |
getRemotePort() |
java.lang.String |
getRemoteUser() |
ReportInfo |
getReportInfo()
Returns the request body and the Depth header as
ReportInfo
object. |
RequestDispatcher |
getRequestDispatcher(java.lang.String s) |
org.w3c.dom.Document |
getRequestDocument()
Parse the Xml request body and return a
Document . |
java.lang.String |
getRequestedSessionId() |
DavResourceLocator |
getRequestLocator()
Return a
DavResourceLocator representing the request handle. |
java.lang.String |
getRequestURI() |
java.lang.StringBuffer |
getRequestURL() |
java.lang.String |
getScheme() |
java.lang.String |
getServerName() |
int |
getServerPort() |
java.lang.String |
getServletPath() |
HttpSession |
getSession() |
HttpSession |
getSession(boolean b) |
java.lang.String |
getSubscriptionId()
Return the
SubscriptionId header
or null if no such header is present. |
SubscriptionInfo |
getSubscriptionInfo()
Return a
SubscriptionInfo object representing the subscription
info present in the SUBSCRIBE request body or null if
retrieving the subscription info fails. |
long |
getTimeout()
Parse the Timeout header and return a long representing the value.
|
java.lang.String |
getTransactionId()
Retrieve the transaction id from the
TransactionId header . |
TransactionInfo |
getTransactionInfo()
Retrieve the 'transactioninfo' request body that must be included with
the UNLOCK request of a transaction lock.
|
UnbindInfo |
getUnbindInfo()
Returns the
UnbindInfo present with the request |
UpdateInfo |
getUpdateInfo()
Parses the UPDATE request body a build the corresponding
UpdateInfo
object. |
java.security.Principal |
getUserPrincipal() |
boolean |
isOverwrite()
Return true if the overwrite header does not inhibit overwriting.
|
boolean |
isRequestedSessionIdFromCookie() |
boolean |
isRequestedSessionIdFromUrl() |
boolean |
isRequestedSessionIdFromURL() |
boolean |
isRequestedSessionIdValid() |
boolean |
isSecure() |
boolean |
isUserInRole(java.lang.String s) |
boolean |
matchesIfHeader(DavResource resource)
Test if the if header matches the given resource.
|
boolean |
matchesIfHeader(java.lang.String href,
java.lang.String token,
java.lang.String eTag)
Returns true, if the
If header present
with the request matches to the given href, token and eTag. |
void |
removeAttribute(java.lang.String s) |
void |
setAttribute(java.lang.String s,
java.lang.Object o) |
void |
setCharacterEncoding(java.lang.String s) |
void |
setDavSession(DavSession session)
Sets the session field and adds all lock tokens present with either the
Lock-Token header or the If header to the given session object.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
authenticate, changeSessionId, getPart, getParts, login, logout, upgrade
getAsyncContext, getContentLengthLong, getDispatcherType, getServletContext, isAsyncStarted, isAsyncSupported, startAsync, startAsync
public WebdavRequestImpl(HttpServletRequest httpRequest, DavLocatorFactory factory)
DavServletRequest
with the given parameters.public WebdavRequestImpl(HttpServletRequest httpRequest, DavLocatorFactory factory, boolean createAbsoluteURI)
DavServletRequest
with the given parameters.httpRequest
- factory
- createAbsoluteURI
- defines if we must create a absolute URI. if false a absolute path will be createdpublic void setDavSession(DavSession session)
setDavSession
in interface DavServletRequest
session
- DavServletRequest.setDavSession(DavSession)
public DavSession getDavSession()
DavServletRequest
DavSession
created for this request.getDavSession
in interface DavServletRequest
DavServletRequest.getDavSession()
public DavResourceLocator getRequestLocator()
DavResourceLocator
representing the request handle.getRequestLocator
in interface DavServletRequest
DavServletRequest.getRequestLocator()
public DavResourceLocator getDestinationLocator() throws DavException
getDestinationLocator
in interface DavServletRequest
DavException
DavConstants.HEADER_DESTINATION
,
DavServletRequest.getDestinationLocator()
public DavResourceLocator getHrefLocator(java.lang.String href) throws DavException
getHrefLocator
in interface BindServletRequest
DavException
BindServletRequest.getHrefLocator(java.lang.String)
public DavResourceLocator getMemberLocator(java.lang.String segment)
getMemberLocator
in interface BindServletRequest
public boolean isOverwrite()
isOverwrite
in interface DavServletRequest
DavConstants.HEADER_OVERWRITE
,
DavServletRequest.isOverwrite()
public int getDepth(int defaultValue)
DavServletRequest
Depth header
or the given defaultValue, if the Depth header is missing.getDepth
in interface DavServletRequest
defaultValue
- to be returned if no Depth header is present.Depth header
or the given defaultValue.DavServletRequest.getDepth(int)
public int getDepth()
DavServletRequest
Depth header
. 'Infinity' is represented by DavConstants.DEPTH_INFINITY
.getDepth
in interface DavServletRequest
Depth header
.DavServletRequest.getDepth()
public long getTimeout()
DavConstants.UNDEFINED_TIMEOUT
is used as default value if no header
is available or if the parsing fails.getTimeout
in interface DavServletRequest
DavServletRequest.getTimeout()
,
TimeoutHeader.parse(javax.servlet.http.HttpServletRequest, long)
public java.lang.String getLockToken()
getLockToken
in interface DavServletRequest
java.lang.IllegalArgumentException
- If the value has not the correct format.DavConstants.HEADER_LOCK_TOKEN
,
DavServletRequest.getLockToken()
public org.w3c.dom.Document getRequestDocument() throws DavException
DavServletRequest
Document
.getRequestDocument
in interface DavServletRequest
null
if no request body is present.DavException
- If the request body cannot be parsed into an Xml
Document.DavServletRequest.getRequestDocument()
public int getPropFindType() throws DavException
getPropFindType
in interface DavServletRequest
allprops
DavException
- If the propfind type could not be determined due to
an invalid request body.DavServletRequest.getPropFindType()
public DavPropertyNameSet getPropFindProperties() throws DavException
type
is either 'allprop' or
'propname'.getPropFindProperties
in interface DavServletRequest
DavException
- In case of invalid request bodyDavServletRequest.getPropFindProperties()
public java.util.List<? extends PropEntry> getPropPatchChangeList() throws DavException
List
of property change operations. Each entry
is either of type DavPropertyName
, indicating a <remove>
operation, or of type DavProperty
, indicating a <set>
operation. Note that ordering is significant here.getPropPatchChangeList
in interface DavServletRequest
DavException
- In case of invalid request bodyDavServletRequest.getPropPatchChangeList()
public LockInfo getLockInfo() throws DavException
LockInfo
object encapsulating the information passed with a LOCK
request if the LOCK request body was valid. If the request body is
missing a 'refresh lock' request is assumed. The LockInfo
then only provides timeout and isDeep property and returns true on
LockInfo.isRefreshLock()
getLockInfo
in interface DavServletRequest
null
if an error occurred while
parsing the request body.DavException
- throws a 400 (Bad Request) DavException if a request
body is present but does not start with a DAV:lockinfo element. Note however,
that a non-existing request body is a valid request used to refresh
an existing lock.DavServletRequest.getLockInfo()
public boolean matchesIfHeader(DavResource resource)
resource href
and the token returned from an exclusive write lock present on
the resource.null
or if
the resource has not applied an exclusive write lock the preconditions are met.
If in contrast the lock applied to the given resource returns a
null
lock token (e.g. for security reasons) or a lock token
that does not match, the method will return false.matchesIfHeader
in interface DavServletRequest
resource
- Webdav resources being operated onDavServletRequest.matchesIfHeader(DavResource)
,
IfHeader.matches(String, String, String)
,
DavResource.hasLock(org.apache.jackrabbit.webdav.lock.Type, org.apache.jackrabbit.webdav.lock.Scope)
,
ActiveLock.getToken()
public boolean matchesIfHeader(java.lang.String href, java.lang.String token, java.lang.String eTag)
DavServletRequest
If header
present
with the request matches to the given href, token and eTag.matchesIfHeader
in interface DavServletRequest
DavServletRequest.matchesIfHeader(String, String, String)
,
IfHeader.matches(String, String, String)
public java.lang.String getTransactionId()
TransactionDavServletRequest
TransactionId header
.getTransactionId
in interface TransactionDavServletRequest
TransactionId header
or null
.TransactionDavServletRequest.getTransactionId()
public TransactionInfo getTransactionInfo() throws DavException
TransactionDavServletRequest
null
is returned.getTransactionInfo
in interface TransactionDavServletRequest
TransactionInfo
object encapsulating the 'transactioninfo'
Xml element present in the request body or null
if no
body is present or if it could not be parsed.DavException
- if an invalid request body is present.TransactionDavServletRequest.getTransactionInfo()
public java.lang.String getSubscriptionId()
ObservationDavServletRequest
SubscriptionId header
or null
if no such header is present.getSubscriptionId
in interface ObservationDavServletRequest
SubscriptionId header
ObservationDavServletRequest.getSubscriptionId()
public long getPollTimeout()
ObservationDavServletRequest
PollTimeout header
or 0 (zero) if no such header is present.getPollTimeout
in interface ObservationDavServletRequest
ObservationDavServletRequest.getPollTimeout()
public SubscriptionInfo getSubscriptionInfo() throws DavException
ObservationDavServletRequest
SubscriptionInfo
object representing the subscription
info present in the SUBSCRIBE request body or null
if
retrieving the subscription info fails.getSubscriptionInfo
in interface ObservationDavServletRequest
null
if the subscription info cannot be built.DavException
- if an invalid request body was encountered.ObservationDavServletRequest.getSubscriptionInfo()
public java.lang.String getOrderingType()
OrderingDavServletRequest
Ordering-Type header
.getOrderingType
in interface OrderingDavServletRequest
Ordering-Type header
.OrderingDavServletRequest.getOrderingType()
public Position getPosition()
OrderingDavServletRequest
Position
object encapsulating the Position header
field or null
if no Position header is present
or does not contain a valid format.getPosition
in interface OrderingDavServletRequest
Position
object encapsulating the Position header
OrderingDavServletRequest.getPosition()
public OrderPatch getOrderPatch() throws DavException
OrderingDavServletRequest
OrderPatch
object encapsulating the request body
of an ORDERPATCH request or null
if the request body was
either missing or could not be parsed.getOrderPatch
in interface OrderingDavServletRequest
OrderPatch
object representing the orderpatch request
body or null
if theDavException
OrderingDavServletRequest.getOrderPatch()
public java.lang.String getLabel()
DeltaVServletRequest
null
getLabel
in interface DeltaVServletRequest
null
DeltaVServletRequest.getLabel()
public LabelInfo getLabelInfo() throws DavException
DeltaVServletRequest
LabelInfo
object or null
if parsing the request body or the creation of the label info failed.getLabelInfo
in interface DeltaVServletRequest
LabelInfo
object or null
DavException
- in case of an invalid request bodyDeltaVServletRequest.getLabelInfo()
public MergeInfo getMergeInfo() throws DavException
DeltaVServletRequest
MergeInfo
object or null
if the creation failed due to invalid format.getMergeInfo
in interface DeltaVServletRequest
MergeInfo
object or null
DavException
- in case of an invalid request bodyDeltaVServletRequest.getMergeInfo()
public UpdateInfo getUpdateInfo() throws DavException
DeltaVServletRequest
UpdateInfo
object. If the request body is missing or does not of the required format
null
is returned.getUpdateInfo
in interface DeltaVServletRequest
null
DavException
- in case of an invalid request bodyDeltaVServletRequest.getUpdateInfo()
public ReportInfo getReportInfo() throws DavException
DeltaVServletRequest
ReportInfo
object. The default depth, if no Depth header
, is DavConstants.DEPTH_0
.
If the request body could not be parsed into an Element
null
is returned.getReportInfo
in interface DeltaVServletRequest
ReportInfo
or null
DavException
- in case of an invalid request bodyDeltaVServletRequest.getReportInfo()
public OptionsInfo getOptionsInfo() throws DavException
DeltaVServletRequest
OptionsInfo
present with the request or null
.getOptionsInfo
in interface DeltaVServletRequest
OptionsInfo
or null
DavException
- in case of an invalid request bodyDeltaVServletRequest.getOptionsInfo()
public RebindInfo getRebindInfo() throws DavException
BindServletRequest
RebindInfo
present with the requestgetRebindInfo
in interface BindServletRequest
RebindInfo
objectDavException
- in case of an invalid or missing request bodyBindServletRequest.getRebindInfo()
public UnbindInfo getUnbindInfo() throws DavException
BindServletRequest
UnbindInfo
present with the requestgetUnbindInfo
in interface BindServletRequest
UnbindInfo
objectDavException
- in case of an invalid or missing request bodyBindServletRequest.getUnbindInfo()
public BindInfo getBindInfo() throws DavException
BindServletRequest
BindInfo
present with the requestgetBindInfo
in interface BindServletRequest
BindInfo
objectDavException
- in case of an invalid or missing request bodyBindServletRequest.getBindInfo()
public java.lang.String getAuthType()
getAuthType
in interface HttpServletRequest
public Cookie[] getCookies()
getCookies
in interface HttpServletRequest
public long getDateHeader(java.lang.String s)
getDateHeader
in interface HttpServletRequest
public java.lang.String getHeader(java.lang.String s)
getHeader
in interface HttpServletRequest
public java.util.Enumeration<?> getHeaders(java.lang.String s)
getHeaders
in interface HttpServletRequest
public java.util.Enumeration<?> getHeaderNames()
getHeaderNames
in interface HttpServletRequest
public int getIntHeader(java.lang.String s)
getIntHeader
in interface HttpServletRequest
public java.lang.String getMethod()
getMethod
in interface HttpServletRequest
public java.lang.String getPathInfo()
getPathInfo
in interface HttpServletRequest
public java.lang.String getPathTranslated()
getPathTranslated
in interface HttpServletRequest
public java.lang.String getContextPath()
getContextPath
in interface HttpServletRequest
public java.lang.String getQueryString()
getQueryString
in interface HttpServletRequest
public java.lang.String getRemoteUser()
getRemoteUser
in interface HttpServletRequest
public boolean isUserInRole(java.lang.String s)
isUserInRole
in interface HttpServletRequest
public java.security.Principal getUserPrincipal()
getUserPrincipal
in interface HttpServletRequest
public java.lang.String getRequestedSessionId()
getRequestedSessionId
in interface HttpServletRequest
public java.lang.String getRequestURI()
getRequestURI
in interface HttpServletRequest
public java.lang.StringBuffer getRequestURL()
getRequestURL
in interface HttpServletRequest
public java.lang.String getServletPath()
getServletPath
in interface HttpServletRequest
public HttpSession getSession(boolean b)
getSession
in interface HttpServletRequest
public HttpSession getSession()
getSession
in interface HttpServletRequest
public boolean isRequestedSessionIdValid()
isRequestedSessionIdValid
in interface HttpServletRequest
public boolean isRequestedSessionIdFromCookie()
isRequestedSessionIdFromCookie
in interface HttpServletRequest
public boolean isRequestedSessionIdFromURL()
isRequestedSessionIdFromURL
in interface HttpServletRequest
public boolean isRequestedSessionIdFromUrl()
isRequestedSessionIdFromUrl
in interface HttpServletRequest
public java.lang.Object getAttribute(java.lang.String s)
getAttribute
in interface ServletRequest
public java.util.Enumeration<?> getAttributeNames()
getAttributeNames
in interface ServletRequest
public java.lang.String getCharacterEncoding()
getCharacterEncoding
in interface ServletRequest
public void setCharacterEncoding(java.lang.String s) throws java.io.UnsupportedEncodingException
setCharacterEncoding
in interface ServletRequest
java.io.UnsupportedEncodingException
public int getContentLength()
getContentLength
in interface ServletRequest
public java.lang.String getContentType()
getContentType
in interface ServletRequest
public ServletInputStream getInputStream() throws java.io.IOException
getInputStream
in interface ServletRequest
java.io.IOException
public java.lang.String getParameter(java.lang.String s)
getParameter
in interface ServletRequest
public java.util.Enumeration<?> getParameterNames()
getParameterNames
in interface ServletRequest
public java.lang.String[] getParameterValues(java.lang.String s)
getParameterValues
in interface ServletRequest
public java.util.Map<?,?> getParameterMap()
getParameterMap
in interface ServletRequest
public java.lang.String getProtocol()
getProtocol
in interface ServletRequest
public java.lang.String getScheme()
getScheme
in interface ServletRequest
public java.lang.String getServerName()
getServerName
in interface ServletRequest
public int getServerPort()
getServerPort
in interface ServletRequest
public java.io.BufferedReader getReader() throws java.io.IOException
getReader
in interface ServletRequest
java.io.IOException
public java.lang.String getRemoteAddr()
getRemoteAddr
in interface ServletRequest
public java.lang.String getRemoteHost()
getRemoteHost
in interface ServletRequest
public void setAttribute(java.lang.String s, java.lang.Object o)
setAttribute
in interface ServletRequest
public void removeAttribute(java.lang.String s)
removeAttribute
in interface ServletRequest
public java.util.Locale getLocale()
getLocale
in interface ServletRequest
public java.util.Enumeration<?> getLocales()
getLocales
in interface ServletRequest
public boolean isSecure()
isSecure
in interface ServletRequest
public RequestDispatcher getRequestDispatcher(java.lang.String s)
getRequestDispatcher
in interface ServletRequest
public java.lang.String getRealPath(java.lang.String s)
getRealPath
in interface ServletRequest
public int getRemotePort()
getRemotePort
in interface ServletRequest
public java.lang.String getLocalName()
getLocalName
in interface ServletRequest
public java.lang.String getLocalAddr()
getLocalAddr
in interface ServletRequest
public int getLocalPort()
getLocalPort
in interface ServletRequest
Copyright © 2010 - 2020 Adobe. All Rights Reserved