Class Configuration
Configuration is passed to a
method in Jimfs such as Jimfs.newFileSystem(Configuration) to create a new FileSystem instance.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classMutable builder forConfigurationobjects.private static final classprivate static final classprivate static final class -
Field Summary
FieldsModifier and TypeFieldDescription(package private) final com.google.common.collect.ImmutableSet<AttributeProvider> (package private) final com.google.common.collect.ImmutableSet<String> (package private) final intprivate final String(package private) final FileTimeSource(package private) final long(package private) final long(package private) final com.google.common.collect.ImmutableSet<PathNormalization> (package private) final com.google.common.collect.ImmutableSet<PathNormalization> (package private) final boolean(package private) final PathType(package private) final com.google.common.collect.ImmutableSet<String> (package private) final com.google.common.collect.ImmutableSet<Feature> (package private) final WatchServiceConfiguration(package private) final String -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateConfiguration(Configuration.Builder builder) Creates an immutable configuration object from the given builder. -
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.toString()static Configurationunix()Returns the default configuration for a UNIX-like file system.static Configurationwindows()Returns the default configuration for a Windows-like file system.
-
Field Details
-
pathType
-
nameDisplayNormalization
-
nameCanonicalNormalization
-
pathEqualityUsesCanonicalForm
final boolean pathEqualityUsesCanonicalForm -
blockSize
final int blockSize -
maxSize
final long maxSize -
maxCacheSize
final long maxCacheSize -
attributeViews
-
attributeProviders
-
defaultAttributeValues
-
fileTimeSource
-
watchServiceConfig
-
roots
-
workingDirectory
-
supportedFeatures
-
displayName
-
-
Constructor Details
-
Configuration
Creates an immutable configuration object from the given builder.
-
-
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. -
toString
-
toBuilder
Returns a new mutable builder that initially contains the same settings as this configuration.
-