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.IOException
java.security.cert.CertificateException
java.security.NoSuchAlgorithmException
java.security.KeyStoreException
java.security.KeyManagementException
public 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.IOException
java.security.cert.CertificateException
java.security.NoSuchAlgorithmException
java.security.KeyStoreException
java.security.KeyManagementException
public 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.IOException
java.security.cert.CertificateException
java.security.NoSuchAlgorithmException
java.security.KeyStoreException
java.security.KeyManagementException
public void buildContext(java.security.KeyStore keystore) throws java.security.NoSuchAlgorithmException, java.security.KeyStoreException, java.security.KeyManagementException
java.security.NoSuchAlgorithmException
java.security.KeyStoreException
java.security.KeyManagementException
public void buildContext() throws java.security.NoSuchAlgorithmException, java.security.KeyStoreException, java.security.KeyManagementException
java.security.NoSuchAlgorithmException
java.security.KeyStoreException
java.security.KeyManagementException
public void initSSLSocketFactory()
public void startClient() throws java.io.IOException
startClient
in interface HTTPSClient
java.io.IOException
public void startClient(CredentialsProvider creds, java.net.URI uri) throws java.io.IOException
startClient
in interface HTTPSClient
java.io.IOException
public java.io.InputStream getContent(java.lang.String url) throws java.io.IOException
getContent
in interface HTTPSClient
java.io.IOException
public JSONObject jsonGet(java.lang.String url) throws java.io.IOException
jsonGet
in interface HTTPSClient
java.io.IOException
public WebResponse doGet(java.lang.String url) throws java.io.IOException
doGet
in interface HTTPSClient
java.io.IOException
public WebResponse doGet(java.net.URL url) throws java.io.IOException
doGet
in interface HTTPSClient
java.io.IOException
public WebResponse doGet(java.net.URI uri) throws java.io.IOException
doGet
in interface HTTPSClient
java.io.IOException
public JSONObject jsonPost(java.lang.String url, HttpEntity mpEntity) throws java.io.IOException
jsonPost
in interface HTTPSClient
java.io.IOException
public WebResponse doPost(java.lang.String url, HttpEntity mpEntity) throws java.io.IOException
doPost
in interface HTTPSClient
java.io.IOException
public WebResponse doPost(java.net.URL url, HttpEntity mpEntity) throws java.io.IOException
doPost
in interface HTTPSClient
java.io.IOException
public WebResponse doPost(java.net.URI uri, HttpEntity mpEntity) throws java.io.IOException
doPost
in interface HTTPSClient
java.io.IOException
public static void closeResponse(CloseableHttpResponse response) throws java.io.IOException
java.io.IOException
public void close() throws java.io.IOException
close
in interface HTTPSClient
java.io.IOException
public static void printResponse(CloseableHttpResponse response, java.io.PrintStream output) throws java.io.IOException
java.io.IOException
public WebResponse postFile(java.lang.String url, java.io.File thefile) throws java.io.IOException
postFile
in interface HTTPSClient
java.io.IOException
public static CredentialsProvider createCredentialsProvider(java.lang.String username, char[] password, java.net.URI uri) throws java.io.IOException
java.io.IOException
public static CredentialsProvider createCredentialsProvider(CredentialPair creds, java.net.URI uri) throws java.io.IOException
java.io.IOException
public static JSONObject responseJSON(HttpResponse response) throws java.io.IOException, org.json.simple.parser.ParseException
java.io.IOException
org.json.simple.parser.ParseException
public GenericBase64 getEncoder()
getEncoder
in interface HTTPSClient
Last build: 2014-03-11 10:00 Copyright © 2013 David Coss. All Rights Reserved.