Class BlobInfo (2.20.1)

Stay organized with collections Save and categorize content based on your preferences.
public class BlobInfo implements Serializable

Information about an object in Google Cloud Storage. A BlobInfo object includes the BlobId instance and the set of properties, such as the blob's access control configuration, user provided metadata, the CRC32C checksum, etc. Instances of this class are used to create a new object in Google Cloud Storage or update the properties of an existing object. To deal with existing Storage objects the API includes the Blob class which extends BlobInfo and declares methods to perform operations on the object. Neither BlobInfo nor Blob instances keep the object content, just the object properties.

Example of usage BlobInfo to create an object in Google Cloud Storage:


 BlobId blobId = BlobId.of(bucketName, blobName);
 BlobInfo blobInfo = BlobInfo.newBuilder(blobId).setContentType("text/plain").build();
 Blob blob = storage.create(blobInfo, "Hello, world".getBytes(StandardCharsets.UTF_8));
 

See Also: Concepts and Terminology

Inheritance

Object > BlobInfo

Implements

Serializable

Static Methods

newBuilder(BlobId blobId)

public static BlobInfo.Builder newBuilder(BlobId blobId)

Returns a BlobInfo builder where blob identity is set using the provided value.

Parameter
NameDescription
blobIdBlobId
Returns
TypeDescription
BlobInfo.Builder

newBuilder(BucketInfo bucketInfo, String name)

public static BlobInfo.Builder newBuilder(BucketInfo bucketInfo, String name)

Returns a BlobInfo builder where blob identity is set using the provided values.

Parameters
NameDescription
bucketInfoBucketInfo
nameString
Returns
TypeDescription
BlobInfo.Builder

newBuilder(BucketInfo bucketInfo, String name, Long generation)

public static BlobInfo.Builder newBuilder(BucketInfo bucketInfo, String name, Long generation)

Returns a BlobInfo builder where blob identity is set using the provided values.

Parameters
NameDescription
bucketInfoBucketInfo
nameString
generationLong
Returns
TypeDescription
BlobInfo.Builder

newBuilder(String bucket, String name)

public static BlobInfo.Builder newBuilder(String bucket, String name)

Returns a BlobInfo builder where blob identity is set using the provided values.

Parameters
NameDescription
bucketString
nameString
Returns
TypeDescription
BlobInfo.Builder

newBuilder(String bucket, String name, Long generation)

public static BlobInfo.Builder newBuilder(String bucket, String name, Long generation)

Returns a BlobInfo builder where blob identity is set using the provided values.

Parameters
NameDescription
bucketString
nameString
generation