Class CloudStorageOptions (0.127.16)

public final class CloudStorageOptions

Helper class for specifying options when opening and copying Cloud Storage files.

Inheritance

java.lang.Object > CloudStorageOptions

Static Methods

withAcl(Acl acl)

public static CloudStorageOption.OpenCopy withAcl(Acl acl)

Sets the ACL value on a Cloud Storage object. See Also: "https://developers.google.com/storage/docs/reference-headers#acl"

Parameter
Name Description
acl com.google.cloud.storage.Acl
Returns
Type Description
CloudStorageOption.OpenCopy

withBlockSize(int size)

public static CloudStorageOption.OpenCopy withBlockSize(int size)

Sets the block size (in bytes) when talking to the Google Cloud Storage server.

The default is {@value CloudStorageFileSystem#BLOCK_SIZE_DEFAULT}.

Parameter
Name Description
size int
Returns
Type Description
CloudStorageOption.OpenCopy

withCacheControl(String cacheControl)

public static CloudStorageOption.OpenCopy withCacheControl(String cacheControl)

Sets the Cache-Control HTTP header on an object. See Also: "https://developers.google.com/storage/docs/reference-headers#cachecontrol"

Parameter
Name Description
cacheControl String
Returns
Type Description
CloudStorageOption.OpenCopy

withChannelReopen(int count)

public static CloudStorageOption.OpenCopy withChannelReopen(int count)

Sets the max number of times that the channel can be reopened if reading fails because the channel unexpectedly closes.

The default is 0.

Parameter
Name Description
count int
Returns
Type Description
CloudStorageOption.OpenCopy

withContentDisposition(String contentDisposition)

public static CloudStorageOption.OpenCopy withContentDisposition(String contentDisposition)

Sets the Content-Disposition HTTP header on an object. See Also: "https://developers.google.com/storage/docs/reference-headers#contentdisposition"

Parameter
Name Description
contentDisposition String
Returns
Type Description
CloudStorageOption.OpenCopy

withContentEncoding(String contentEncoding)

public static CloudStorageOption.OpenCopy withContentEncoding(String contentEncoding)

Sets the Content-Encoding HTTP header on an object. See Also: "https://developers.google.com/storage/docs/reference-headers#contentencoding"

Parameter
Name Description
contentEncoding String
Returns
Type Description
CloudStorageOption.OpenCopy

withMimeType(String mimeType)

public static CloudStorageOption.OpenCopy withMimeType(String mimeType)

Sets the mime type header on an object, e.g. "text/plain".

Parameter
Name Description
mimeType String
Returns
Type Description
CloudStorageOption.OpenCopy

withUserMetadata(String key, String value)

public static CloudStorageOption.OpenCopy withUserMetadata(String key, String value)

Sets an unmodifiable piece of user metadata on a Cloud Storage object. See Also: "https://developers.google.com/storage/docs/reference-headers#xgoogmeta"

Parameters
Name Description
key String
value String
Returns
Type Description
CloudStorageOption.OpenCopy

withoutCaching()

public static CloudStorageOption.OpenCopy withoutCaching()

Disables caching on an object. Same as: withCacheControl("no-cache").

Returns
Type Description
CloudStorageOption.OpenCopy