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.
Implements
SerializableStatic Methods
fromGsUtilUri(String gsUtilUri)
public static BlobId fromGsUtilUri(String gsUtilUri)
Creates a BlobId
object.
Parameter | |
---|---|
Name | Description |
gsUtilUri | String the Storage url to create the blob from |
Returns | |
---|---|
Type | Description |
BlobId |
of(String bucket, String name)
public static BlobId of(String bucket, String name)
Creates a blob identifier. Generation is set to null
.
Parameters | |
---|---|
Name | Description |
bucket | String the name of the bucket that contains the blob |
name | String the name of the blob |
Returns | |
---|---|
Type | Description |
BlobId |
of(String bucket, String name, Long generation)
public static BlobId of(String bucket, String name, Long generation)
Creates a BlobId
object.
Parameters | |
---|---|
Name | Description |
bucket | String name of the containing bucket |
name | String blob's name |
generation | Long blob's data generation, used for versioning. If |
Returns | |
---|---|
Type | Description |
BlobId |
Methods
equals(Object obj)
public boolean equals(Object obj)
Parameter | |
---|---|
Name | Description |
obj | Object |
Returns | |
---|---|
Type | Description |
boolean |
getBucket()
public String getBucket()
Returns the name of the bucket containing the blob.
Returns | |
---|---|
Type | Description |
String |
getGeneration()
public Long getGeneration()
Returns blob's data generation. Used for versioning.
Returns | |
---|---|
Type | Description |
Long |
getName()
public String getName()
Returns the name of the blob.
Returns | |
---|---|
Type | Description |
String |
hashCode()
public int hashCode()
Returns | |
---|---|
Type | Description |
int |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
String |
toString()
public String toString()
Returns | |
---|---|
Type | Description |
String |