Package com.google.cloud.storage
Class BlobId
java.lang.Object
com.google.cloud.storage.BlobId
- All Implemented Interfaces:
Serializable
Google Storage Object identifier. A
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.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionboolean
static BlobId
fromGsUtilUri
(String gsUtilUri) Creates aBlobId
object.Returns the name of the bucket containing the blob.Returns blob's data generation.getName()
Returns the name of the blob.int
hashCode()
static BlobId
Creates a blob identifier.static BlobId
Creates aBlobId
object.Returns this blob's Storage url which can be used with gsutil.Returns this blob's Storage url which can be used with gsutil.toString()
-
Method Details
-
getBucket
Returns the name of the bucket containing the blob. -
getName
Returns the name of the blob. -
getGeneration
Returns blob's data generation. Used for versioning. -
toGsUtilUri
Returns this blob's Storage url which can be used with gsutil. Ifgeneration
is non-null it will not be included in the uri. -
toGsUtilUriWithGeneration
Returns this blob's Storage url which can be used with gsutil. Ifgeneration
is non-null it will be included in the uri- Since:
- 2.22.1
-
toString
-
hashCode
public int hashCode() -
equals
-
of
Creates a blob identifier. Generation is set tonull
.- Parameters:
bucket
- the name of the bucket that contains the blobname
- the name of the blob
-
of
Creates aBlobId
object.- Parameters:
bucket
- name of the containing bucketname
- blob's namegeneration
- blob's data generation, used for versioning. Ifnull
the identifier refers to the latest blob's generation
-
fromGsUtilUri
Creates aBlobId
object.- Parameters:
gsUtilUri
- the Storage url to create the blob from
-