Class ZeroFs


  • public final class ZeroFs
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.util.logging.Logger LOGGER  
      (package private) static java.nio.file.spi.FileSystemProvider systemProvider
      The system-loaded instance of SystemZeroFsFileSystemProvider, or null if it could not be found or loaded.
      static java.lang.String URI_SCHEME
      The URI scheme for the ZeroFs file system ("zerofs").
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private ZeroFs()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      private static java.nio.file.spi.FileSystemProvider getSystemZeroFsProvider()
      Returns the system-loaded instance of SystemZeroFsFileSystemProvider or null if it could not be found or loaded.
      static java.nio.file.FileSystem newFileSystem()
      Creates a new in-memory file system with a default configuration appropriate to the current operating system.
      static java.nio.file.FileSystem newFileSystem​(Configuration configuration)
      Creates a new in-memory file system with the given configuration.
      static java.nio.file.FileSystem newFileSystem​(java.lang.String name)
      Creates a new in-memory file system with a default configuration appropriate to the current operating system.
      static java.nio.file.FileSystem newFileSystem​(java.lang.String name, Configuration configuration)
      Creates a new in-memory file system with the given configuration.
      (package private) static java.nio.file.FileSystem newFileSystem​(java.net.URI uri, Configuration config)  
      private static java.lang.String newRandomFileSystemName()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • URI_SCHEME

        public static final java.lang.String URI_SCHEME
        The URI scheme for the ZeroFs file system ("zerofs").
        See Also:
        Constant Field Values
      • LOGGER

        private static final java.util.logging.Logger LOGGER
      • systemProvider

        static final java.nio.file.spi.FileSystemProvider systemProvider
        The system-loaded instance of SystemZeroFsFileSystemProvider, or null if it could not be found or loaded.
    • Constructor Detail

      • ZeroFs

        private ZeroFs()
    • Method Detail

      • newFileSystem

        public static java.nio.file.FileSystem newFileSystem​(java.lang.String name)
        Creates a new in-memory file system with a default configuration appropriate to the current operating system.

        More specifically, if the operating system is Windows, Configuration.windows() is used; if the operating system is Mac OS X, Configuration.osX() is used; otherwise, Configuration.unix() is used.

        The returned file system uses the given name as the host part of its URI and the URIs of paths in the file system. For example, given the name my-file-system, the file system's URI will be zerofs://my-file-system and the URI of the path /foo/bar will be zerofs://my-file-system/foo/bar.

      • newFileSystem

        public static java.nio.file.FileSystem newFileSystem​(Configuration configuration)
        Creates a new in-memory file system with the given configuration.
      • newFileSystem

        public static java.nio.file.FileSystem newFileSystem​(java.lang.String name,
                                                             Configuration configuration)
        Creates a new in-memory file system with the given configuration.

        The returned file system uses the given name as the host part of its URI and the URIs of paths in the file system. For example, given the name my-file-system, the file system's URI will be zerofs://my-file-system and the URI of the path /foo/bar will be zerofs://my-file-system/foo/bar.

      • newFileSystem

        static java.nio.file.FileSystem newFileSystem​(java.net.URI uri,
                                                      Configuration config)
      • getSystemZeroFsProvider

        private static java.nio.file.spi.FileSystemProvider getSystemZeroFsProvider()
        Returns the system-loaded instance of SystemZeroFsFileSystemProvider or null if it could not be found or loaded.

        Like FileSystems.newFileSystem(URI, Map, ClassLoader), this method first looks in the list of installed providers and if not found there, attempts to load it from the ClassLoader with ServiceLoader.

        The idea is that this method should return an instance of the same class (i.e. loaded by the same class loader) as the class whose static cache a ZeroFsFileSystem instance will be placed in when FileSystems.newFileSystem is called in ZeroFs.newFileSystem.

      • newRandomFileSystemName

        private static java.lang.String newRandomFileSystemName()