bucketFromGoogleStorageUrl function

String bucketFromGoogleStorageUrl(
  1. String url
)

Returns a bucket from a given gs:// URL.

Implementation

String bucketFromGoogleStorageUrl(String url) {
  assert(url.startsWith('gs://'));
  int stopIndex = url.indexOf('/', 5);
  int stop = stopIndex == -1 ? url.length : stopIndex;
  return url.substring(5, stop);
}