Class CloudStorageConfiguration
- java.lang.Object
-
- com.google.cloud.storage.contrib.nio.CloudStorageConfiguration
-
public abstract class CloudStorageConfiguration extends Object
Configuration forCloudStorageFileSystem
instances.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CloudStorageConfiguration.Builder
Builder forCloudStorageConfiguration
.
-
Field Summary
Fields Modifier and Type Field Description static CloudStorageConfiguration
DEFAULT
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract int
blockSize()
Returns block size (in bytes) used when talking to the Google Cloud Storage HTTP server.static CloudStorageConfiguration.Builder
builder()
Creates a new builder, initialized with the following settings: Performing I/O on paths with extra slashes, e.g.abstract int
maxChannelReopens()
Returns the number of times we try re-opening a channel if it's closed unexpectedly while reading.abstract boolean
permitEmptyPathComponents()
Returnstrue
if we shouldn't throw an exception when encountering object names containing superfluous slashes, e.g.abstract com.google.common.collect.ImmutableList<Class<? extends Exception>>
reopenableExceptions()
Returns the set of exceptions for which we'll try a channel reopen if maxChannelReopens is positive.abstract com.google.common.collect.ImmutableList<Integer>
retryableHttpCodes()
Returns the set of HTTP error codes that will be retried, in addition to the normally retryable ones.abstract boolean
stripPrefixSlash()
Returnstrue
if '/' prefix on absolute object names should be removed before I/O.abstract boolean
usePseudoDirectories()
Returnstrue
if directories and paths with a trailing slash should be treated as fake directories.abstract String
userProject()
Returns the project to be billed when accessing buckets.abstract boolean
useUserProjectOnlyForRequesterPaysBuckets()
Returns whether userProject will be cleared for non-requester-pays buckets.abstract String
workingDirectory()
Returns path of current working directory.
-
-
-
Field Detail
-
DEFAULT
public static final CloudStorageConfiguration DEFAULT
-
-
Method Detail
-
workingDirectory
public abstract String workingDirectory()
Returns path of current working directory. This defaults to the root directory.
-
permitEmptyPathComponents
public abstract boolean permitEmptyPathComponents()
Returnstrue
if we shouldn't throw an exception when encountering object names containing superfluous slashes, e.g.a//b
.
-
stripPrefixSlash
public abstract boolean stripPrefixSlash()
Returnstrue
if '/' prefix on absolute object names should be removed before I/O.If you disable this feature, please take into consideration that all paths created from a URI will have the leading slash.
-
usePseudoDirectories
public abstract boolean usePseudoDirectories()
Returnstrue
if directories and paths with a trailing slash should be treated as fake directories.With this feature, if file "foo/bar.txt" exists then both "foo" and "foo/" will be treated as if they were existing directories. On path construction no I/O will be performed, bucket and "directory" will treated as if they exist.
-
blockSize
public abstract int blockSize()
Returns block size (in bytes) used when talking to the Google Cloud Storage HTTP server.
-
maxChannelReopens
public abstract int maxChannelReopens()
Returns the number of times we try re-opening a channel if it's closed unexpectedly while reading.
-
userProject
@Nullable public abstract String userProject()
Returns the project to be billed when accessing buckets. Leave empty for normal semantics, set to bill that project (project you own) for all accesses. This is required for accessing requester-pays buckets. This value cannot be null.
-
useUserProjectOnlyForRequesterPaysBuckets
public abstract boolean useUserProjectOnlyForRequesterPaysBuckets()
Returns whether userProject will be cleared for non-requester-pays buckets. That is, if false (the default value), setting userProject causes that project to be billed regardless of whether the bucket is requester-pays or not. If true, setting userProject will only cause that project to be billed when the project is requester-pays.Setting this will cause the bucket to be accessed when the CloudStorageFileSystem object is created.
-
retryableHttpCodes
public abstract com.google.common.collect.ImmutableList<Integer> retryableHttpCodes()
Returns the set of HTTP error codes that will be retried, in addition to the normally retryable ones.
-
reopenableExceptions
public abstract com.google.common.collect.ImmutableList<Class<? extends Exception>> reopenableExceptions()
Returns the set of exceptions for which we'll try a channel reopen if maxChannelReopens is positive.
-
builder
public static CloudStorageConfiguration.Builder builder()
Creates a new builder, initialized with the following settings:- Performing I/O on paths with extra slashes, e.g.
a//b
will throw an error. - The prefix slash on absolute paths will be removed when converting to an object name.
- Pseudo-directories are enabled, so any path with a trailing slash is a fake directory.
- Channel re-opens are disabled.
- Performing I/O on paths with extra slashes, e.g.
-
-