Class SMBFileSystem

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public final class SMBFileSystem
    extends java.nio.file.FileSystem
    This class represents a single SMB server (filesystem). The authority part of the SMB URI creates a unique SMBFileSystem, that is, if you connect to the same server with different credentials, it will results in two distinc SMBFileSystem instances. Furthermore, different names for the same server will result in different SMBFileSystem instances too. The SMBFileSystem is the factory for several types of objects, like SMBPath, SMBFileStore etc.
    Since:
    1.0
    • Method Detail

      • close

        public void close()
        Removes the current instance of SMBFileSystem from the SMBFileSystemProvider's cache. Calling this method will not actually close any underlying resource. However, existing paths pointing to the current instance of SMBFileSystem will not be handled to the
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in class java.nio.file.FileSystem
      • isReadOnly

        public boolean isReadOnly()
        Returns false because generally, SMBFileSystem's are not considered to be read-only. However, the concrete access permissions are specific to a file or resource.
        Specified by:
        isReadOnly in class java.nio.file.FileSystem
        Returns:
        false
      • getSeparator

        public java.lang.String getSeparator()
        Returns the default path sepeator, which is "/".
        Specified by:
        getSeparator in class java.nio.file.FileSystem
        Returns:
        "/"
      • getRootDirectories

        public java.lang.Iterable<java.nio.file.Path> getRootDirectories()
        Returns the root directories, i.e. the list of shares, provided by the current SMBFileSystem.
        Specified by:
        getRootDirectories in class java.nio.file.FileSystem
        Returns:
        List of shares for the current SMBFileSystem.
      • getFileStores

        public java.lang.Iterable<java.nio.file.FileStore> getFileStores()
        Returns the SMBFileStores, i.e. the list of shares, provided by the current SMBFileSystem.
        Specified by:
        getFileStores in class java.nio.file.FileSystem
        Returns:
        List of SMBFileStores for the current SMBFileSystem.
      • supportedFileAttributeViews

        public java.util.Set<java.lang.String> supportedFileAttributeViews()
        Returns a containing the names of the supported FileAttributeViews
        Specified by:
        supportedFileAttributeViews in class java.nio.file.FileSystem
        Returns:
        Set with the names of the supported FileAttributeViews.
      • getPath

        public java.nio.file.Path getPath​(java.lang.String first,
                                          java.lang.String... more)
        Constructs a new SMBPath by concatenating the provided path components. If the first path starts with a '/' the newly constructed path will be an absolute path. If the last component ends with a '/' the path is treated as a folder.
        Specified by:
        getPath in class java.nio.file.FileSystem
        Parameters:
        first - First path component.
        more - List of additional path components.
        Returns:
        Constructed SMBPath.
      • getPathMatcher

        public java.nio.file.PathMatcher getPathMatcher​(java.lang.String syntaxAndPattern)
        Returns a new SMBPathMatcher for the provided pattern.
        Specified by:
        getPathMatcher in class java.nio.file.FileSystem
        Parameters:
        syntaxAndPattern - The syntax or pattern that should be used to match paths against.
        Returns:
        SMBPathMatcher
      • getUserPrincipalLookupService

        public java.nio.file.attribute.UserPrincipalLookupService getUserPrincipalLookupService()
        UserPrincipalLookupService are not supported by the current version of SMBFileSystem.
        Specified by:
        getUserPrincipalLookupService in class java.nio.file.FileSystem
        Throws:
        java.lang.UnsupportedOperationException - Always
      • newWatchService

        public java.nio.file.WatchService newWatchService()
        WatchService are not supported by the current version of SMBFileSystem.
        Specified by:
        newWatchService in class java.nio.file.FileSystem
        Throws:
        java.lang.UnsupportedOperationException - Always