| Modifier and Type | Field and Description |
|---|---|
| private final String | |
| private final AtomicBoolean |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Implements abstract java. Implements java. Closes this file system. |
| public Iterable | getFileStores()
Implements abstract java. Returns an object to iterate over the underlying file stores. |
| public Path | 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. |
| public UserPrincipalLookupService | getUserPrincipalLookupService()
Implements abstract java. Returns the |
| public boolean | isOpen()
Implements abstract java. Tells whether or not this file system is open. |
| 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. |
| public Set | supportedFileAttributeViews()
Implements abstract java. Returns the set of the |
| public String |
| name | back to summary |
|---|---|
| private final String name | |
| open | back to summary |
|---|---|
| private final AtomicBoolean open | |
| MockFileSystem | back to summary |
|---|---|
| public MockFileSystem(String name) | |
| close | back to summary |
|---|---|
| public void close() throws IOException Implements abstract java. Implements java. Doc from java. Closes this file system. After a file system is closed then all subsequent access to the file
system, either by methods defined by this class or on objects associated
with this file system, throw Closing a file system will close all open
| |
| 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 Path 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 | |
| getUserPrincipalLookupService | back to summary |
|---|---|
| public UserPrincipalLookupService getUserPrincipalLookupService() Implements abstract java. Doc from java. Returns the Usage Example: Suppose we want to make "joe" the owner of a file: UserPrincipalLookupService lookupService = FileSystems.getDefault().getUserPrincipalLookupService(); Files.setOwner(path, lookupService.lookupPrincipalByName("joe"));
| |
| isOpen | back to summary |
|---|---|
| public boolean isOpen() Implements abstract java. Doc from java. Tells whether or not this file system is open. File systems created by the default provider are always open.
| |
| 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.
| |
| supportedFileAttributeViews | back to summary |
|---|---|
| public Set Implements abstract java. Doc from java. Returns the set of the The The | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |