< prev index next >
src/java.base/windows/classes/sun/nio/fs/DefaultFileSystemProvider.java
Print this page
8213406: (fs) More than one instance of built-in FileSystem observed in heap
Reviewed-by: alanb, cushon, weijun
@@ -23,16 +23,22 @@
* questions.
*/
package sun.nio.fs;
-import java.nio.file.spi.FileSystemProvider;
+import java.nio.file.FileSystem;
/**
- * Creates default provider on Windows
+ * Creates this platform's system-default ("builtin") FileSystemProvider.
*/
public class DefaultFileSystemProvider {
private DefaultFileSystemProvider() { }
- public static FileSystemProvider create() {
- return new WindowsFileSystemProvider();
+
+ /** The unique instance of the system-default file system provider. */
+ public static final WindowsFileSystemProvider FILE_SYSTEM_PROVIDER
+ = new WindowsFileSystemProvider();
+
+ /** Returns the unique instance of the system-default file system. */
+ public static FileSystem theFileSystem() {
+ return FILE_SYSTEM_PROVIDER.theFileSystem;
}
}
< prev index next >