org.apache.webdav.lib.methods
Class LabelMethod

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.LabelMethod
All Implemented Interfaces:
HttpMethod

public class LabelMethod
extends XMLResponseMethodBase

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"

 
 
   
     newlabel
   
 
 

Example Response

 HTTP/1.1 200 OK
 Cache-Control: no-cache
 


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 int LABEL_ADD
          The constant for adding a label.
static int LABEL_REMOVE
          The constant for removing a label.
static int LABEL_SET
          The constant for setting a label.
 
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
LabelMethod()
          The default constructor.
LabelMethod(java.lang.String path, int action, java.lang.String labelName)
          The label method constructor.
 
Method Summary
 void addRequestHeaders(HttpState state, HttpConnection conn)
          Generate the protocol headers.
protected  java.lang.String generateRequestBody()
          DAV requests that contain a body must override this function to generate that body.
 java.lang.String getLabelName()
          Get the label-name this action will manipulate.
 java.lang.String getName()
           
 int getType()
          Get the label type which has been set.
 void parseResponse(java.io.InputStream input, HttpState state, HttpConnection conn)
          Parse response.
 void setLabelName(java.lang.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, 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, processResponseHeaders, 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

LABEL_SET

public static final int LABEL_SET
The constant for setting a label.

See Also:
Constant Field Values

LABEL_ADD

public static final int LABEL_ADD
The constant for adding a label.

See Also:
Constant Field Values

LABEL_REMOVE

public static final int LABEL_REMOVE
The constant for removing a label.

See Also:
Constant Field Values
Constructor Detail

LabelMethod

public LabelMethod()
The default constructor.


LabelMethod

public LabelMethod(java.lang.String path,
                   int action,
                   java.lang.String labelName)
The label method constructor.

Parameters:
path - the path
action - the action
labelName - the label name
Method Detail

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

public void setLabelName(java.lang.String labelName)
Set the label-name this action will manipulate.

Parameters:
labelName - the label name

getLabelName

public java.lang.String getLabelName()
Get the label-name this action will manipulate.

Returns:
the label-name

addRequestHeaders

public void addRequestHeaders(HttpState state,
                              HttpConnection conn)
                       throws java.io.IOException,
                              HttpException
Generate the protocol headers.

Parameters:
state - the state
conn - the connection
Throws:
java.io.IOException
HttpException

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

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

getName

public java.lang.String getName()