Package org.apache.webdav.lib.methods
Class LabelMethod
java.lang.Object
org.apache.commons.httpclient.HttpMethodBase
org.apache.webdav.lib.methods.HttpRequestBodyMethodBase
org.apache.webdav.lib.methods.XMLResponseMethodBase
org.apache.webdav.lib.methods.LabelMethod
- All Implemented Interfaces:
org.apache.commons.httpclient.HttpMethod
The Label method is used to manipulate labels on resources on the server.
Example Request
LABEL /files/testfile.xml HTTP/1.1 Host: www.webdav.org Content-Type: text/xml; charset="utf-8" invalid input: '<'?xml version="1.0" encoding="utf-8"?> invalid input: '<'D:label xmlns:D="DAV:"> invalid input: '<'D:set> invalid input: '<'D:label-name>newlabelinvalid input: '<'/D:label-name> invalid input: '<'/D:set> invalid input: '<'/D:label>
Example Response
HTTP/1.1 200 OK Cache-Control: no-cache
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.webdav.lib.methods.XMLResponseMethodBase
XMLResponseMethodBase.OptionsResponse, XMLResponseMethodBase.Response, XMLResponseMethodBase.ResponseWithinMultistatus, XMLResponseMethodBase.SingleResponse
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
The constant for adding a label.static final int
The constant for removing a label.static final int
The constant for setting a label.Fields inherited from class org.apache.webdav.lib.methods.XMLResponseMethodBase
builder, decodeResponseHrefs, responseURLs
Fields inherited from class org.apache.commons.httpclient.HttpMethodBase
effectiveVersion, statusLine
-
Constructor Summary
ConstructorsConstructorDescriptionThe default constructor.LabelMethod
(String path, int action, String labelName) The label method constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addRequestHeaders
(org.apache.commons.httpclient.HttpState state, org.apache.commons.httpclient.HttpConnection conn) Generate the protocol headers.protected String
DAV requests that contain a body must override this function to generate that body.Get the label-name this action will manipulate.getName()
int
getType()
Get the label type which has been set.void
parseResponse
(InputStream input, org.apache.commons.httpclient.HttpState state, org.apache.commons.httpclient.HttpConnection conn) Parse response.void
setLabelName
(String labelName) Set the label-name this action will manipulate.void
setType
(int type) Set the type of label action to take.Methods inherited from class org.apache.webdav.lib.methods.XMLResponseMethodBase
convertElementToProperty, getDebug, getRequestContentLength, getResponseDocument, getResponseHashtable, getResponses, getResponseURLs, parseXMLResponse, readResponseBody, recycle, setDebug, setDecodeResponseHrefs, 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
abort, addCookieRequestHeader, addHostRequestHeader, addProxyConnectionHeader, addRequestHeader, addRequestHeader, addResponseFooter, addUserAgentRequestHeader, checkNotUsed, checkUsed, execute, generateRequestLine, getAuthenticationRealm, getContentCharSet, getDoAuthentication, getEffectiveVersion, getFollowRedirects, getHostAuthState, getHostConfiguration, getMethodRetryHandler, getParams, getPath, getProxyAuthenticationRealm, getProxyAuthState, getQueryString, getRecoverableExceptionCount, getRequestCharSet, getRequestHeader, getRequestHeaderGroup, getRequestHeaders, getRequestHeaders, getResponseBody, getResponseBody, getResponseBodyAsStream, getResponseBodyAsString, getResponseBodyAsString, getResponseCharSet, getResponseContentLength, getResponseFooter, getResponseFooters, getResponseHeader, getResponseHeaderGroup, getResponseHeaders, getResponseHeaders, getResponseStream, getResponseTrailerHeaderGroup, getStatusCode, getStatusLine, getStatusText, getURI, hasBeenUsed, isAborted, isConnectionCloseForced, isHttp11, isRequestSent, isStrictMode, processCookieHeaders, processResponseBody, processResponseHeaders, processStatusLine, readResponse, readResponseHeaders, readStatusLine, releaseConnection, removeRequestHeader, removeRequestHeader, responseBodyConsumed, setConnectionCloseForced, setDoAuthentication, setFollowRedirects, setHostConfiguration, setHttp11, setMethodRetryHandler, setParams, setPath, setQueryString, setQueryString, setRequestHeader, setRequestHeader, setResponseStream, setStrictMode, setURI, shouldCloseConnection, validate, writeRequest, writeRequestHeaders, writeRequestLine
-
Field Details
-
LABEL_SET
public static final int LABEL_SETThe constant for setting a label.- See Also:
-
LABEL_ADD
public static final int LABEL_ADDThe constant for adding a label.- See Also:
-
LABEL_REMOVE
public static final int LABEL_REMOVEThe constant for removing a label.- See Also:
-
-
Constructor Details
-
LabelMethod
public LabelMethod()The default constructor. -
LabelMethod
The label method constructor.- Parameters:
path
- the pathaction
- the actionlabelName
- the label name
-
-
Method Details
-
setType
public void setType(int type) Set the type of label action to take.- Parameters:
type
- the type of the label action
-
getType
public int getType()Get the label type which has been set.- Returns:
- the type
-
setLabelName
Set the label-name this action will manipulate.- Parameters:
labelName
- the label name
-
getLabelName
Get the label-name this action will manipulate.- Returns:
- the label-name
-
addRequestHeaders
public void addRequestHeaders(org.apache.commons.httpclient.HttpState state, org.apache.commons.httpclient.HttpConnection conn) throws IOException, org.apache.commons.httpclient.HttpException Generate the protocol headers.- Overrides:
addRequestHeaders
in classorg.apache.commons.httpclient.HttpMethodBase
- Parameters:
state
- the stateconn
- the connection- Throws:
IOException
org.apache.commons.httpclient.HttpException
-
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 classXMLResponseMethodBase
-
parseResponse
public void parseResponse(InputStream input, org.apache.commons.httpclient.HttpState state, org.apache.commons.httpclient.HttpConnection conn) throws IOException, org.apache.commons.httpclient.HttpException Parse response.- Overrides:
parseResponse
in classXMLResponseMethodBase
- Parameters:
input
- Input stream- Throws:
IOException
org.apache.commons.httpclient.HttpException
-
getName
- Specified by:
getName
in interfaceorg.apache.commons.httpclient.HttpMethod
- Specified by:
getName
in classorg.apache.commons.httpclient.HttpMethodBase
-