code: @Override
    public GoogleCloudStorageItemInfo getItemInfo(StorageResourceId resourceId) throws IOException {
      // Get the item from cache.
      GoogleCloudStorageItemInfo item = cache.getItem(resourceId);
  
      // If it wasn't in the cache, list all the objects in the parent directory and cache them
      // and then retrieve it from the cache.
      if (item == null && resourceId.isStorageObject()) {
        String bucketName = resourceId.getBucketName();
        String objectName = resourceId.getObjectName();
        int lastSlashIndex = objectName.lastIndexOf(PATH_DELIMITER);
        String directoryName =
            lastSlashIndex >= 0 ? objectName.substring(0, lastSlashIndex + 1) : null;
        List<GoogleCloudStorageItemInfo> cachedInDirectory =
            cache.listItems(bucketName, directoryName);
        filter(cachedInDirectory, bucketName, directoryName, PATH_DELIMITER);
        // If there are items already cached in directory, do not prefetch with list requests,
        // because metadata for this directory already could be prefetched
        if (cachedInDirectory.isEmpty()) {
          // make just 1 request to prefetch only 1 page of directory items
          listObjectInfoPage(bucketName, directoryName, PATH_DELIMITER, /* pageToken= */ null);
          item = cache.getItem(resourceId);
        }
      }
  
      // If it wasn't in the cache and wasn't cached in directory list request
      // then request and cache it directly.
      if (item == null) {
        item = super.getItemInfo(resourceId);
        cache.putItem(item);
      }
  
      return item;
    }
docs: This function may return cached copies of GoogleCloudStorageItemInfo.