Package com.google.common.jimfs
Class PathService
java.lang.Object
com.google.common.jimfs.PathService
- All Implemented Interfaces:
Comparator<JimfsPath>
Service for creating
JimfsPath
instances and handling other path-related operations.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final com.google.common.collect.Ordering
<Name> private final com.google.common.collect.ImmutableSet
<PathNormalization> private static final com.google.common.collect.Ordering
<Name> private final com.google.common.collect.ImmutableSet
<PathNormalization> private JimfsPath
private final boolean
private FileSystem
private static final com.google.common.base.Predicate
<Object> private final com.google.common.collect.Ordering
<Name> private final PathType
-
Constructor Summary
ConstructorsConstructorDescriptionPathService
(Configuration config) PathService
(PathType type, Iterable<PathNormalization> displayNormalizations, Iterable<PathNormalization> canonicalNormalizations, boolean equalityUsesCanonicalForm) -
Method Summary
Modifier and TypeMethodDescriptionint
createFileName
(Name name) Returns a single filename path with the given name.createPath
(@Nullable Name root, Iterable<Name> names) Returns a path with the given root (or no root, if null) and the given names.protected final JimfsPath
createPathInternal
(@Nullable Name root, Iterable<Name> names) Returns a path with the given root (or no root, if null) and the given names.createPathMatcher
(String syntaxAndPattern) Returns aPathMatcher
for the given syntax and pattern as specified byFileSystem.getPathMatcher(String)
.createRelativePath
(Iterable<Name> names) Returns a relative path with the given names.createRoot
(Name root) Returns a root path with the given name.Returns an empty path which has a single name, the empty string.Converts the path of the given URI into a path for this file system.Returns the file system this service is for.Returns the default path separator.int
Creates a hash code for the given path.Returns theName
form of the given string.Returns theName
forms of the given strings.Parses the given strings as a path.void
setFileSystem
(FileSystem fileSystem) Sets the file system to use for created paths.private JimfsPath
toPath
(PathType.ParseResult parsed) Returns the string form of the given path.Returns the URI for the given path.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
DISPLAY_ROOT_ORDERING
-
DISPLAY_NAMES_ORDERING
-
CANONICAL_ROOT_ORDERING
-
CANONICAL_NAMES_ORDERING
-
type
-
displayNormalizations
-
canonicalNormalizations
-
equalityUsesCanonicalForm
private final boolean equalityUsesCanonicalForm -
rootOrdering
-
namesOrdering
-
fileSystem
-
emptyPath
-
NOT_EMPTY
-
-
Constructor Details
-
PathService
PathService(Configuration config) -
PathService
PathService(PathType type, Iterable<PathNormalization> displayNormalizations, Iterable<PathNormalization> canonicalNormalizations, boolean equalityUsesCanonicalForm)
-
-
Method Details
-
setFileSystem
Sets the file system to use for created paths. -
getFileSystem
Returns the file system this service is for. -
getSeparator
Returns the default path separator. -
emptyPath
Returns an empty path which has a single name, the empty string. -
name
Returns theName
form of the given string. -
names
Returns theName
forms of the given strings. -
createRoot
Returns a root path with the given name. -
createFileName
Returns a single filename path with the given name. -
createRelativePath
Returns a relative path with the given names. -
createPath
Returns a path with the given root (or no root, if null) and the given names. -
createPathInternal
Returns a path with the given root (or no root, if null) and the given names. -
parsePath
Parses the given strings as a path. -
toPath
-
toString
Returns the string form of the given path. -
hash
Creates a hash code for the given path. -
compare
- Specified by:
compare
in interfaceComparator<JimfsPath>
-
toUri
Returns the URI for the given path. The given file system URI is the base against which the path is resolved to create the returned URI. -
fromUri
Converts the path of the given URI into a path for this file system. -
createPathMatcher
Returns aPathMatcher
for the given syntax and pattern as specified byFileSystem.getPathMatcher(String)
.
-