| Modifier and Type | Field and Description |
|---|---|
| private final FileSystemProvider | |
| protected final Logger |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| protected void | |
| protected T | |
| protected T | |
| protected abstract T | |
| public T | |
| public Iterable | getFileStores()
Implements abstract java. Returns an object to iterate over the underlying file stores. |
| public T | getPath(String
the path string or initial part of the path string first, String... additional strings to be joined to form the path string more)Implements abstract java. Converts a path string, or a sequence of strings that when joined form
a path string, to a |
| public PathMatcher | getPathMatcher(String
The syntax and pattern syntaxAndPattern)Implements abstract java. Returns a |
| public Iterable | getRootDirectories()
Implements abstract java. Returns an object to iterate over the paths of the root directories. |
| public String | getSeparator()
Implements abstract java. Returns the name separator, represented as a string. |
| protected String | |
| protected String | Returns: the fixed namethe name to fix the separator for if running on Windows name)In case we are running on Windows, accept "\\" as a file separator. |
| protected boolean | |
| public boolean | isReadOnly()
Implements abstract java. Tells whether or not this file system allows only read-only access to its file stores. |
| public WatchService | newWatchService()
Implements abstract java. Constructs a new |
| public FileSystemProvider | provider()
Implements abstract java. Returns the provider that created this file system. |
| fileSystemProvider | back to summary |
|---|---|
| private final FileSystemProvider fileSystemProvider | |
| log | back to summary |
|---|---|
| protected final Logger log | |
| BaseFileSystem | back to summary |
|---|---|
| protected BaseFileSystem(FileSystemProvider fileSystemProvider) | |
| appendDedupSep | back to summary |
|---|---|
| protected void appendDedupSep(StringBuilder sb, CharSequence s) | |
| create | back to summary |
|---|---|
| protected T create(String root, String... names) | |
| create | back to summary |
|---|---|
| protected T create(String root, Collection<String> names) | |
| create | back to summary |
|---|---|
| protected abstract T create(String root, List<String> names) | |
| getDefaultDir | back to summary |
|---|---|
| public T getDefaultDir() | |
| getFileStores | back to summary |
|---|---|
| public Iterable Implements abstract java. Doc from java. Returns an object to iterate over the underlying file stores. The elements of the returned iterator are the Usage Example: Suppose we want to print the space usage for all file stores: for (FileStore store: FileSystems.getDefault().getFileStores()) { long total = store.getTotalSpace() / 1024; long used = (store.getTotalSpace() - store.getUnallocatedSpace()) / 1024; long avail = store.getUsableSpace() / 1024; System.out.format("%-20s %12d %12d %12d%n", store, total, used, avail); } | |
| getPath | back to summary |
|---|---|
| public T getPath(String first, String... more) Implements abstract java. Doc from java. Converts a path string, or a sequence of strings that when joined form
a path string, to a The parsing and conversion to a path object is inherently
implementation dependent. In the simplest case, the path string is rejected,
and In the case of the default provider, path strings are parsed based on the definition of paths at the platform or virtual file system level. For example, an operating system may not allow specific characters to be present in a file name, but a specific underlying file store may impose different or additional restrictions on the set of legal characters. This method throws | |
| getPathMatcher | back to summary | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| public PathMatcher getPathMatcher(String syntaxAndPattern) Implements abstract java. Doc from java. Returns a where syntax is the non-empty name of the syntax, pattern is a possibly-empty pattern string, andsyntax:pattern ':' stands for itself.
A When the syntax is "
The following rules are used to interpret glob patterns:
When the syntax is " For both the glob and regex syntaxes, the matching details, such as whether the matching is case sensitive, are implementation-dependent and therefore not specified.
| |||||||||||||||||
| getRootDirectories | back to summary |
|---|---|
| public Iterable Implements abstract java. Doc from java. Returns an object to iterate over the paths of the root directories. A file system provides access to a file store that may be composed of a number of distinct file hierarchies, each with its own top-level root directory. Each element in the returned iterator corresponds to the root directory of a distinct file hierarchy. The order of the elements is not defined. The file hierarchies may change during the lifetime of the ava virtual machine. For example, in some implementations, the insertion of removable media may result in the creation of a new file hierarchy with its own top-level directory. There is no guarantee that a root directory can be accessed. | |
| getSeparator | back to summary |
|---|---|
| public String getSeparator() Implements abstract java. Doc from java. Returns the name separator, represented as a string. The name separator is used to separate names in a path string. An
implementation may support multiple name separators in which case this
method returns an implementation specific default name separator.
This separator is used when creating path strings by invoking the In the case of the default provider, this method returns the same
separator as | |
| globToRegex | back to summary |
|---|---|
| protected String globToRegex(String pattern) | |
| handleWindowsSeparator | back to summary |
|---|---|
| protected String handleWindowsSeparator(String name) In case we are running on Windows, accept "\\" as a file separator. Ignore in *nix as "\\" is a valid filename | |
| hostFsHasWindowsSeparator | back to summary |
|---|---|
| protected boolean hostFsHasWindowsSeparator() | |
| isReadOnly | back to summary |
|---|---|
| public boolean isReadOnly() Implements abstract java. Doc from java. Tells whether or not this file system allows only read-only access to its file stores.
| |
| newWatchService | back to summary |
|---|---|
| public WatchService newWatchService() throws IOException Implements abstract java. Doc from java. Constructs a new This method constructs a new watch service that may be used to watch registered objects for changes and events.
| |
| provider | back to summary |
|---|---|
| public FileSystemProvider provider() Implements abstract java. Doc from java. Returns the provider that created this file system.
| |