Class BaseDavRequest
- java.lang.Object
-
- org.apache.http.message.AbstractHttpMessage
-
- org.apache.http.client.methods.AbstractExecutionAwareRequest
-
- org.apache.http.client.methods.HttpRequestBase
-
- org.apache.http.client.methods.HttpEntityEnclosingRequestBase
-
- org.apache.jackrabbit.webdav.client.methods.BaseDavRequest
-
- All Implemented Interfaces:
java.lang.Cloneable
,AbortableHttpRequest
,Configurable
,HttpExecutionAware
,HttpUriRequest
,HttpEntityEnclosingRequest
,HttpMessage
,HttpRequest
- Direct Known Subclasses:
HttpBind
,HttpCheckin
,HttpCheckout
,HttpCopy
,HttpDelete
,HttpLabel
,HttpLock
,HttpMerge
,HttpMkcol
,HttpMkworkspace
,HttpMove
,HttpOrderpatch
,HttpPoll
,HttpPropfind
,HttpProppatch
,HttpRebind
,HttpReport
,HttpSearch
,HttpSubscribe
,HttpUnbind
,HttpUnlock
,HttpUnsubscribe
,HttpUpdate
,HttpVersionControl
public abstract class BaseDavRequest extends HttpEntityEnclosingRequestBase
Base class for HTTP request classes defined in this package.
-
-
Constructor Summary
Constructors Constructor Description BaseDavRequest(java.net.URI uri)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkSuccess(HttpResponse response)
Check the response and throw when it is considered to represent a failure.org.w3c.dom.Document
getResponseBodyAsDocument(HttpEntity entity)
Gets aDocument
representing the response body.EventDiscovery
getResponseBodyAsEventDiscovery(HttpResponse response)
Return response body asEventDiscovery
object.LockDiscovery
getResponseBodyAsLockDiscovery(HttpResponse response)
Return response body asLockDiscovery
object.MultiStatus
getResponseBodyAsMultiStatus(HttpResponse response)
Return response body asMultiStatus
object.SubscriptionDiscovery
getResponseBodyAsSubscriptionDiscovery(HttpResponse response)
Return response body asSubscriptionDiscovery
object.DavException
getResponseException(HttpResponse response)
Obtain aDavException
representing the response.boolean
succeeded(HttpResponse response)
Check the providedHttpResponse
for successful execution.-
Methods inherited from class org.apache.http.client.methods.HttpEntityEnclosingRequestBase
clone, expectContinue, getEntity, setEntity
-
Methods inherited from class org.apache.http.client.methods.HttpRequestBase
getConfig, getMethod, getProtocolVersion, getRequestLine, getURI, releaseConnection, setConfig, setProtocolVersion, setURI, started, toString
-
Methods inherited from class org.apache.http.client.methods.AbstractExecutionAwareRequest
abort, completed, isAborted, reset, setCancellable, setConnectionRequest, setReleaseTrigger
-
Methods inherited from class org.apache.http.message.AbstractHttpMessage
addHeader, addHeader, containsHeader, getAllHeaders, getFirstHeader, getHeaders, getLastHeader, getParams, headerIterator, headerIterator, removeHeader, removeHeaders, setHeader, setHeader, setHeaders, setParams
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.http.HttpMessage
addHeader, addHeader, containsHeader, getAllHeaders, getFirstHeader, getHeaders, getLastHeader, getParams, getProtocolVersion, headerIterator, headerIterator, removeHeader, removeHeaders, setHeader, setHeader, setHeaders, setParams
-
Methods inherited from interface org.apache.http.HttpRequest
getRequestLine
-
Methods inherited from interface org.apache.http.client.methods.HttpUriRequest
abort, isAborted
-
-
-
-
Method Detail
-
getResponseBodyAsDocument
public org.w3c.dom.Document getResponseBodyAsDocument(HttpEntity entity) throws java.io.IOException
Gets aDocument
representing the response body.- Returns:
- document or
null
for null entity - Throws:
java.io.IOException
- in case of I/O or XMP pasting problems
-
getResponseBodyAsMultiStatus
public MultiStatus getResponseBodyAsMultiStatus(HttpResponse response) throws DavException
Return response body asMultiStatus
object.- Throws:
java.lang.IllegalStateException
- when response does not represent aMultiStatus
DavException
- for failures in obtaining/parsing the response body
-
getResponseBodyAsLockDiscovery
public LockDiscovery getResponseBodyAsLockDiscovery(HttpResponse response) throws DavException
Return response body asLockDiscovery
object.- Throws:
java.lang.IllegalStateException
- when response does not represent aLockDiscovery
DavException
- for failures in obtaining/parsing the response body
-
getResponseBodyAsSubscriptionDiscovery
public SubscriptionDiscovery getResponseBodyAsSubscriptionDiscovery(HttpResponse response) throws DavException
Return response body asSubscriptionDiscovery
object.- Throws:
java.lang.IllegalStateException
- when response does not represent aSubscriptionDiscovery
DavException
- for failures in obtaining/parsing the response body
-
getResponseBodyAsEventDiscovery
public EventDiscovery getResponseBodyAsEventDiscovery(HttpResponse response) throws DavException
Return response body asEventDiscovery
object.- Throws:
java.lang.IllegalStateException
- when response does not represent aEventDiscovery
DavException
- for failures in obtaining/parsing the response body
-
checkSuccess
public void checkSuccess(HttpResponse response) throws DavException
Check the response and throw when it is considered to represent a failure.- Throws:
DavException
-
getResponseException
public DavException getResponseException(HttpResponse response)
Obtain aDavException
representing the response.- Throws:
java.lang.IllegalStateException
- when the response is considered to be successful
-
succeeded
public boolean succeeded(HttpResponse response)
Check the providedHttpResponse
for successful execution. The default implementation treats all 2xx status codes (RFC 7231, Section 6.3). Implementations can further restrict the accepted range of responses (or even check the response body).
-
-