org.apache.webdav.lib.methods

Class LabelMethod


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"

 <?xml version="1.0" encoding="utf-8"?>
 
   
     newlabel
   
 
 

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

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, decodeResponseHrefs, responseURLs

Constructor Summary

LabelMethod()
The default constructor.
LabelMethod(String path, int action, String labelName)
The label method constructor.

Method Summary

void
addRequestHeaders(HttpState state, HttpConnection conn)
Generate the protocol headers.
protected String
generateRequestBody()
DAV requests that contain a body must override this function to generate that body.
String
getLabelName()
Get the label-name this action will manipulate.
String
getName()
int
getType()
Get the label type which has been set.
void
parseResponse(InputStream input, HttpState state, 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, generateRequestBody, getDebug, getRequestContentLength, getResponseDocument, getResponseHashtable, getResponseURLs, getResponses, parseResponse, parseXMLResponse, readResponseBody, recycle, setDebug, setDecodeResponseHrefs, setDocument, setResponseHashtable, writeRequestBody

Methods inherited from class org.apache.webdav.lib.methods.HttpRequestBodyMethodBase

getRequestContentLength, isRequestContentAlreadySet, readContinueCode, recycle, setRequestBody, setRequestBody, setRequestBody, setRequestBody, setRequestBody, writeRequestBody

Field Details

LABEL_ADD

public static final int LABEL_ADD
The constant for adding a label.
Field Value:
2

LABEL_REMOVE

public static final int LABEL_REMOVE
The constant for removing a label.
Field Value:
3

LABEL_SET

public static final int LABEL_SET
The constant for setting a label.
Field Value:
1

Constructor Details

LabelMethod

public LabelMethod()
The default constructor.

LabelMethod

public LabelMethod(String path,
                   int action,
                   String labelName)
The label method constructor.
Parameters:
path - the path
action - the action
labelName - the label name

Method Details

addRequestHeaders

public void addRequestHeaders(HttpState state,
                              HttpConnection conn)
            throws IOException,
                   HttpException
Generate the protocol headers.
Parameters:
state - the state
conn - the connection

generateRequestBody

protected 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 interface XMLResponseMethodBase

getLabelName

public String getLabelName()
Get the label-name this action will manipulate.
Returns:
the label-name

getName

public String getName()

getType

public int getType()
Get the label type which has been set.
Returns:
the type

parseResponse

public void parseResponse(InputStream input,
                          HttpState state,
                          HttpConnection conn)
            throws IOException,
                   HttpException
Parse response.
Overrides:
parseResponse in interface XMLResponseMethodBase
Parameters:
input - Input stream

setLabelName

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

setType

public void setType(int type)
Set the type of label action to take.
Parameters:
type - the type of the label action