Class BlobId (2.36.1)

public final class BlobId implements 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.

Inheritance

Object > BlobId

Implements

Serializable

Static Methods

fromGsUtilUri(String gsUtilUri)

public static BlobId fromGsUtilUri(String gsUtilUri)

Creates a BlobId object.

Parameter
NameDescription
gsUtilUriString

the Storage url to create the blob from

Returns
TypeDescription
BlobId

of(String bucket, String name)

public static BlobId of(String bucket, String name)

Creates a blob identifier. Generation is set to null.

Parameters
NameDescription
bucketString

the name of the bucket that contains the blob

nameString

the name of the blob

Returns
TypeDescription
BlobId

of(String bucket, String name, Long generation)

public static BlobId of(String bucket, String name, Long generation)

Creates a BlobId object.

Parameters
NameDescription
bucketString

name of the containing bucket

nameString

blob's name

generationLong

blob's data generation, used for versioning. If null the identifier refers to the latest blob's generation

Returns
TypeDescription
BlobId

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getBucket()

public String getBucket()

Returns the name of the bucket containing the blob.

Returns
TypeDescription
String

getGeneration()

public Long getGeneration()

Returns blob's data generation. Used for versioning.

Returns
TypeDescription
Long

getName()

public String getName()

Returns the name of the blob.

Returns
TypeDescription
String

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

toGsUtilUri()

public String toGsUtilUri()

Returns this blob's Storage url which can be used with gsutil. If #generation is non-null it will not be included in the uri.

Returns
TypeDescription
String

toGsUtilUriWithGeneration()

public String toGsUtilUriWithGeneration()

Returns this blob's Storage url which can be used with gsutil. If #generation is non-null it will be included in the uri

Returns
TypeDescription
String

toString()

public String toString()
Returns
TypeDescription
String
Overrides