Class CloudStorageOptions (0.125.0)

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
NameDescription
aclcom.google.cloud.storage.Acl
Returns
TypeDescription
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
NameDescription
sizeint
Returns
TypeDescription
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
NameDescription
cacheControlString
Returns
TypeDescription
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
NameDescription
countint
Returns
TypeDescription
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
NameDescription
contentDispositionString
Returns
TypeDescription
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
NameDescription
contentEncodingString
Returns
TypeDescription
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
NameDescription
mimeTypeString
Returns
TypeDescription
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
NameDescription
keyString
valueString
Returns
TypeDescription
CloudStorageOption.OpenCopy

withoutCaching()

public static CloudStorageOption.OpenCopy withoutCaching()

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

Returns
TypeDescription
CloudStorageOption.OpenCopy