org.apache.webdav.lib.methods
Class OptionsMethod

java.lang.Object
  extended byorg.apache.commons.httpclient.HttpMethodBase
      extended byorg.apache.webdav.lib.methods.HttpRequestBodyMethodBase
          extended byorg.apache.webdav.lib.methods.XMLResponseMethodBase
              extended byorg.apache.webdav.lib.methods.OptionsMethod
All Implemented Interfaces:
HttpMethod

public class OptionsMethod
extends XMLResponseMethodBase

OPTIONS Method.


Nested Class Summary
 
Nested classes inherited from class org.apache.webdav.lib.methods.XMLResponseMethodBase
XMLResponseMethodBase.OptionsResponse, XMLResponseMethodBase.Response, XMLResponseMethodBase.ResponseWithinMultistatus, XMLResponseMethodBase.SingleResponse
 
Field Summary
static java.lang.String ACL
          ACL.
static java.lang.String ADVANCED_COLLECTIONS
          Advanced collections.
static java.lang.String DASL
          DASL.
static java.lang.String DAV_LEVEL1
          DAV level 1.
static java.lang.String DAV_LEVEL2
          DAV level 2.
static java.lang.String DELTAV
          Delta V.
static int OPTIONS_VERSION_HISTORY
           
static int OPTIONS_WORKSPACE
           
 
Fields inherited from class org.apache.webdav.lib.methods.XMLResponseMethodBase
builder, responseURLs
 
Fields inherited from class org.apache.commons.httpclient.HttpMethodBase
USER_AGENT
 
Constructor Summary
OptionsMethod()
          Method constructor.
OptionsMethod(java.lang.String path)
          Method constructor.
OptionsMethod(java.lang.String path, int type)
          Method constructor.
 
Method Summary
 void addRequestHeaders(HttpState state, HttpConnection conn)
           
protected  java.lang.String generateRequestBody()
          DAV requests that contain a body must override this function to generate that body.
 java.util.Enumeration getAllowedMethods()
          Get a list of allowed methods.
 java.util.Enumeration getAllResponseURLs()
          This method returns an enumeration of URL paths.
 java.util.Enumeration getDavCapabilities()
          Get a list of supported DAV capabilities.
 java.lang.String getName()
           
 java.util.Enumeration getResponseProperties()
           
 boolean isAllowed(java.lang.String method)
          Is the specified method allowed ?
 boolean isSupported(java.lang.String capability)
          Is DAV capability supported ?
 void parseResponse(java.io.InputStream input, HttpState state, HttpConnection conn)
          Parse response.
protected  org.w3c.dom.Document parseResponseContent(java.io.InputStream is)
           
 void processResponseHeaders(HttpState state, HttpConnection conn)
          Process response headers.
 
Methods inherited from class org.apache.webdav.lib.methods.XMLResponseMethodBase
convertElementToProperty, getDebug, getRequestContentLength, getResponseDocument, getResponseHashtable, getResponses, getResponseURLs, parseXMLResponse, readResponseBody, recycle, setDebug, setDocument, setResponseHashtable, writeRequestBody
 
Methods inherited from class org.apache.webdav.lib.methods.HttpRequestBodyMethodBase
isRequestContentAlreadySet, readContinueCode, setRequestBody, setRequestBody, setRequestBody, setRequestBody, setRequestBody
 
