Interface FetchingCacheService
public interface FetchingCacheService
Interface for a cache that downloads resources via URL and stores them on local disk for later reuse.
- Since:
- 4.0.0
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Download a given resource (if not already cached) and copy it to the specified destination.void
Download a given set of resources (if not already cached) and copy them to the specified destinations.
-
Method Details
-
get
Download a given resource (if not already cached) and copy it to the specified destination.- Parameters:
sourceFileUri
- the resource URIdestinationFile
- the location on disk where to copy the resource for use- Throws:
DownloadException
- if the resource is not found or fails to downloadIOException
- if downloading or copying the file to destination fails
-
get
void get(Set<org.apache.commons.lang3.tuple.Pair<URI, File>> sourceDestinationPairs) throws DownloadException, IOExceptionDownload a given set of resources (if not already cached) and copy them to the specified destinations.- Parameters:
sourceDestinationPairs
- a set of resource URIs and their requested local target locations- Throws:
DownloadException
- if the resource is not found or fails to downloadIOException
- if downloading or copying the file to destination fails
-