docs: @SuppressWarnings("unchecked")
      private void storeETag(HttpHost host, String file, HttpResponse response)
              throws IOException {
          //get ETag header
          Header etagHdr = response.getFirstHeader("ETag");
          if (etagHdr == null) {
              if (!quiet) {
                  project.getLogger().warn("Server response does not include an "
                          + "entity tag (ETag).");
              }
              return;
          }
          String etag = etagHdr.getValue();
  
          //handle weak ETags
          if (isWeakETag(etag)) {
              if (useETag.displayWarningForWeak && !quiet) {
                  project.getLogger().warn("Weak entity tag (ETag) encountered. "
                          + "Please make sure you want to compare resources based on "
                          + "weak ETags. If yes, set the 'useETag' flag to \"all\", "
                          + "otherwise set it to \"strongOnly\".");
              }
              if (!useETag.useWeakETags) {
                  //do not save weak etags
                  return;
              }
          }
  
          //create directory for cached etags file
          File parent = getCachedETagsFile().getParentFile();
          if (parent != null) {
              parent.mkdirs();
          }
  
          //read existing cached etags file
          Map<String, Object> cachedETags = readCachedETags();
  
          //create new entry in cached ETags file
          Map<String, String> etagMap = new LinkedHashMap<String, String>();
          etagMap.put("ETag", etag);
  
          String uri = host.toURI();
          Map<String, Object> hostMap = (Map<String, Object>)cachedETags.get(uri);
          if (hostMap == null) {
              hostMap = new LinkedHashMap<String, Object>();
              cachedETags.put(uri, hostMap);
          }
          hostMap.put(file, etagMap);
  
          //write cached ETags file
          String cachedETagsContents = JsonOutput.toJson(cachedETags);
          PrintWriter writer = new PrintWriter(getCachedETagsFile(), "UTF-8");
          try {
              writer.write(cachedETagsContents);
              writer.flush();
          } finally {
              writer.close();
          }
      }