Class WindowsPathType
java.lang.Object
com.google.common.jimfs.PathType
com.google.common.jimfs.WindowsPathType
Windows-style path type.
-
Nested Class Summary
Nested classes/interfaces inherited from class PathType
PathType.ParseResult -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final PatternPattern for matching normal C:\ drive letter root syntax.(package private) static final WindowsPathTypeWindows path type.private static final PatternPattern for matching trailing spaces in file names.private static final PatternPattern for matching UNC \\host\share root syntax.private static final PatternMatches the C:foo\bar path format, which has a root (C:) and names (foo\bar) and matches a path relative to the working directory on that drive. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static booleanisReserved(char c) Checks if c is one of the reserved characters that aren't allowed in Windows file names.private @Nullable StringparseDriveRoot(String path) Parses a normal drive-letter root, e.g.Parses the given strings as a path.private StringparseUncRoot(String path, String original) Parse the root of a UNC-style path, throwing an exception if the path does not start with a valid UNC root.parseUriPath(String uriPath) Parses a path from the given URI path.Returns the string form of the given path.Returns the string form of the given path for use in the path part of a URI.Methods inherited from class PathType
allowsMultipleRoots, emptyPath, fromUri, getOtherSeparators, getSeparator, joiner, splitter, toString, toUri, unix, windows
-
Field Details
-
INSTANCE
Windows path type. -
WORKING_DIR_WITH_DRIVE
Matches the C:foo\bar path format, which has a root (C:) and names (foo\bar) and matches a path relative to the working directory on that drive. Currently can't support that format as it requires behavior that differs completely from Unix. -
TRAILING_SPACES
Pattern for matching trailing spaces in file names. -
UNC_ROOT
Pattern for matching UNC \\host\share root syntax. -
DRIVE_LETTER_ROOT
Pattern for matching normal C:\ drive letter root syntax.
-
-
Constructor Details
-
WindowsPathType
private WindowsPathType()
-
-
Method Details
-
parsePath
Description copied from class:PathTypeParses the given strings as a path. -
parseUncRoot
-
parseDriveRoot
-
isReserved
private static boolean isReserved(char c) Checks if c is one of the reserved characters that aren't allowed in Windows file names. -
toString
-
toUriPath
Description copied from class:PathTypeReturns the string form of the given path for use in the path part of a URI. The root element is not nullable as the path must be absolute. The elements of the returned path do not need to be escaped. Thedirectoryboolean indicates whether the file the URI is for is known to be a directory. -
parseUriPath
Description copied from class:PathTypeParses a path from the given URI path.- Specified by:
parseUriPathin classPathType
-