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 Type
    Method
    Description
    void
    get(URI sourceFileUri, File destinationFile)
    Download a given resource (if not already cached) and copy it to the specified destination.
    void
    get(Set<org.apache.commons.lang3.tuple.Pair<URI,File>> sourceDestinationPairs)
    Download a given set of resources (if not already cached) and copy them to the specified destinations.
  • Method Details

    • get

      void get(URI sourceFileUri, File destinationFile) throws DownloadException, IOException
      Download a given resource (if not already cached) and copy it to the specified destination.
      Parameters:
      sourceFileUri - the resource URI
      destinationFile - the location on disk where to copy the resource for use
      Throws:
      DownloadException - if the resource is not found or fails to download
      IOException - if downloading or copying the file to destination fails
    • get

      void get(Set<org.apache.commons.lang3.tuple.Pair<URI,File>> sourceDestinationPairs) throws DownloadException, IOException
      Download 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 download
      IOException - if downloading or copying the file to destination fails