# Class CloudStorageFileSystemProvider (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 CloudStorageFileSystemProvider extends FileSystemProvider

Google Cloud Storage [FileSystemProvider](https://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileSystemProvider.html) implementation.

**Note:** This class should never be used directly. This class is instantiated by the
service loader and called through a standardized API, e.g. java.nio.file.Files. However
the javadocs in this class serve as useful documentation for the behavior of the Google Cloud
Storage NIO library.

## Inheritance

[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> [FileSystemProvider](https://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileSystemProvider.html) \> CloudStorageFileSystemProvider

## 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-) [FileSystemProvider.\<A\>readAttributes(Path,Class\<A\>,LinkOption)](https://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileSystemProvider.html#<A>readAttributes-java.nio.file.Path-java.lang.Class<A>-java.nio.file.LinkOption...-) [FileSystemProvider.\<V\>getFileAttributeView(Path,Class\<V\>,LinkOption)](https://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileSystemProvider.html#<V>getFileAttributeView-java.nio.file.Path-java.lang.Class<V>-java.nio.file.LinkOption...-) [FileSystemProvider.checkAccess(Path,AccessMode)](https://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileSystemProvider.html#checkAccess-java.nio.file.Path-java.nio.file.AccessMode...-) [FileSystemProvider.copy(Path,Path,CopyOption)](https://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileSystemProvider.html#copy-java.nio.file.Path-java.nio.file.Path-java.nio.file.CopyOption...-) [FileSystemProvider.createDirectory(Path,FileAttribute\<?\>...)](https://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileSystemProvider.html#createDirectory-java.nio.file.Path-java.nio.file.attribute.FileAttribute<?>...-) [FileSystemProvider.createLink(Path,Path)](https://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileSystemProvider.html#createLink-java.nio.file.Path-java.nio.file.Path-) [FileSystemProvider.createSymbolicLink(Path,Path,FileAttribute\<?\>...)](https://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileSystemProvider.html#createSymbolicLink-java.nio.file.Path-java.nio.file.Path-java.nio.file.attribute.FileAttribute<?>...-) [FileSystemProvider.delete(Path)](https://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileSystemProvider.html#delete-java.nio.file.Path-) [FileSystemProvider.deleteIfExists(Path)](https://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileSystemProvider.html#deleteIfExists-java.nio.file.Path-) [FileSystemProvider.getFileStore(Path)](https://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileSystemProvider.html#getFileStore-java.nio.file.Path-) [FileSystemProvider.getFileSystem(URI)](https://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileSystemProvider.html#getFileSystem-java.net.URI-) [FileSystemProvider.getPath(URI)](https://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileSystemProvider.html#getPath-java.net.URI-) [FileSystemProvider.getScheme()](https://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileSystemProvider.html#getScheme--) [FileSystemProvider.installedProviders()](https://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileSystemProvider.html#installedProviders--) [FileSystemProvider.isHidden(Path)](https://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileSystemProvider.html#isHidden-java.nio.file.Path-) [FileSystemProvider.isSameFile(Path,Path)](https://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileSystemProvider.html#isSameFile-java.nio.file.Path-java.nio.file.Path-) [FileSystemProvider.move(Path,Path,CopyOption)](https://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileSystemProvider.html#move-java.nio.file.Path-java.nio.file.Path-java.nio.file.CopyOption...-) [FileSystemProvider.newAsynchronousFileChannel(Path,Set\<? extends OpenOption\>,ExecutorService,FileAttribute\<?\>...)](https://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileSystemProvider.html#newAsynchronousFileChannel-java.nio.file.Path-java.util.Set<? extends java.nio.file.OpenOption>-java.util.concurrent.ExecutorService-java.nio.file.attribute.FileAttribute<?>...-) [FileSystemProvider.newByteChannel(Path,Set\<? extends OpenOption\>,FileAttribute\<?\>...)](https://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileSystemProvider.html#newByteChannel-java.nio.file.Path-java.util.Set<? extends java.nio.file.OpenOption>-java.nio.file.attribute.FileAttribute<?>...-) [FileSystemProvider.newDirectoryStream(Path,DirectoryStream.Filter\<? super Path\>)](https://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileSystemProvider.html#newDirectoryStream-java.nio.file.Path-java.nio.file.DirectoryStream.Filter<? super java.nio.file.Path>-) [FileSystemProvider.newFileChannel(Path,Set\<? extends OpenOption\>,FileAttribute\<?\>...)](https://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileSystemProvider.html#newFileChannel-java.nio.file.Path-java.util.Set<? extends java.nio.file.OpenOption>-java.nio.file.attribute.FileAttribute<?>...-) [FileSystemProvider.newFileSystem(URI,Map\<String,?\>)](https://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileSystemProvider.html#newFileSystem-java.net.URI-java.util.Map<java.lang.String-?>-) [FileSystemProvider.newFileSystem(Path,Map\<String,?\>)](https://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileSystemProvider.html#newFileSystem-java.nio.file.Path-java.util.Map<java.lang.String-?>-) [FileSystemProvider.newInputStream(Path,OpenOption)](https://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileSystemProvider.html#newInputStream-java.nio.file.Path-java.nio.file.OpenOption...-) [FileSystemProvider.newOutputStream(Path,OpenOption)](https://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileSystemProvider.html#newOutputStream-java.nio.file.Path-java.nio.file.OpenOption...-) [FileSystemProvider.readAttributes(Path,String,LinkOption)](https://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileSystemProvider.html#readAttributes-java.nio.file.Path-java.lang.String-java.nio.file.LinkOption...-) [FileSystemProvider.readSymbolicLink(Path)](https://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileSystemProvider.html#readSymbolicLink-java.nio.file.Path-) [FileSystemProvider.setAttribute(Path,String,Object,LinkOption)](https://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileSystemProvider.html#setAttribute-java.nio.file.Path-java.lang.String-java.lang.Object-java.nio.file.LinkOption...-)

## Static Methods

### setDefaultCloudStorageConfiguration(CloudStorageConfiguration newDefault)

    public static void setDefaultCloudStorageConfiguration(CloudStorageConfiguration newDefault)

Changes the default configuration for every filesystem object created from here on, including
via SPI. If null then future filesystem objects will have the factory default configuration.

If options are specified later then they override the defaults. Methods that take a whole
CloudStorageConfiguration (eg. CloudStorageFileSystem.forBucket) will completely override the
defaults. Methods that take individual options (eg.
CloudStorageFileSystemProvier.newFileSystem) will override only these options; the rest will be
taken from the defaults specified here.

This is meant to be done only once, at the beginning of some main program, in order to force
all libraries to use some settings we like.

Libraries should never call this. If you're a library then, instead, create your own
filesystem object with the right configuration and pass it along.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `newDefault` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-nio/latest/com.google.cloud.storage.contrib.nio.CloudStorageConfiguration` new default CloudStorageConfiguration |

### setStorageOptions(StorageOptions newStorageOptions)

    public static void setStorageOptions(StorageOptions newStorageOptions)

Sets options that are only used by the constructor.

Instead of calling this, when possible use CloudStorageFileSystem.forBucket and pass
StorageOptions as an argument.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `newStorageOptions` | `com.google.cloud.storage.StorageOptions` |

## Constructors

### CloudStorageFileSystemProvider()

    public CloudStorageFileSystemProvider()

Default constructor which should only be called by Java SPI.
See Also: [CloudStorageFileSystem#forBucket(String)](https://docs.cloud.google.com/java/docs/reference/google-cloud-nio/latest/com.google.cloud.storage.contrib.nio.CloudStorageFileSystem#com_google_cloud_storage_contrib_nio_CloudStorageFileSystem_forBucket_java_lang_String_), java.nio.file.FileSystems#getFileSystem(URI)

## Methods

### \<A\>readAttributes(Path path, Class\<A\> type, LinkOption\[\] options)

    public A <A>readAttributes(Path path, Class<A> type, LinkOption[] options)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `path` | `https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html` |
| `type` | `https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html<A>` |
| `options` | `java.nio.file.LinkOption[]` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `A` |   |

**Overrides** [FileSystemProvider.\<A\>readAttributes(Path,Class\<A\>,LinkOption)](https://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileSystemProvider.html#<A>readAttributes-java.nio.file.Path-java.lang.Class<A>-java.nio.file.LinkOption...-)

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |

### \<V\>getFileAttributeView(Path path, Class\<V\> type, LinkOption\[\] options)

    public V <V>getFileAttributeView(Path path, Class<V> type, LinkOption[] options)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `path` | `https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html` |
| `type` | `https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html<V>` |
| `options` | `java.nio.file.LinkOption[]` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `V` |   |

**Overrides** [FileSystemProvider.\<V\>getFileAttributeView(Path,Class\<V\>,LinkOption)](https://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileSystemProvider.html#<V>getFileAttributeView-java.nio.file.Path-java.lang.Class<V>-java.nio.file.LinkOption...-)

### checkAccess(Path path, AccessMode\[\] modes)

    public void checkAccess(Path path, AccessMode[] modes)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `path` | `https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html` |
| `modes` | `java.nio.file.AccessMode[]` |

**Overrides** [FileSystemProvider.checkAccess(Path,AccessMode)](https://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileSystemProvider.html#checkAccess-java.nio.file.Path-java.nio.file.AccessMode...-)

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |

### copy(Path source, Path target, CopyOption\[\] options)

    public void copy(Path source, Path target, CopyOption[] options)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `source` | `https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html` |
| `target` | `https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html` |
| `options` | `https://docs.oracle.com/javase/8/docs/api/java/nio/file/CopyOption.html[]` |

**Overrides** [FileSystemProvider.copy(Path,Path,CopyOption)](https://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileSystemProvider.html#copy-java.nio.file.Path-java.nio.file.Path-java.nio.file.CopyOption...-)

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |

### createDirectory(Path dir, FileAttribute\<?\>\[\] attrs)

    public void createDirectory(Path dir, FileAttribute<?>[] attrs)

Does nothing since Google Cloud Storage uses fake directories.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `dir` | `https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html` |
| `attrs` | `https://docs.oracle.com/javase/8/docs/api/java/nio/file/attribute/FileAttribute.html<?>[]` |

**Overrides** [FileSystemProvider.createDirectory(Path,FileAttribute\<?\>...)](https://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileSystemProvider.html#createDirectory-java.nio.file.Path-java.nio.file.attribute.FileAttribute<?>...-)

### delete(Path path)

    public void delete(Path path)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `path` | `https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html` |

**Overrides** [FileSystemProvider.delete(Path)](https://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileSystemProvider.html#delete-java.nio.file.Path-)

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |

### deleteIfExists(Path path)

    public boolean deleteIfExists(Path path)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `path` | `https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

**Overrides** [FileSystemProvider.deleteIfExists(Path)](https://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileSystemProvider.html#deleteIfExists-java.nio.file.Path-)

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |

### equals(Object other)

    public boolean equals(Object other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

**Overrides** [Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-)

### getFileStore(Path path)

    public FileStore getFileStore(Path path)

Throws [UnsupportedOperationException](https://docs.oracle.com/javase/8/docs/api/java/lang/UnsupportedOperationException.html) because this feature hasn't been implemented yet.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `path` | `https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/nio/file/FileStore.html` |   |

**Overrides** [FileSystemProvider.getFileStore(Path)](https://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileSystemProvider.html#getFileStore-java.nio.file.Path-)

### getFileSystem(URI uri)

    public CloudStorageFileSystem getFileSystem(URI uri)

Returns Cloud Storage file system, provided a URI with no path, e.g. `gs://bucket`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `uri` | `https://docs.oracle.com/javase/8/docs/api/java/net/URI.html` |

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

**Overrides** [FileSystemProvider.getFileSystem(URI)](https://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileSystemProvider.html#getFileSystem-java.net.URI-)

### getPath(String uriInStringForm)

    public CloudStoragePath getPath(String uriInStringForm)

Convenience method: replaces spaces with "%20", builds a URI, and calls getPath(uri).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `uriInStringForm` | `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.CloudStoragePath` |   |

### getPath(URI uri)

    public CloudStoragePath getPath(URI uri)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `uri` | `https://docs.oracle.com/javase/8/docs/api/java/net/URI.html` |

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

**Overrides** [FileSystemProvider.getPath(URI)](https://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileSystemProvider.html#getPath-java.net.URI-)

### getProject()

    public String getProject()

Returns the project that is assigned to this provider.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### getScheme()

    public String getScheme()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

**Overrides** [FileSystemProvider.getScheme()](https://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileSystemProvider.html#getScheme--)

### hashCode()

    public int hashCode()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

**Overrides** [Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--)

### isHidden(Path path)

    public boolean isHidden(Path path)

Always returns `false`, because Google Cloud Storage doesn't support hidden files.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `path` | `https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

**Overrides** [FileSystemProvider.isHidden(Path)](https://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileSystemProvider.html#isHidden-java.nio.file.Path-)

### isSameFile(Path path, Path path2)

    public boolean isSameFile(Path path, Path path2)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `path` | `https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html` |
| `path2` | `https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

**Overrides** [FileSystemProvider.isSameFile(Path,Path)](https://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileSystemProvider.html#isSameFile-java.nio.file.Path-java.nio.file.Path-)

### move(Path source, Path target, CopyOption\[\] options)

    public void move(Path source, Path target, CopyOption[] options)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `source` | `https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html` |
| `target` | `https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html` |
| `options` | `https://docs.oracle.com/javase/8/docs/api/java/nio/file/CopyOption.html[]` |

**Overrides** [FileSystemProvider.move(Path,Path,CopyOption)](https://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileSystemProvider.html#move-java.nio.file.Path-java.nio.file.Path-java.nio.file.CopyOption...-)

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |

### newByteChannel(Path path, Set\<? extends OpenOption\> options, FileAttribute\<?\>\[\] attrs)

    public SeekableByteChannel newByteChannel(Path path, Set<? extends OpenOption> options, FileAttribute<?>[] attrs)

Open a file for reading or writing. To read receiver-pays buckets, specify the
BlobSourceOption.userProject option.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `path` | `https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html` : the path to the file to open or create |
| `options` | `https://docs.oracle.com/javase/8/docs/api/java/util/Set.html<? extends java.nio.file.OpenOption>` : options specifying how the file is opened, e.g. StandardOpenOption.WRITE or BlobSourceOption.userProject |
| `attrs` | `https://docs.oracle.com/javase/8/docs/api/java/nio/file/attribute/FileAttribute.html<?>[]` : (not supported, values will be ignored) |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/nio/channels/SeekableByteChannel.html` |   |

**Overrides** [FileSystemProvider.newByteChannel(Path,Set\<? extends OpenOption\>,FileAttribute\<?\>...)](https://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileSystemProvider.html#newByteChannel-java.nio.file.Path-java.util.Set<? extends java.nio.file.OpenOption>-java.nio.file.attribute.FileAttribute<?>...-)

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |

### newDirectoryStream(Path dir, DirectoryStream.Filter\<? super Path\> filter)

    public DirectoryStream<Path> newDirectoryStream(Path dir, DirectoryStream.Filter<? super Path> filter)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `dir` | `https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html` |
| `filter` | `https://docs.oracle.com/javase/8/docs/api/java/nio/file/DirectoryStream/Filter.html<? super java.nio.file.Path>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/nio/file/DirectoryStream.html<https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html>` |   |

**Overrides** [FileSystemProvider.newDirectoryStream(Path,DirectoryStream.Filter\<? super Path\>)](https://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileSystemProvider.html#newDirectoryStream-java.nio.file.Path-java.nio.file.DirectoryStream.Filter<? super java.nio.file.Path>-)

### newFileChannel(Path path, Set\<? extends OpenOption\> options, FileAttribute\<?\>\[\] attrs)

    public FileChannel newFileChannel(Path path, Set<? extends OpenOption> options, FileAttribute<?>[] attrs)

Open a file for reading OR writing. The [FileChannel](https://docs.oracle.com/javase/8/docs/api/java/nio/channels/FileChannel.html) that is returned will only allow
reads or writes depending on the [OpenOption](https://docs.oracle.com/javase/8/docs/api/java/nio/file/OpenOption.html)s that are specified. If any of the
following have been specified, the [FileChannel](https://docs.oracle.com/javase/8/docs/api/java/nio/channels/FileChannel.html) will be write-only: StandardOpenOption#CREATE

- StandardOpenOption#CREATE
- StandardOpenOption#CREATE_NEW
- StandardOpenOption#WRITE
- StandardOpenOption#TRUNCATE_EXISTING

In all other cases the [FileChannel](https://docs.oracle.com/javase/8/docs/api/java/nio/channels/FileChannel.html) will be read-only.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `path` | `https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html` The path to the file to open or create |
| `options` | `https://docs.oracle.com/javase/8/docs/api/java/util/Set.html<? extends java.nio.file.OpenOption>` The options specifying how the file should be opened, and whether the [FileChannel](https://docs.oracle.com/javase/8/docs/api/java/nio/channels/FileChannel.html) should be read-only or write-only. |
| `attrs` | `https://docs.oracle.com/javase/8/docs/api/java/nio/file/attribute/FileAttribute.html<?>[]` (not supported, the values will be ignored) |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/nio/channels/FileChannel.html` |   |

**Overrides** [FileSystemProvider.newFileChannel(Path,Set\<? extends OpenOption\>,FileAttribute\<?\>...)](https://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileSystemProvider.html#newFileChannel-java.nio.file.Path-java.util.Set<? extends java.nio.file.OpenOption>-java.nio.file.attribute.FileAttribute<?>...-)

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |

### newFileSystem(URI uri, Map\<String,?\> env)

    public CloudStorageFileSystem newFileSystem(URI uri, Map<String,?> env)

Returns Cloud Storage file system, provided a URI, e.g. `gs://bucket`. The URI can
include a path component (that will be ignored).

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `uri` | `https://docs.oracle.com/javase/8/docs/api/java/net/URI.html` bucket and current working directory, e.g. `gs://bucket` |
| `env` | `https://docs.oracle.com/javase/8/docs/api/java/util/Map.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html,?>` map of configuration options, whose keys correspond to the method names of [CloudStorageConfiguration.Builder](https://docs.cloud.google.com/java/docs/reference/google-cloud-nio/latest/com.google.cloud.storage.contrib.nio.CloudStorageConfiguration.Builder). However you are not allowed to set the working directory, as that should be provided in the `uri` |

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

**Overrides** [FileSystemProvider.newFileSystem(URI,Map\<String,?\>)](https://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileSystemProvider.html#newFileSystem-java.net.URI-java.util.Map<java.lang.String-?>-)

### newInputStream(Path path, OpenOption\[\] options)

    public InputStream newInputStream(Path path, OpenOption[] options)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `path` | `https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html` |
| `options` | `https://docs.oracle.com/javase/8/docs/api/java/nio/file/OpenOption.html[]` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/InputStream.html` |   |

**Overrides** [FileSystemProvider.newInputStream(Path,OpenOption)](https://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileSystemProvider.html#newInputStream-java.nio.file.Path-java.nio.file.OpenOption...-)

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |

### readAttributes(Path path, String attributes, LinkOption\[\] options)

    public Map<String,Object> readAttributes(Path path, String attributes, LinkOption[] options)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `path` | `https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html` |
| `attributes` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |
| `options` | `java.nio.file.LinkOption[]` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/Map.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html,https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html>` |   |

**Overrides** [FileSystemProvider.readAttributes(Path,String,LinkOption)](https://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileSystemProvider.html#readAttributes-java.nio.file.Path-java.lang.String-java.nio.file.LinkOption...-)

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |

### requesterPays(String bucketName)

    public boolean requesterPays(String bucketName)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `bucketName` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` the name of the bucket to check |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | whether requester pays is enabled for that bucket |

### setAttribute(Path path, String attribute, Object value, LinkOption\[\] options)

    public void setAttribute(Path path, String attribute, Object value, LinkOption[] options)

Throws [UnsupportedOperationException](https://docs.oracle.com/javase/8/docs/api/java/lang/UnsupportedOperationException.html) because Cloud Storage objects are immutable.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `path` | `https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html` |
| `attribute` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |
| `value` | `https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html` |
| `options` | `java.nio.file.LinkOption[]` |

**Overrides** [FileSystemProvider.setAttribute(Path,String,Object,LinkOption)](https://docs.oracle.com/javase/8/docs/api/java/nio/file/spi/FileSystemProvider.html#setAttribute-java.nio.file.Path-java.lang.String-java.lang.Object-java.nio.file.LinkOption...-)

### toString()

    public String toString()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

**Overrides** [Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--)

### withNoUserProject()

    public CloudStorageFileSystemProvider withNoUserProject()

Returns a NEW CloudStorageFileSystemProvider identical to this one, but with userProject
removed.

Perhaps you want to call this is you realize you'll be working on a bucket that is not
requester-pays.

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