Package com.jalios.io

Class HttpClient


  • public class HttpClient
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.net.HttpURLConnection connection  
      protected java.lang.String cookie  
      static java.lang.String JSESSSIONID  
      protected int responseCode  
      static java.lang.String REVISION  
      static java.lang.String SET_COOKIE  
    • Constructor Summary

      Constructors 
      Constructor Description
      HttpClient()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean connect​(java.lang.String url)
      Initialize a Connection to a given URL
      java.lang.String getContents​(java.lang.String url)
      Connect, get the content and disconnect.
      java.lang.String readCookie()
      Return the value of the cookie
      • Methods inherited from class java.lang.Object

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

      • connection

        protected java.net.HttpURLConnection connection
      • cookie

        protected java.lang.String cookie
      • responseCode

        protected int responseCode
    • Constructor Detail

      • HttpClient

        public HttpClient()
    • Method Detail

      • connect

        public boolean connect​(java.lang.String url)
        Initialize a Connection to a given URL
        Parameters:
        url - the URL to connect
        Returns:
        true if the connection is OK
      • getContents

        public java.lang.String getContents​(java.lang.String url)
        Connect, get the content and disconnect.
        Parameters:
        url - the URL to request for the content
        Returns:
        the content
      • readCookie

        public java.lang.String readCookie()
                                    throws java.io.IOException
        Return the value of the cookie
        Returns:
        the cookie
        Throws:
        java.io.IOException - Exception thrown on cookie reading