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
Implements
SerializableStatic Methods
newBuilder(BlobId blobId)
public static BlobInfo.Builder newBuilder(BlobId blobId)
Returns a BlobInfo
builder where blob identity is set using the provided value.
Name | Description |
blobId | BlobId |
Type | Description |
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.
Name | Description |
bucketInfo | BucketInfo |
name | String |
Type | Description |
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.
Name | Description |
bucketInfo | BucketInfo |
name | String |
generation | Long |
Type | Description |
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.
Name | Description |
bucket | String |
name | String |
Type | Description |
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.
Name | Description |
bucket | String |
name | String |
generation |
|