Class LabelMethod

java.lang.Object
org.apache.commons.httpclient.HttpMethodBase
All Implemented Interfaces:
org.apache.commons.httpclient.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"

 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
 
  • Field Details

    • LABEL_SET

      public static final int LABEL_SET
      The constant for setting a label.
      See Also:
    • LABEL_ADD

      public static final int LABEL_ADD
      The constant for adding a label.
      See Also:
    • LABEL_REMOVE

      public static final int LABEL_REMOVE
      The constant for removing a label.
      See Also:
  • 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

    • 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(String labelName)
      Set the label-name this action will manipulate.
      Parameters:
      labelName - the label name
    • getLabelName

      public String 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 class org.apache.commons.httpclient.HttpMethodBase
      Parameters:
      state - the state
      conn - the connection
      Throws:
      IOException
      org.apache.commons.httpclient.HttpException
    • 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 class XMLResponseMethodBase
    • 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 class XMLResponseMethodBase
      Parameters:
      input - Input stream
      Throws:
      IOException
      org.apache.commons.httpclient.HttpException
    • getName

      public String getName()
      Specified by:
      getName in interface org.apache.commons.httpclient.HttpMethod
      Specified by:
      getName in class org.apache.commons.httpclient.HttpMethodBase