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.TimeStampHttpClientResponse
get(java.lang.String url)
static int
getMaxTimestampResponseSize()
java.net.Proxy
getProxy()
void
init(SignatureConfig config)
boolean
isFollowRedirects()
boolean
isIgnoreHttpsCertificates()
TimeStampHttpClient.TimeStampHttpClientResponse
post(java.lang.String url, byte[] payload)
void
setBasicAuthentication(java.lang.String username, java.lang.String password)
void
setContentTypeIn(java.lang.String contentType)
set request content typevoid
setContentTypeOut(java.lang.String contentType)
set expected response content type - usenull
if contentType is ignoredvoid
setFollowRedirects(boolean followRedirects)
void
setIgnoreHttpsCertificates(boolean ignoreHttpsCertificates)
static void
setMaxTimestampResponseSize(int maxTimestampResponseSize)
void
setProxy(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:
init
in 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:TimeStampHttpClient
set request content type- Specified by:
setContentTypeIn
in interfaceTimeStampHttpClient
-
setContentTypeOut
public void setContentTypeOut(java.lang.String contentType)
Description copied from interface:TimeStampHttpClient
set expected response content type - usenull
if contentType is ignored- Specified by:
setContentTypeOut
in interfaceTimeStampHttpClient
-
setBasicAuthentication
public void setBasicAuthentication(java.lang.String username, java.lang.String password)
- Specified by:
setBasicAuthentication
in interfaceTimeStampHttpClient
-
isIgnoreHttpsCertificates
public boolean isIgnoreHttpsCertificates()
- Specified by:
isIgnoreHttpsCertificates
in interfaceTimeStampHttpClient
- Returns:
- if the connection is reckless ignoring all https certificate trust issues
-
setIgnoreHttpsCertificates
public void setIgnoreHttpsCertificates(boolean ignoreHttpsCertificates)
- Specified by:
setIgnoreHttpsCertificates
in interfaceTimeStampHttpClient
- Parameters:
ignoreHttpsCertificates
- set if the connection is reckless ignoring all https certificate trust issues
-
isFollowRedirects
public boolean isFollowRedirects()
- Specified by:
isFollowRedirects
in interfaceTimeStampHttpClient
- Returns:
- if http redirects are followed once
-
setFollowRedirects
public void setFollowRedirects(boolean followRedirects)
- Specified by:
setFollowRedirects
in 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:
post
in interfaceTimeStampHttpClient
- Throws:
java.io.IOException
-
get
public TimeStampHttpClient.TimeStampHttpClientResponse get(java.lang.String url) throws java.io.IOException
- Specified by:
get
in interfaceTimeStampHttpClient
- Throws:
java.io.IOException
-
-