public final class BlobId extends Object implements Serializable
BlobId
object includes the name of the containing
bucket, the blob's name and possibly the blob's generation. If getGeneration()
is null
the identifier refers to the latest blob's generation.Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
static BlobId |
fromGsUtilUri(String gsUtilUri)
Creates a
BlobId object. |
String |
getBucket()
Returns the name of the bucket containing the blob.
|
Long |
getGeneration()
Returns blob's data generation.
|
String |
getName()
Returns the name of the blob.
|
int |
hashCode() |
static BlobId |
of(String bucket,
String name)
Creates a blob identifier.
|
static BlobId |
of(String bucket,
String name,
Long generation)
Creates a
BlobId object. |
String |
toGsUtilUri()
Returns this blob's Storage url which can be used with gsutil.
|
String |
toGsUtilUriWithGeneration()
Returns this blob's Storage url which can be used with gsutil.
|
String |
toString() |
public String getBucket()
public String getName()
public Long getGeneration()
public String toGsUtilUri()
generation
is
non-null it will not be included in the uri.public String toGsUtilUriWithGeneration()
generation
is
non-null it will be included in the uripublic static BlobId of(String bucket, String name)
null
.bucket
- the name of the bucket that contains the blobname
- the name of the blobpublic static BlobId of(String bucket, String name, Long generation)
BlobId
object.bucket
- name of the containing bucketname
- blob's namegeneration
- blob's data generation, used for versioning. If null
the identifier
refers to the latest blob's generationCopyright © 2023 Google LLC. All rights reserved.