com.davecoss.uploader.utils
public class ConsoleHTTPSClient extends java.lang.Object implements HTTPSClient
| Constructor and Description | 
|---|
ConsoleHTTPSClient()  | 
ConsoleHTTPSClient(java.lang.String keystoreFilename,
                  char[] passphrase)  | 
ConsoleHTTPSClient(java.lang.String keystoreFilename,
                  char[] passphrase,
                  java.lang.String keystoreType)  | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
buildContext()  | 
void | 
buildContext(java.security.KeyStore keystore)  | 
void | 
close()  | 
static void | 
closeResponse(CloseableHttpResponse response)  | 
static CredentialsProvider | 
createCredentialsProvider(CredentialPair creds,
                         java.net.URI uri)  | 
static CredentialsProvider | 
createCredentialsProvider(java.lang.String username,
                         char[] password,
                         java.net.URI uri)  | 
WebResponse | 
doGet(java.lang.String url)  | 
WebResponse | 
doGet(java.net.URI uri)  | 
WebResponse | 
doGet(java.net.URL url)  | 
WebResponse | 
doPost(java.lang.String url,
      HttpEntity mpEntity)  | 
WebResponse | 
doPost(java.net.URI uri,
      HttpEntity mpEntity)  | 
WebResponse | 
doPost(java.net.URL url,
      HttpEntity mpEntity)  | 
java.io.InputStream | 
getContent(java.lang.String url)  | 
GenericBase64 | 
getEncoder()  | 
void | 
initSSLSocketFactory()  | 
JSONObject | 
jsonGet(java.lang.String url)  | 
JSONObject | 
jsonPost(java.lang.String url,
        HttpEntity mpEntity)  | 
void | 
loadKeystore(java.lang.String keystoreFilename,
            char[] passphrase)  | 
WebResponse | 
postFile(java.lang.String url,
        java.io.File thefile)  | 
static void | 
printResponse(CloseableHttpResponse response,
             java.io.PrintStream output)  | 
static JSONObject | 
responseJSON(HttpResponse response)  | 
void | 
startClient()  | 
void | 
startClient(CredentialsProvider creds,
           java.net.URI uri)  | 
public ConsoleHTTPSClient()
public ConsoleHTTPSClient(java.lang.String keystoreFilename,
                  char[] passphrase,
                  java.lang.String keystoreType)
                   throws java.io.IOException,
                          java.security.cert.CertificateException,
                          java.security.NoSuchAlgorithmException,
                          java.security.KeyStoreException,
                          java.security.KeyManagementException
java.io.IOExceptionjava.security.cert.CertificateExceptionjava.security.NoSuchAlgorithmExceptionjava.security.KeyStoreExceptionjava.security.KeyManagementExceptionpublic ConsoleHTTPSClient(java.lang.String keystoreFilename,
                  char[] passphrase)
                   throws java.io.IOException,
                          java.security.cert.CertificateException,
                          java.security.NoSuchAlgorithmException,
                          java.security.KeyStoreException,
                          java.security.KeyManagementException
java.io.IOExceptionjava.security.cert.CertificateExceptionjava.security.NoSuchAlgorithmExceptionjava.security.KeyStoreExceptionjava.security.KeyManagementExceptionpublic void loadKeystore(java.lang.String keystoreFilename,
                char[] passphrase)
                  throws java.io.IOException,
                         java.security.cert.CertificateException,
                         java.security.NoSuchAlgorithmException,
                         java.security.KeyStoreException,
                         java.security.KeyManagementException
java.io.IOExceptionjava.security.cert.CertificateExceptionjava.security.NoSuchAlgorithmExceptionjava.security.KeyStoreExceptionjava.security.KeyManagementExceptionpublic void buildContext(java.security.KeyStore keystore)
                  throws java.security.NoSuchAlgorithmException,
                         java.security.KeyStoreException,
                         java.security.KeyManagementException
java.security.NoSuchAlgorithmExceptionjava.security.KeyStoreExceptionjava.security.KeyManagementExceptionpublic void buildContext()
                  throws java.security.NoSuchAlgorithmException,
                         java.security.KeyStoreException,
                         java.security.KeyManagementException
java.security.NoSuchAlgorithmExceptionjava.security.KeyStoreExceptionjava.security.KeyManagementExceptionpublic void initSSLSocketFactory()
public void startClient()
                 throws java.io.IOException
startClient in interface HTTPSClientjava.io.IOExceptionpublic void startClient(CredentialsProvider creds,
               java.net.URI uri)
                 throws java.io.IOException
startClient in interface HTTPSClientjava.io.IOExceptionpublic java.io.InputStream getContent(java.lang.String url)
                               throws java.io.IOException
getContent in interface HTTPSClientjava.io.IOExceptionpublic JSONObject jsonGet(java.lang.String url)
                   throws java.io.IOException
jsonGet in interface HTTPSClientjava.io.IOExceptionpublic WebResponse doGet(java.lang.String url) throws java.io.IOException
doGet in interface HTTPSClientjava.io.IOExceptionpublic WebResponse doGet(java.net.URL url) throws java.io.IOException
doGet in interface HTTPSClientjava.io.IOExceptionpublic WebResponse doGet(java.net.URI uri) throws java.io.IOException
doGet in interface HTTPSClientjava.io.IOExceptionpublic JSONObject jsonPost(java.lang.String url,
                  HttpEntity mpEntity)
                    throws java.io.IOException
jsonPost in interface HTTPSClientjava.io.IOExceptionpublic WebResponse doPost(java.lang.String url, HttpEntity mpEntity) throws java.io.IOException
doPost in interface HTTPSClientjava.io.IOExceptionpublic WebResponse doPost(java.net.URL url, HttpEntity mpEntity) throws java.io.IOException
doPost in interface HTTPSClientjava.io.IOExceptionpublic WebResponse doPost(java.net.URI uri, HttpEntity mpEntity) throws java.io.IOException
doPost in interface HTTPSClientjava.io.IOExceptionpublic static void closeResponse(CloseableHttpResponse response)
                          throws java.io.IOException
java.io.IOExceptionpublic void close()
           throws java.io.IOException
close in interface HTTPSClientjava.io.IOExceptionpublic static void printResponse(CloseableHttpResponse response,
                 java.io.PrintStream output)
                          throws java.io.IOException
java.io.IOExceptionpublic WebResponse postFile(java.lang.String url, java.io.File thefile) throws java.io.IOException
postFile in interface HTTPSClientjava.io.IOExceptionpublic static CredentialsProvider createCredentialsProvider(java.lang.String username,
                                            char[] password,
                                            java.net.URI uri)
                                                     throws java.io.IOException
java.io.IOExceptionpublic static CredentialsProvider createCredentialsProvider(CredentialPair creds,
                                            java.net.URI uri)
                                                     throws java.io.IOException
java.io.IOExceptionpublic static JSONObject responseJSON(HttpResponse response)
                               throws java.io.IOException,
                                      org.json.simple.parser.ParseException
java.io.IOExceptionorg.json.simple.parser.ParseExceptionpublic GenericBase64 getEncoder()
getEncoder in interface HTTPSClientLast build: 2014-03-11 10:00 Copyright © 2013 David Coss. All Rights Reserved.