Interface LocalCache

All Known Implementing Classes:
FileBasedLocalCache, NoOpLocalCache

public interface LocalCache
A cache that stores GET requests to a HTTP url locally
  • Method Summary

    Modifier and Type Method Description
    java.io.InputStream get​(java.net.URL url)  
    void put​(java.net.URL url, java.io.InputStream data)  
  • Method Details

    • get

      java.io.InputStream get​(java.net.URL url) throws java.io.IOException
      Parameters:
      url - the URL request to cache
      Returns:
      a (local) stream to use instead or null.
      Throws:
      java.io.IOException - if the data cannot be read
    • put

      void put​(java.net.URL url, java.io.InputStream data) throws java.io.IOException
      Parameters:
      url - the URL request that should be cached
      data - the input stream that provides the data
      Throws:
      java.io.IOException - if the data cannot be written