Methods inherited from class org.apache.commons.httpclient.HttpMethodBase
addAuthorizationRequestHeader, addContentLengthRequestHeader, addCookieRequestHeader, addHostRequestHeader, addProxyAuthorizationRequestHeader, addProxyConnectionHeader, addRequestHeader, addRequestHeader, addResponseFooter, addUserAgentRequestHeader, checkNotUsed, checkUsed, execute, fakeResponse, generateRequestLine, getAuthenticationRealm, getContentCharSet, getDoAuthentication, getFollowRedirects, getHostConfiguration, getMethodRetryHandler, getPath, getProxyAuthenticationRealm, getQueryString, getRecoverableExceptionCount, getRequestCharSet, getRequestHeader, getRequestHeaderGroup, getRequestHeaders, getResponseBody, getResponseBodyAsStream, getResponseBodyAsString, getResponseCharSet, getResponseContentLength, getResponseFooter, getResponseFooters, getResponseHeader, getResponseHeaderGroup, getResponseHeaders, getResponseStream, getResponseTrailerHeaderGroup, getStatusCode, getStatusLine, getStatusText, getURI, hasBeenUsed, isConnectionCloseForced, isHttp11, isStrictMode, processResponseBody, processStatusLine, readResponse, readResponseHeaders, readStatusLine, releaseConnection, removeRequestHeader, responseBodyConsumed, setConnectionCloseForced, setDoAuthentication, setFollowRedirects, setHostConfiguration, setHttp11, setMethodRetryHandler, setPath, setQueryString, setQueryString, setRequestHeader, setRequestHeader, setResponseStream, setStrictMode, shouldCloseConnection, validate, writeRequest, writeRequestHeaders, writeRequestLine
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DAV_LEVEL1

public static final java.lang.String DAV_LEVEL1
DAV level 1. Mandatory.

See Also:
Constant Field Values

DAV_LEVEL2

public static final java.lang.String DAV_LEVEL2
DAV level 2.

See Also:
Constant Field Values

ADVANCED_COLLECTIONS

public static final java.lang.String ADVANCED_COLLECTIONS
Advanced collections.

See Also:
Constant Field Values

DELTAV

public static final java.lang.String DELTAV
Delta V.

See Also:
Constant Field Values

ACL

public static final java.lang.String ACL
ACL.

See Also:
Constant Field Values

DASL

public static final java.lang.String DASL
DASL.

See Also:
Constant Field Values

OPTIONS_WORKSPACE

public static final int OPTIONS_WORKSPACE
See Also:
Constant Field Values

OPTIONS_VERSION_HISTORY

public static final int OPTIONS_VERSION_HISTORY
See Also:
Constant Field Values
Constructor Detail

OptionsMethod

public OptionsMethod()
Method constructor.


OptionsMethod

public OptionsMethod(java.lang.String path)
Method constructor.


OptionsMethod

public OptionsMethod(java.lang.String path,
                     int type)
Method constructor.

Method Detail

isAllowed

public boolean isAllowed(java.lang.String method)
Is the specified method allowed ?


getAllowedMethods

public java.util.Enumeration getAllowedMethods()
Get a list of allowed methods.


isSupported

public boolean isSupported(java.lang.String capability)
Is DAV capability supported ?


getDavCapabilities

public java.util.Enumeration getDavCapabilities()
Get a list of supported DAV capabilities.


parseResponse

public void parseResponse(java.io.InputStream input,
                          HttpState state,
                          HttpConnection conn)
                   throws java.io.IOException,
                          HttpException
Parse response.

Overrides:
parseResponse in class XMLResponseMethodBase
Parameters:
input - Input stream
Throws:
java.io.IOException
HttpException

processResponseHeaders

public void processResponseHeaders(HttpState state,
                                   HttpConnection conn)
Process response headers. The contract of this method is that it only parses the response headers.

Parameters:
state - the state
conn - the connection

generateRequestBody

protected java.lang.String generateRequestBody()
DAV requests that contain a body must override this function to generate that body.

The default behavior simply returns an empty body.

Overrides:
generateRequestBody in class XMLResponseMethodBase

getName

public java.lang.String getName()

addRequestHeaders

public void addRequestHeaders(HttpState state,
                              HttpConnection conn)
                       throws java.io.IOException,
                              HttpException
Throws:
java.io.IOException
HttpException

getAllResponseURLs

public java.util.Enumeration getAllResponseURLs()
This method returns an enumeration of URL paths. If the PropFindMethod was sent to the URL of a collection, then there will be multiple URLs. The URLs are picked out of the <D:href> elements of the response.

Returns:
an enumeration of URL paths as Strings

getResponseProperties

public java.util.Enumeration getResponseProperties()

parseResponseContent

protected org.w3c.dom.Document parseResponseContent(java.io.InputStream is)
                                             throws javax.xml.parsers.ParserConfigurationException,
                                                    org.xml.sax.SAXException,
                                                    java.io.IOException
Throws:
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException