Class HTTPResult


  • public class HTTPResult
    extends java.lang.Object
    This is a container for HTTP responses.
    Version:
    1.0, erstellt am 02.09.2007
    Author:
    Thoralf Rickert
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.Hashtable<java.lang.String,​java.lang.String> header  
      protected org.apache.commons.httpclient.methods.GetMethod method  
      protected byte[] result  
      protected int status  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected HTTPResult​(org.apache.commons.httpclient.methods.GetMethod method, boolean async)
      Creates a HTTP Result instance based on the results inside the given method
      protected HTTPResult​(org.apache.commons.httpclient.methods.PostMethod method)
      Creates a HTTP Result instance based on the results inside the given method
      protected HTTPResult​(org.apache.commons.httpclient.methods.PutMethod method)
      Creates a HTTP Result instance based on the results inside the given method
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getEncoding()
      Returns the encoding of the result content.
      java.util.Map<java.lang.String,​java.lang.String> getHeader()
      Liefert den Header der Response vom Server.
      java.lang.String getHeader​(java.lang.String key)
      Returns the value for the header with the given key name.
      byte[] getResult()
      Liefert das Resultat des Webservers.
      java.lang.String getResultAsString()
      Returns the result from the webserver as a String.
      int getStatus()
      Liefert den vom Server übermittelten Statuscode.
      java.io.InputStream getStream()
      Returns the response body as stream.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • method

        protected org.apache.commons.httpclient.methods.GetMethod method
      • status

        protected int status
      • result

        protected byte[] result
      • header

        protected java.util.Hashtable<java.lang.String,​java.lang.String> header
    • Constructor Detail

      • HTTPResult

        protected HTTPResult​(org.apache.commons.httpclient.methods.GetMethod method,
                             boolean async)
        Creates a HTTP Result instance based on the results inside the given method
      • HTTPResult

        protected HTTPResult​(org.apache.commons.httpclient.methods.PostMethod method)
        Creates a HTTP Result instance based on the results inside the given method
      • HTTPResult

        protected HTTPResult​(org.apache.commons.httpclient.methods.PutMethod method)
        Creates a HTTP Result instance based on the results inside the given method
    • Method Detail

      • getResult

        public byte[] getResult()
        Liefert das Resultat des Webservers.
      • getResultAsString

        public java.lang.String getResultAsString()
        Returns the result from the webserver as a String. This method verifies the given encoding.
      • getEncoding

        public java.lang.String getEncoding()
        Returns the encoding of the result content.
      • getStream

        public java.io.InputStream getStream()
                                      throws java.io.IOException
        Returns the response body as stream. This stream is only available, if async mode is enabled.
        Throws:
        java.io.IOException
      • getStatus

        public int getStatus()
        Liefert den vom Server übermittelten Statuscode.
      • getHeader

        public java.util.Map<java.lang.String,​java.lang.String> getHeader()
        Liefert den Header der Response vom Server.
      • getHeader

        public java.lang.String getHeader​(java.lang.String key)
        Returns the value for the header with the given key name.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object