Class MemoryDataLoader
- java.lang.Object
-
- eu.europa.esig.dss.spi.client.http.MemoryDataLoader
-
- All Implemented Interfaces:
DataLoader,Serializable
public class MemoryDataLoader extends Object implements DataLoader
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface eu.europa.esig.dss.spi.client.http.DataLoader
DataLoader.DataAndUrl
-
-
Constructor Summary
Constructors Constructor Description MemoryDataLoader(Map<String,byte[]> dataMap)
-
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.DataAndUrlget(List<String> urlStrings)Execute a HTTP GET operation.byte[]post(String url, byte[] content)Executes a HTTP POST operationvoidsetContentType(String contentType)This allows to set the content type.
-
-
-
Method Detail
-
get
public byte[] get(String url)
Description copied from interface:DataLoaderExecute a HTTP GET operation.- Specified by:
getin interfaceDataLoader- Parameters:
url- the url to access- Returns:
bytearray of obtained data or null
-
get
public DataLoader.DataAndUrl get(List<String> urlStrings)
Description copied from interface:DataLoaderExecute 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:
getin interfaceDataLoader- Parameters:
urlStrings-ListofStrings representing the URLs to be used in sequential way to obtain the data.- Returns:
DataAndUrlrepresenting the array of obtained data and used url, or null
-
get
public byte[] get(String url, boolean refresh)
Description copied from interface:DataLoaderExecute a HTTP GET operation with indication concerning the mandatory nature of the operation.- Specified by:
getin interfaceDataLoader- Parameters:
url- to accessrefresh- if true indicates that the cached data should be refreshed- Returns:
bytearray of obtained data or null
-
post
public byte[] post(String url, byte[] content)
Description copied from interface:DataLoaderExecutes a HTTP POST operation- Specified by:
postin interfaceDataLoader- Parameters:
url- to accesscontent- the content to post- Returns:
bytearray of obtained data
-
setContentType
public void setContentType(String contentType)
Description copied from interface:DataLoaderThis allows to set the content type. Example: Content-Type "application/ocsp-request"- Specified by:
setContentTypein interfaceDataLoader- Parameters:
contentType- to set the Content-Type
-
-