# Class LocalStorageHelper (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 LocalStorageHelper

Utility to create an in-memory storage configuration for testing. Storage options can be obtained
via the [#getOptions()](https://docs.cloud.google.com/java/docs/reference/google-cloud-nio/latest/com.google.cloud.storage.contrib.nio.testing.LocalStorageHelper#com_google_cloud_storage_contrib_nio_testing_LocalStorageHelper_getOptions__) method. Returned options will point to FakeStorageRpc.

Note, the created in-memory storage configuration supports limited set of operations and is
**not** thread-safe:

- Supported operations
  - object create
  - object get
  - object delete
  - list the contents of a bucket
- Unsupported operations
  - bucket create
  - bucket get
  - bucket delete
  - list all buckets
  - generations
  - file attributes
  - patch
  - continueRewrite
  - createBatch
  - checksums, etags
  - IAM operations

FakeStorageRpc#list(String, java.util.Map) lists all the objects that have been created
rather than the objects in the provided bucket. Since this class does not support creating,
listing and deleting buckets, the parameter bucket here is not actually used and on serves as a
placeholder.

## Inheritance

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

## 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

### customOptions(boolean throwIfOptions)

    public static StorageOptions customOptions(boolean throwIfOptions)

Returns a StorageOptions that creates a new FakeStorageRpc instance with the given
option.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `throwIfOptions` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.cloud.storage.StorageOptions` |   |

### getOptions()

    public static StorageOptions getOptions()

Returns a StorageOptions that use the static FakeStorageRpc instance, and resets it
first so you start from a clean slate. That instance will throw if you pass it any option.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.cloud.storage.StorageOptions` |   |