public final class Configuration extends Object
Configuration
is passed to a
method in Jimfs
such as Jimfs.newFileSystem(Configuration)
to create a new
FileSystem
instance.Modifier and Type | Class and Description |
---|---|
static class |
Configuration.Builder
Mutable builder for
Configuration objects. |
Modifier and Type | Method and Description |
---|---|
static Configuration.Builder |
builder(PathType pathType)
Creates a new mutable
Configuration builder using the given path type. |
static Configuration |
forCurrentPlatform()
Returns a default configuration appropriate to the current operating system.
|
static Configuration |
osX()
Returns the default configuration for a Mac OS X-like file system.
|
Configuration.Builder |
toBuilder()
Returns a new mutable builder that initially contains the same settings as this configuration.
|
static Configuration |
unix()
Returns the default configuration for a UNIX-like file system.
|
static Configuration |
windows()
Returns the default configuration for a Windows-like file system.
|
public static Configuration unix()
Returns the default configuration for a UNIX-like file system. A file system created with this configuration:
/
as the path name separator (see PathType.unix()
for more
information on the path format)/
and working directory /work
SecureDirectoryStream
and
FileChannel
To create a modified version of this configuration, such as to include the full set of UNIX file attribute views, create a builder.
Example:
Configuration config = Configuration.unix().toBuilder() .setAttributeViews("basic", "owner", "posix", "unix") .setWorkingDirectory("/home/user") .build();
public static Configuration osX()
Returns the default configuration for a Mac OS X-like file system.
The primary differences between this configuration and the default unix()
configuration are that this configuration does Unicode normalization on the display and
canonical forms of filenames and does case insensitive file lookup.
A file system created with this configuration:
/
as the path name separator (see PathType.unix()
for more
information on the path format)/
and working directory /work
Path
objectsFileChannel
To create a modified version of this configuration, such as to include the full set of UNIX file attribute views or to use full Unicode case insensitivity, create a builder.
Example:
Configuration config = Configuration.osX().toBuilder() .setAttributeViews("basic", "owner", "posix", "unix") .setNameCanonicalNormalization(NFD, CASE_FOLD_UNICODE) .setWorkingDirectory("/Users/user") .build();
public static Configuration windows()
Returns the default configuration for a Windows-like file system. A file system created with this configuration:
\
as the path name separator and recognizes /
as a separator when
parsing paths (see PathType.windows()
for more information on path format)C:\
and working directory C:\work
Path
objects that use case-insensitive (for ASCII characters only)
equalityFileChannel
To create a modified version of this configuration, such as to include the full set of Windows file attribute views or to use full Unicode case insensitivity, create a builder.
Example:
Configuration config = Configuration.windows().toBuilder() .setAttributeViews("basic", "owner", "dos", "acl", "user") .setNameCanonicalNormalization(CASE_FOLD_UNICODE) .setWorkingDirectory("C:\\Users\\user") // or "C:/Users/user" .build();
public static Configuration forCurrentPlatform()
More specifically, if the operating system is Windows, windows()
is
returned; if the operating system is Mac OS X, osX()
is returned;
otherwise, unix()
is returned.
This is the configuration used by the Jimfs.newFileSystem
methods that do not take
a Configuration
parameter.
public static Configuration.Builder builder(PathType pathType)
Configuration
builder using the given path type.public Configuration.Builder toBuilder()
Copyright © 2013–2017 Google Inc.. All rights reserved.