EspressReport
v 5.5

quadbase.common.util.internal
Class HttpsIO

java.lang.Object
  |
  +--quadbase.common.util.internal.HttpsIO

public class HttpsIO
extends java.lang.Object

This class provides IO Utilities for https connections. Upon connecting using the https, this class also installs an all-trusting trust manager into the SSLSocketFactory so that all certificates will be trusted. Further, it ignores inconsistencies between the certificate's url name and the session's host name.


Constructor Summary
HttpsIO()
           
 
Method Summary
static byte[] getBytes(java.lang.String url)
          Obtains all the data from a url as a byte[] using the https protocol
static byte[] getBytes(java.net.URL url)
          Obtains all the data from a url as a byte[] using the https protocol
static java.io.InputStream getHttpsInputStream(java.lang.String url)
          Obtains an InputStream from a url connection using https protocol
static java.io.InputStream getHttpsInputStream(java.net.URL url)
          Obtains an InputStream from a url connection using https protocol
static java.io.InputStream getInputStream(quadbase.common.util.internal.HttpsURLConnection conn)
          Obtains a https InputStream using the specified url connection.
static java.io.OutputStream getOutputStream(quadbase.common.util.internal.HttpsURLConnection conn)
          Obtains a https OutputStream using the specified url connection.
static java.net.URLConnection openHttpsConnection(java.net.URL url)
          Opens a https connection using the specified url.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpsIO

public HttpsIO()
        throws java.security.NoSuchAlgorithmException,
               java.security.KeyManagementException
Method Detail

openHttpsConnection

public static java.net.URLConnection openHttpsConnection(java.net.URL url)
                                                  throws java.security.NoSuchAlgorithmException,
                                                         java.security.KeyManagementException,
                                                         java.io.IOException
Opens a https connection using the specified url.
Returns:
the HttpsURLConnection object representing the https connection.

getOutputStream

public static java.io.OutputStream getOutputStream(quadbase.common.util.internal.HttpsURLConnection conn)
                                            throws java.security.NoSuchAlgorithmException,
                                                   java.security.KeyManagementException,
                                                   java.io.IOException
Obtains a https OutputStream using the specified url connection.
Returns:
the OutputStream

getInputStream

public static java.io.InputStream getInputStream(quadbase.common.util.internal.HttpsURLConnection conn)
                                          throws java.security.NoSuchAlgorithmException,
                                                 java.security.KeyManagementException,
                                                 java.io.IOException
Obtains a https InputStream using the specified url connection.
Returns:
the InputStream

getBytes

public static byte[] getBytes(java.lang.String url)
                       throws java.security.NoSuchAlgorithmException,
                              java.security.KeyManagementException,
                              java.io.IOException
Obtains all the data from a url as a byte[] using the https protocol
Parameters:
url - the url for the https connection, must have a "https" prefix
Returns:
the data from reading the resource using the url as a byte[]

getBytes

public static byte[] getBytes(java.net.URL url)
                       throws java.security.NoSuchAlgorithmException,
                              java.security.KeyManagementException,
                              java.io.IOException
Obtains all the data from a url as a byte[] using the https protocol
Parameters:
url - the url for the https connection, must have a "https" prefix
Returns:
the data from reading the resource using the url as a byte[]

getHttpsInputStream

public static java.io.InputStream getHttpsInputStream(java.lang.String url)
                                               throws java.security.NoSuchAlgorithmException,
                                                      java.security.KeyManagementException,
                                                      java.io.IOException
Obtains an InputStream from a url connection using https protocol
Parameters:
url - the url for the https connection, must have a "https" prefix
Returns:
an InputStream connected to the specified url

getHttpsInputStream

public static java.io.InputStream getHttpsInputStream(java.net.URL url)
                                               throws java.security.NoSuchAlgorithmException,
                                                      java.security.KeyManagementException,
                                                      java.io.IOException
Obtains an InputStream from a url connection using https protocol
Parameters:
url - the url for the https connection, must have a "https" prefix
Returns:
an InputStream connected to the specified url

EspressReport
v 5.5