Class CloudStorageOptions
- java.lang.Object
-
- com.google.cloud.storage.contrib.nio.CloudStorageOptions
-
public final class CloudStorageOptions extends Object
Helper class for specifying options when opening and copying Cloud Storage files.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static CloudStorageOption.OpenCopy
withAcl(com.google.cloud.storage.Acl acl)
Sets the ACL value on a Cloud Storage object.static CloudStorageOption.OpenCopy
withBlockSize(int size)
Sets the block size (in bytes) when talking to the Google Cloud Storage server.static CloudStorageOption.OpenCopy
withCacheControl(String cacheControl)
Sets theCache-Control
HTTP header on an object.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.static CloudStorageOption.OpenCopy
withContentDisposition(String contentDisposition)
Sets theContent-Disposition
HTTP header on an object.static CloudStorageOption.OpenCopy
withContentEncoding(String contentEncoding)
Sets theContent-Encoding
HTTP header on an object.static CloudStorageOption.OpenCopy
withMimeType(String mimeType)
Sets the mime type header on an object, e.g.static CloudStorageOption.OpenCopy
withoutCaching()
Disables caching on an object.static CloudStorageOption.OpenCopy
withUserMetadata(String key, String value)
Sets an unmodifiable piece of user metadata on a Cloud Storage object.
-
-
-
Method Detail
-
withMimeType
public static CloudStorageOption.OpenCopy withMimeType(String mimeType)
Sets the mime type header on an object, e.g."text/plain"
.
-
withoutCaching
public static CloudStorageOption.OpenCopy withoutCaching()
Disables caching on an object. Same as:withCacheControl("no-cache")
.
-
withCacheControl
public static CloudStorageOption.OpenCopy withCacheControl(String cacheControl)
Sets theCache-Control
HTTP header on an object.- See Also:
- "https://developers.google.com/storage/docs/reference-headers#cachecontrol"
-
withContentDisposition
public static CloudStorageOption.OpenCopy withContentDisposition(String contentDisposition)
Sets theContent-Disposition
HTTP header on an object.- See Also:
- "https://developers.google.com/storage/docs/reference-headers#contentdisposition"
-
withContentEncoding
public static CloudStorageOption.OpenCopy withContentEncoding(String contentEncoding)
Sets theContent-Encoding
HTTP header on an object.- See Also:
- "https://developers.google.com/storage/docs/reference-headers#contentencoding"
-
withAcl
public static CloudStorageOption.OpenCopy withAcl(com.google.cloud.storage.Acl acl)
Sets the ACL value on a Cloud Storage object.- See Also:
- "https://developers.google.com/storage/docs/reference-headers#acl"
-
withUserMetadata
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"
-
withBlockSize
public static CloudStorageOption.OpenCopy withBlockSize(int size)
Sets the block size (in bytes) when talking to the Google Cloud Storage server.The default is 2097152.
-
withChannelReopen
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.
-
-