Class TimeStampSimpleHttpClient
- java.lang.Object
-
- org.apache.poi.poifs.crypt.dsig.services.TimeStampSimpleHttpClient
-
- All Implemented Interfaces:
TimeStampHttpClient
public class TimeStampSimpleHttpClient extends 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 Modifier and Type Class Description protected static interfaceTimeStampSimpleHttpClient.MethodHandler-
Nested classes/interfaces inherited from interface org.apache.poi.poifs.crypt.dsig.services.TimeStampHttpClient
TimeStampHttpClient.TimeStampHttpClientResponse
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringBASIC_AUTHprotected SignatureConfigconfigprotected static StringCONTENT_TYPEprotected StringcontentTypeOutprotected booleanfollowRedirectsprotected Map<String,String>headerprotected booleanignoreHttpsCertificatesprotected Proxyproxyprotected static StringREDIRECT_LOCATIONprotected static StringUSER_AGENT
-
Constructor Summary
Constructors Constructor Description TimeStampSimpleHttpClient()
-
Method Summary
-
-
-
Field Detail
-
CONTENT_TYPE
protected static final String CONTENT_TYPE
- See Also:
- Constant Field Values
-
USER_AGENT
protected static final String USER_AGENT
- See Also:
- Constant Field Values
-
BASIC_AUTH
protected static final String BASIC_AUTH
- See Also:
- Constant Field Values
-
REDIRECT_LOCATION
protected static final String REDIRECT_LOCATION
- See Also:
- Constant Field Values
-
config
protected SignatureConfig config
-
proxy
protected Proxy proxy
-
contentTypeOut
protected String contentTypeOut
-
ignoreHttpsCertificates
protected boolean ignoreHttpsCertificates
-
followRedirects
protected boolean followRedirects
-
-
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(String proxyUrl)
-
getProxy
public Proxy getProxy()
-
setContentTypeIn
public void setContentTypeIn(String contentType)
Description copied from interface:TimeStampHttpClientset request content type- Specified by:
setContentTypeInin interfaceTimeStampHttpClient
-
setContentTypeOut
public void setContentTypeOut(String contentType)
Description copied from interface:TimeStampHttpClientset expected response content type - usenullif contentType is ignored- Specified by:
setContentTypeOutin interfaceTimeStampHttpClient
-
setBasicAuthentication
public void setBasicAuthentication(String username, 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(String url, byte[] payload) throws IOException
- Specified by:
postin interfaceTimeStampHttpClient- Throws:
IOException
-
get
public TimeStampHttpClient.TimeStampHttpClientResponse get(String url) throws IOException
- Specified by:
getin interfaceTimeStampHttpClient- Throws:
IOException
-
handleRedirect
protected TimeStampHttpClient.TimeStampHttpClientResponse handleRedirect(String url, TimeStampSimpleHttpClient.MethodHandler handler, boolean followRedirect) throws IOException
- Throws:
IOException
-
recklessConnection
protected void recklessConnection(HttpURLConnection conn) throws IOException
- Throws:
IOException
-
-