public class TimeStampSimpleHttpClient extends java.lang.Object implements TimeStampHttpClient
Modifier and Type | Class and Description |
---|---|
protected static interface |
TimeStampSimpleHttpClient.MethodHandler |
TimeStampHttpClient.TimeStampHttpClientResponse
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
BASIC_AUTH |
protected SignatureConfig |
config |
protected static java.lang.String |
CONTENT_TYPE |
protected java.lang.String |
contentTypeOut |
protected boolean |
followRedirects |
protected java.util.Map<java.lang.String,java.lang.String> |
header |
protected boolean |
ignoreHttpsCertificates |
protected java.net.Proxy |
proxy |
protected static java.lang.String |
REDIRECT_LOCATION |
protected static java.lang.String |
USER_AGENT |
Constructor and Description |
---|
TimeStampSimpleHttpClient() |
Modifier and Type | Method and Description |
---|---|
TimeStampHttpClient.TimeStampHttpClientResponse |
get(java.lang.String url) |
static int |
getMaxTimestampResponseSize() |
java.net.Proxy |
getProxy() |
protected TimeStampHttpClient.TimeStampHttpClientResponse |
handleRedirect(java.lang.String url,
TimeStampSimpleHttpClient.MethodHandler handler,
boolean followRedirect) |
void |
init(SignatureConfig config) |
boolean |
isFollowRedirects() |
boolean |
isIgnoreHttpsCertificates() |
TimeStampHttpClient.TimeStampHttpClientResponse |
post(java.lang.String url,
byte[] payload) |
protected void |
recklessConnection(java.net.HttpURLConnection conn) |
void |
setBasicAuthentication(java.lang.String username,
java.lang.String password) |
void |
setContentTypeIn(java.lang.String contentType)
set request content type
|
void |
setContentTypeOut(java.lang.String contentType)
set expected response content type - use
null if contentType is ignored |
void |
setFollowRedirects(boolean followRedirects) |
void |
setIgnoreHttpsCertificates(boolean ignoreHttpsCertificates) |
static void |
setMaxTimestampResponseSize(int maxTimestampResponseSize) |
void |
setProxy(java.lang.String proxyUrl) |
protected static final java.lang.String CONTENT_TYPE
protected static final java.lang.String USER_AGENT
protected static final java.lang.String BASIC_AUTH
protected static final java.lang.String REDIRECT_LOCATION
protected SignatureConfig config
protected java.net.Proxy proxy
protected final java.util.Map<java.lang.String,java.lang.String> header
protected java.lang.String contentTypeOut
protected boolean ignoreHttpsCertificates
protected boolean followRedirects
public static void setMaxTimestampResponseSize(int maxTimestampResponseSize)
maxTimestampResponseSize
- the max timestamp response size allowedpublic static int getMaxTimestampResponseSize()
public void init(SignatureConfig config)
init
in interface TimeStampHttpClient
public void setProxy(java.lang.String proxyUrl)
public java.net.Proxy getProxy()
public void setContentTypeIn(java.lang.String contentType)
TimeStampHttpClient
setContentTypeIn
in interface TimeStampHttpClient
public void setContentTypeOut(java.lang.String contentType)
TimeStampHttpClient
null
if contentType is ignoredsetContentTypeOut
in interface TimeStampHttpClient
public void setBasicAuthentication(java.lang.String username, java.lang.String password)
setBasicAuthentication
in interface TimeStampHttpClient
public boolean isIgnoreHttpsCertificates()
isIgnoreHttpsCertificates
in interface TimeStampHttpClient
public void setIgnoreHttpsCertificates(boolean ignoreHttpsCertificates)
setIgnoreHttpsCertificates
in interface TimeStampHttpClient
ignoreHttpsCertificates
- set if the connection is reckless ignoring all https certificate trust issuespublic boolean isFollowRedirects()
isFollowRedirects
in interface TimeStampHttpClient
public void setFollowRedirects(boolean followRedirects)
setFollowRedirects
in interface TimeStampHttpClient
followRedirects
- set if http redirects are followed oncepublic TimeStampHttpClient.TimeStampHttpClientResponse post(java.lang.String url, byte[] payload) throws java.io.IOException
post
in interface TimeStampHttpClient
java.io.IOException
public TimeStampHttpClient.TimeStampHttpClientResponse get(java.lang.String url) throws java.io.IOException
get
in interface TimeStampHttpClient
java.io.IOException
protected TimeStampHttpClient.TimeStampHttpClientResponse handleRedirect(java.lang.String url, TimeStampSimpleHttpClient.MethodHandler handler, boolean followRedirect) throws java.io.IOException
java.io.IOException
protected void recklessConnection(java.net.HttpURLConnection conn) throws java.io.IOException
java.io.IOException
Copyright 2022 The Apache Software Foundation or its licensors, as applicable.