Class NativeHTTPDataLoader
java.lang.Object
eu.europa.esig.dss.spi.client.http.NativeHTTPDataLoader
- All Implemented Interfaces:
DataLoader
,Serializable
public class NativeHTTPDataLoader extends Object implements DataLoader
Implementation of native java DataLoader using the java.net.URL class.
- See Also:
- Serialized Form
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
NativeHTTPDataLoader.HttpMethod
Nested classes/interfaces inherited from interface eu.europa.esig.dss.spi.client.http.DataLoader
DataLoader.DataAndUrl
-
Constructor Summary
Constructors Constructor Description NativeHTTPDataLoader()
-
Method Summary
Modifier and Type Method Description byte[]
get(String url)
Execute a HTTP GET operation.byte[]
get(String url, boolean refresh)
Execute a HTTP GET operation with indication concerning the mandatory nature of the operation.DataLoader.DataAndUrl
get(List<String> urlStrings)
Execute a HTTP GET operation.long
getMaxInputSize()
long
getTimeout()
byte[]
post(String url, byte[] content)
Executes a HTTP POST operationprotected byte[]
request(String url, NativeHTTPDataLoader.HttpMethod method, byte[] content, boolean refresh)
void
setContentType(String contentType)
This allows to set the content type.void
setMaxInputSize(long maxInputSize)
void
setTimeout(long timeout)
-
Constructor Details
-
NativeHTTPDataLoader
public NativeHTTPDataLoader()
-
-
Method Details
-
request
protected byte[] request(String url, NativeHTTPDataLoader.HttpMethod method, byte[] content, boolean refresh) -
get
Description copied from interface:DataLoader
Execute a HTTP GET operation. This method is used when many URls are available to access the same resource. The operation stops after the first successful download.- Specified by:
get
in interfaceDataLoader
- Parameters:
urlStrings
-List
ofString
s representing the URLs to be used in sequential way to obtain the data.- Returns:
DataAndUrl
representing the array of obtained data and used url, or null
-
get
Description copied from interface:DataLoader
Execute a HTTP GET operation.- Specified by:
get
in interfaceDataLoader
- Parameters:
url
- the url to access- Returns:
byte
array of obtained data or null
-
get
Description copied from interface:DataLoader
Execute a HTTP GET operation with indication concerning the mandatory nature of the operation.- Specified by:
get
in interfaceDataLoader
- Parameters:
url
- to accessrefresh
- if true indicates that the cached data should be refreshed- Returns:
byte
array of obtained data or null
-
post
Description copied from interface:DataLoader
Executes a HTTP POST operation- Specified by:
post
in interfaceDataLoader
- Parameters:
url
- to accesscontent
- the content to post- Returns:
byte
array of obtained data
-
setContentType
Description copied from interface:DataLoader
This allows to set the content type. Example: Content-Type "application/ocsp-request"- Specified by:
setContentType
in interfaceDataLoader
- Parameters:
contentType
- to set the Content-Type
-
getMaxInputSize
public long getMaxInputSize() -
setMaxInputSize
public void setMaxInputSize(long maxInputSize) -
getTimeout
public long getTimeout() -
setTimeout
public void setTimeout(long timeout)
-