Class TimeStampSimpleHttpClient
- java.lang.Object
-
- org.apache.poi.poifs.crypt.dsig.services.TimeStampSimpleHttpClient
-
- All Implemented Interfaces:
TimeStampHttpClient
public class TimeStampSimpleHttpClient extends java.lang.Object implements TimeStampHttpClient
This default implementation is used to decouple the timestamp service logic from the actual downloading code and to provide a base for user code using a different http client implementation
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.poi.poifs.crypt.dsig.services.TimeStampHttpClient
TimeStampHttpClient.TimeStampHttpClientResponse
-
-
Constructor Summary
Constructors Constructor Description TimeStampSimpleHttpClient()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description TimeStampHttpClient.TimeStampHttpClientResponseget(java.lang.String url)static intgetMaxTimestampResponseSize()java.net.ProxygetProxy()voidinit(SignatureConfig config)booleanisFollowRedirects()booleanisIgnoreHttpsCertificates()TimeStampHttpClient.TimeStampHttpClientResponsepost(java.lang.String url, byte[] payload)voidsetBasicAuthentication(java.lang.String username, java.lang.String password)voidsetContentTypeIn(java.lang.String contentType)set request content typevoidsetContentTypeOut(java.lang.String contentType)set expected response content type - usenullif contentType is ignoredvoidsetFollowRedirects(boolean followRedirects)voidsetIgnoreHttpsCertificates(boolean ignoreHttpsCertificates)static voidsetMaxTimestampResponseSize(int maxTimestampResponseSize)voidsetProxy(java.lang.String proxyUrl)
-
-
-
Method Detail
-
setMaxTimestampResponseSize
public static void setMaxTimestampResponseSize(int maxTimestampResponseSize)
- Parameters:
maxTimestampResponseSize- the max timestamp response size allowed
-
getMaxTimestampResponseSize
public static int getMaxTimestampResponseSize()
- Returns:
- the max timestamp response size allowed
-
init
public void init(SignatureConfig config)
- Specified by:
initin interfaceTimeStampHttpClient
-
setProxy
public void setProxy(java.lang.String proxyUrl)
-
getProxy
public java.net.Proxy getProxy()
-
setContentTypeIn
public void setContentTypeIn(java.lang.String contentType)
Description copied from interface:TimeStampHttpClientset request content type- Specified by:
setContentTypeInin interfaceTimeStampHttpClient
-
setContentTypeOut
public void setContentTypeOut(java.lang.String contentType)
Description copied from interface:TimeStampHttpClientset expected response content type - usenullif contentType is ignored- Specified by:
setContentTypeOutin interfaceTimeStampHttpClient
-
setBasicAuthentication
public void setBasicAuthentication(java.lang.String username, java.lang.String password)- Specified by:
setBasicAuthenticationin interfaceTimeStampHttpClient
-
isIgnoreHttpsCertificates
public boolean isIgnoreHttpsCertificates()
- Specified by:
isIgnoreHttpsCertificatesin interfaceTimeStampHttpClient- Returns:
- if the connection is reckless ignoring all https certificate trust issues
-
setIgnoreHttpsCertificates
public void setIgnoreHttpsCertificates(boolean ignoreHttpsCertificates)
- Specified by:
setIgnoreHttpsCertificatesin interfaceTimeStampHttpClient- Parameters:
ignoreHttpsCertificates- set if the connection is reckless ignoring all https certificate trust issues
-
isFollowRedirects
public boolean isFollowRedirects()
- Specified by:
isFollowRedirectsin interfaceTimeStampHttpClient- Returns:
- if http redirects are followed once
-
setFollowRedirects
public void setFollowRedirects(boolean followRedirects)
- Specified by:
setFollowRedirectsin interfaceTimeStampHttpClient- Parameters:
followRedirects- set if http redirects are followed once
-
post
public TimeStampHttpClient.TimeStampHttpClientResponse post(java.lang.String url, byte[] payload) throws java.io.IOException
- Specified by:
postin interfaceTimeStampHttpClient- Throws:
java.io.IOException
-
get
public TimeStampHttpClient.TimeStampHttpClientResponse get(java.lang.String url) throws java.io.IOException
- Specified by:
getin interfaceTimeStampHttpClient- Throws:
java.io.IOException
-
-