Class Configuration
Configuration is passed to a
method in Jimfs such as Jimfs.newFileSystem(Configuration) to create a new
FileSystem instance.- Author:
- Colin Decker
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic Configuration.BuilderCreates a new mutableConfigurationbuilder using the given path type.static ConfigurationReturns a default configuration appropriate to the current operating system.static ConfigurationosX()Returns the default configuration for a Mac OS X-like file system.Returns a new mutable builder that initially contains the same settings as this configuration.static Configurationunix()Returns the default configuration for a UNIX-like file system.static Configurationwindows()Returns the default configuration for a Windows-like file system.
-
Method Details
-
unix
Returns the default configuration for a UNIX-like file system. A file system created with this configuration:
- uses
/as the path name separator (seePathType.unix()for more information on the path format) - has root
/and working directory/work - performs case-sensitive file lookup
- supports only the basic file attribute view, to avoid overhead for unneeded attributes
- supports hard links, symbolic links,
SecureDirectoryStreamandFileChannel
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(); - uses
-
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:
- uses
/as the path name separator (seePathType.unix()for more information on the path format) - has root
/and working directory/work - does Unicode normalization on paths, both for lookup and for
Pathobjects - does case-insensitive (for ASCII characters only) lookup
- supports only the basic file attribute view, to avoid overhead for unneeded attributes
- supports hard links, symbolic links and
FileChannel
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(); - uses
-
windows
Returns the default configuration for a Windows-like file system. A file system created with this configuration:
- uses
\as the path name separator and recognizes/as a separator when parsing paths (seePathType.windows()for more information on path format) - has root
C:\and working directoryC:\work - performs case-insensitive (for ASCII characters only) file lookup
- creates
Pathobjects that use case-insensitive (for ASCII characters only) equality - supports only the basic file attribute view, to avoid overhead for unneeded attributes
- supports hard links, symbolic links and
FileChannel
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(); - uses
-
forCurrentPlatform
Returns a default configuration appropriate to the current operating system.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.newFileSystemmethods that do not take aConfigurationparameter.- Since:
- 1.1
-
builder
Creates a new mutableConfigurationbuilder using the given path type. -
toBuilder
Returns a new mutable builder that initially contains the same settings as this configuration.
-