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.OpenCopywithAcl(com.google.cloud.storage.Acl acl)Sets the ACL value on a Cloud Storage object.static CloudStorageOption.OpenCopywithBlockSize(int size)Sets the block size (in bytes) when talking to the Google Cloud Storage server.static CloudStorageOption.OpenCopywithCacheControl(String cacheControl)Sets theCache-ControlHTTP header on an object.static CloudStorageOption.OpenCopywithChannelReopen(int count)Sets the max number of times that the channel can be reopened if reading fails because the channel unexpectedly closes.static CloudStorageOption.OpenCopywithContentDisposition(String contentDisposition)Sets theContent-DispositionHTTP header on an object.static CloudStorageOption.OpenCopywithContentEncoding(String contentEncoding)Sets theContent-EncodingHTTP header on an object.static CloudStorageOption.OpenCopywithMimeType(String mimeType)Sets the mime type header on an object, e.g.static CloudStorageOption.OpenCopywithoutCaching()Disables caching on an object.static CloudStorageOption.OpenCopywithUserMetadata(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-ControlHTTP 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-DispositionHTTP 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-EncodingHTTP 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.
-
-