code: public InputStream getInputStream() throws IOException {
          if (null == inputStream) {
              if (readFromCache) {
                  inputStream = new FileInputStream(cacheFile.toFile());
              } else {
                  WriteCacheFileInputStream wis = new WriteCacheFileInputStream(delegate.getInputStream(),
                          new FileOutputStream(cacheFile.toFile()));
                  wis.onInputStreamClose(() -> {
                      try {
                          final int responseCode = delegate.getResponseCode();
                          if (responseCode == HTTP_OK) {
                              cache.saveCachedDataInfo(cacheFile, cachedDataInfo);
                          } else {
                              if (logger.isWarnEnabled()) {
                                  logger.warn("not caching because of response code {}: {}", responseCode, getURL());
                              }
                          }
                      } catch (final IOException e) {
                          if (logger.isWarnEnabled()) {
                              logger.warn("cannot retrieve response code");
                          }
                      }
                  });
                  inputStream = wis;
              }
          }
          return inputStream;
      }
docs: return the delegate's InputStream wrapped in a {@link WriteCacheFileInputStream} or a FileInputStream in case
  when the data is already cached.
  
  @return wrapping InputStream
  @throws IOException