Class Bucket.BlobWriteOption (2.27.1-SNAPSHOT)

public static class Bucket.BlobWriteOption extends Option<UnifiedOpts.ObjectTargetOpt> implements Serializable

Class for specifying blob write options when Bucket methods are used.

Inheritance

java.lang.Object > com.google.cloud.storage.UnifiedOpts.OptionShim > Option > Bucket.BlobWriteOption

Implements

Serializable

Static Methods

crc32cMatch(@NonNull String crc32c)

public static Bucket.BlobWriteOption crc32cMatch(@NonNull String crc32c)

Returns an option for blob's data CRC32C checksum match. If this option is used the request will fail if blobs' data CRC32C checksum does not match the provided value.

Parameter
NameDescription
crc32c@org.checkerframework.checker.nullness.qual.NonNull java.lang.String
Returns
TypeDescription
Bucket.BlobWriteOption

dedupe(Bucket.BlobWriteOption[] os)

public static Bucket.BlobWriteOption[] dedupe(Bucket.BlobWriteOption[] os)

Deduplicate any options which are the same parameter. The value which comes last in os will be the value included in the return.

Parameter
NameDescription
osBlobWriteOption[]
Returns
TypeDescription
BlobWriteOption[]

dedupe(Bucket.BlobWriteOption[] array, Bucket.BlobWriteOption[] os)

public static Bucket.BlobWriteOption[] dedupe(Bucket.BlobWriteOption[] array, Bucket.BlobWriteOption[] os)

Deduplicate any options which are the same parameter.

The value which comes last in collection and os will be the value included in the return. All options from os will override their counterparts in collection.

Parameters
NameDescription
arrayBlobWriteOption[]
osBlobWriteOption[]
Returns
TypeDescription
BlobWriteOption[]

dedupe(Collection<Bucket.BlobWriteOption> collection, Bucket.BlobWriteOption[] os)

public static Bucket.BlobWriteOption[] dedupe(Collection<Bucket.BlobWriteOption> collection, Bucket.BlobWriteOption[] os)

Deduplicate any options which are the same parameter.

The value which comes last in collection and os will be the value included in the return. All options from os will override their counterparts in collection.

Parameters
NameDescription
collectionCollection<BlobWriteOption>
osBlobWriteOption[]
Returns
TypeDescription
BlobWriteOption[]

doesNotExist()

public static Bucket.BlobWriteOption doesNotExist()

Returns an option that causes an operation to succeed only if the target blob does not exist. This option can not be provided together with #generationMatch(long) or #generationNotMatch(long).

Returns
TypeDescription
Bucket.BlobWriteOption

encryptionKey(@NonNull String key)

public static Bucket.BlobWriteOption encryptionKey(@NonNull String key)

Returns an option to set a customer-supplied AES256 key for server-side encryption of the blob.

Parameter
NameDescription
key@org.checkerframework.checker.nullness.qual.NonNull java.lang.String

the AES256 encoded in base64

Returns
TypeDescription
Bucket.BlobWriteOption

encryptionKey(@NonNull Key key)

public static Bucket.BlobWriteOption encryptionKey(@NonNull Key key)

Returns an option to set a customer-supplied AES256 key for server-side encryption of the blob.

Parameter
NameDescription
key@org.checkerframework.checker.nullness.qual.NonNull java.security.Key
Returns
TypeDescription
Bucket.BlobWriteOption

generationMatch(long generation)

public static Bucket.BlobWriteOption generationMatch(long generation)

Returns an option for blob's data generation match. If this option is used the request will fail if generation does not match the provided value. This option can not be provided together with #generationNotMatch(long) or #doesNotExist().

Parameter
NameDescription
generationlong
Returns
TypeDescription
Bucket.BlobWriteOption

generationNotMatch(long generation)

public static Bucket.BlobWriteOption generationNotMatch(long generation)

Returns an option for blob's data generation mismatch. If this option is used the request will fail if generation matches the provided value. This option can not be provided together with #generationMatch(long) or #doesNotExist().

Parameter
NameDescription
generationlong
Returns
TypeDescription
Bucket.BlobWriteOption

md5Match(@NonNull String md5)

public static Bucket.BlobWriteOption md5Match(@NonNull String md5)

Returns an option for blob's data MD5 hash match. If this option is used the request will fail if blobs' data MD5 hash does not match the provided value.

Parameter
NameDescription
md5@org.checkerframework.checker.nullness.qual.NonNull java.lang.String
Returns
TypeDescription
Bucket.BlobWriteOption

metagenerationMatch(long metageneration)

public static Bucket.BlobWriteOption metagenerationMatch(long metageneration)

Returns an option for blob's metageneration match. If this option is used the request will fail if metageneration does not match the provided value. This option can not be provided together with #metagenerationNotMatch(long).

Parameter
NameDescription
metagenerationlong
Returns
TypeDescription
Bucket.BlobWriteOption

metagenerationNotMatch(long metageneration)

public static Bucket.BlobWriteOption metagenerationNotMatch(long metageneration)

Returns an option for blob's metageneration mismatch. If this option is used the request will fail if metageneration matches the provided value. This option can not be provided together with #metagenerationMatch(long).

Parameter
NameDescription
metagenerationlong
Returns
TypeDescription
Bucket.BlobWriteOption

predefinedAcl(@NonNull Storage.PredefinedAcl acl)

public static Bucket.BlobWriteOption predefinedAcl(@NonNull Storage.PredefinedAcl acl)

Returns an option for specifying blob's predefined ACL configuration.

Parameter
NameDescription
acl@org.checkerframework.checker.nullness.qual.NonNull com.google.cloud.storage.Storage.PredefinedAcl
Returns
TypeDescription
Bucket.BlobWriteOption

userProject(@NonNull String userProject)

public static Bucket.BlobWriteOption userProject(@NonNull String userProject)

Returns an option for blob's billing user project. This option is only used by the buckets with 'requester_pays' flag.

Parameter
NameDescription
userProject@org.checkerframework.checker.nullness.qual.NonNull java.lang.String
Returns
TypeDescription
Bucket.BlobWriteOption