# Class CloudStorageOptions (0.133.0)

0.133.0 (latest) 0.131.0 0.128.13 0.127.38 0.126.19 0.125.0 0.124.21 0.123.28

    public final class CloudStorageOptions

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

## Inheritance

[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> CloudStorageOptions

## Inherited Members

[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) [Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) [Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) [Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) [Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) [Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) [Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) [Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) [Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) [Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) [Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)

## 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** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-nio/latest/com.google.cloud.storage.contrib.nio.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` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-nio/latest/com.google.cloud.storage.contrib.nio.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` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-nio/latest/com.google.cloud.storage.contrib.nio.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` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-nio/latest/com.google.cloud.storage.contrib.nio.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` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-nio/latest/com.google.cloud.storage.contrib.nio.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` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-nio/latest/com.google.cloud.storage.contrib.nio.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` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-nio/latest/com.google.cloud.storage.contrib.nio.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` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |
| `value` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-nio/latest/com.google.cloud.storage.contrib.nio.CloudStorageOption.OpenCopy` |   |

### withoutCaching()

    public static CloudStorageOption.OpenCopy withoutCaching()

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-nio/latest/com.google.cloud.storage.contrib.nio.CloudStorageOption.OpenCopy` |   |