Class LabelMethod

  • 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"
    
     
     
       
         newlabel
       
     
     

    Example Response

     HTTP/1.1 200 OK
     Cache-Control: no-cache
     
    • Constructor Summary

      Constructors 
      Constructor Description
      LabelMethod()
      The default constructor.
      LabelMethod​(java.lang.String path, int action, java.lang.String labelName)
      The label method constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addRequestHeaders​(org.apache.commons.httpclient.HttpState state, org.apache.commons.httpclient.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, org.apache.commons.httpclient.HttpState state, org.apache.commons.httpclient.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.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
      • 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​(org.apache.commons.httpclient.HttpState state,
                                      org.apache.commons.httpclient.HttpConnection conn)
                               throws java.io.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:
        java.io.IOException
        org.apache.commons.httpclient.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,
                                  org.apache.commons.httpclient.HttpState state,
                                  org.apache.commons.httpclient.HttpConnection conn)
                           throws java.io.IOException,
                                  org.apache.commons.httpclient.HttpException
        Parse response.
        Overrides:
        parseResponse in class XMLResponseMethodBase
        Parameters:
        input - Input stream
        Throws:
        java.io.IOException
        org.apache.commons.httpclient.HttpException
      • getName

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