code: public static File
              downloadResource(String remoteLocation, ResourceType type)
                      throws ResourceDownloadError {
          String localResourcePath = getResourceFolderPath(type) + File.separator
                  + encodeLocation(remoteLocation);
  
          String localResourceLocation =
                  CacheLookupService.DEFAULT_RESOURCE_FILE_NAME
                          + type.getResourceExtension();
  
          File latestResource = resolveResource(remoteLocation,
                  localResourcePath, localResourceLocation);
  
          // attempt to download resource hash
          String remoteHashLocation = remoteLocation + SHA256_EXTENSION;
          String localHashLocation = localResourceLocation + SHA256_EXTENSION;
  
          try {
              resolveResource(remoteHashLocation, localResourcePath,
                      localHashLocation);
          } catch (ResourceDownloadError e) {
              // remote hash does not exist but create local hash
              createLocalHash(latestResource, remoteLocation);
          }
  
          return latestResource;
      }
docs: Download the resource and hash the contents using {@link Hasher}.
  
  @param remoteLocation {@link String}, the remote resource location
  @param type {@link ResourceType}, the resource type
  @return {@link File} the downloaded resource file, decompressed if the
  file is in GZIP format
  @throws ResourceDownloadError Thrown if the remote resource could not
  be downloaded
  @throws IOException Thrown if an IO error occurred while handling the
  resources