code: @Override
    public GoogleCloudStorageItemInfo getItemInfo(StorageResourceId resourceId)
        throws IOException {
      logger.atFine().log("getItemInfo(%s)", resourceId);
  
      // Handle ROOT case first.
      if (resourceId.isRoot()) {
        return GoogleCloudStorageItemInfo.ROOT_INFO;
      }
  
      GoogleCloudStorageItemInfo itemInfo = null;
  
      // Determine object size.
      //
      // For buckets, size is 0.
      // For objects not found, size is -1.
      // For objects that exist, size is in number of bytes.
      if (resourceId.isBucket()) {
        Bucket bucket = getBucket(resourceId.getBucketName());
        if (bucket != null) {
          itemInfo = createItemInfoForBucket(resourceId, bucket);
        }
      } else {
        StorageObject object = getObject(resourceId);
        if (object != null) {
          itemInfo = createItemInfoForStorageObject(resourceId, object);
        }
      }
  
      if (itemInfo == null) {
        itemInfo = GoogleCloudStorageItemInfo.createNotFound(resourceId);
      }
      logger.atFine().log("getItemInfo: %s", itemInfo);
      return itemInfo;
    }
docs: See {@link GoogleCloudStorage#getItemInfo(StorageResourceId)} for details about expected
  behavior.