Class SMBFileStore


  • public final class SMBFileStore
    extends java.nio.file.FileStore
    This class represents a single SMB share on a specific SMBFileSystem. It provides access to basic attributes of that share.
    Since:
    1.0
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      java.lang.Object getAttribute​(java.lang.String attribute)
      Always throws an UnsupportedOperationException as FileStoreAttributeView are currently not supported.
      <V extends java.nio.file.attribute.FileStoreAttributeView>
      V
      getFileStoreAttributeView​(java.lang.Class<V> type)
      Always returns null as FileStoreAttributeView are currently not supported.
      long getTotalSpace()
      Returns the total capacity of the share represented by this SMBFileStore instance.
      long getUnallocatedSpace()
      Returns the number of bytes that are currently available on the share represented by this SMBFileStore instance.
      long getUsableSpace()
      Returns the number of bytes that are currently available on the share represented by this SMBFileStore instance.
      int hashCode()  
      boolean isReadOnly()
      Returns false because generally, SMBFileStore's are not considered to be read-only.
      java.lang.String name()
      Returns the full name of this SMBFileStore, which includes the FQN of the SMBFileSystem and the name of the associated share.
      boolean supportsFileAttributeView​(java.lang.Class<? extends java.nio.file.attribute.FileAttributeView> type)
      Checks whether or not this SMBFileStore supports the file attributes identified by the given file attribute view.
      boolean supportsFileAttributeView​(java.lang.String name)
      Checks whether or not this SMBFileStore supports the file attributes identified by the given file attribute view.
      java.lang.String type()
      Returns the type of the SMBFileStore, which is "share".
      • Methods inherited from class java.nio.file.FileStore

        getBlockSize
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • name

        public java.lang.String name()
        Returns the full name of this SMBFileStore, which includes the FQN of the SMBFileSystem and the name of the associated share.
        Specified by:
        name in class java.nio.file.FileStore
        Returns:
        Full name of SMBFileStore
      • type

        public java.lang.String type()
        Returns the type of the SMBFileStore, which is "share".
        Specified by:
        type in class java.nio.file.FileStore
        Returns:
        "share"
      • isReadOnly

        public boolean isReadOnly()
        Returns false because generally, SMBFileStore'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.FileStore
        Returns:
        false
      • getTotalSpace

        public long getTotalSpace()
                           throws java.io.IOException
        Returns the total capacity of the share represented by this SMBFileStore instance.
        Specified by:
        getTotalSpace in class java.nio.file.FileStore
        Returns:
        Total capacity of the share represented by this SMBFileStore instance
        Throws:
        java.io.IOException - If total capacity cannot be determined.
      • getUsableSpace

        public long getUsableSpace()
                            throws java.io.IOException
        Returns the number of bytes that are currently available on the share represented by this SMBFileStore instance. The value returned by this method is always the same as getUnallocatedSpace()
        Specified by:
        getUsableSpace in class java.nio.file.FileStore
        Returns:
        Number of bytes currently available.
        Throws:
        java.io.IOException - If usable space cannot be determined.
      • getUnallocatedSpace

        public long getUnallocatedSpace()
                                 throws java.io.IOException
        Returns the number of bytes that are currently available on the share represented by this SMBFileStore instance. The value returned by this method is always the same as getUsableSpace()
        Specified by:
        getUnallocatedSpace in class java.nio.file.FileStore
        Returns:
        Number of bytes currently available.
        Throws:
        java.io.IOException - If usable space cannot be determined.
      • supportsFileAttributeView

        public boolean supportsFileAttributeView​(java.lang.Class<? extends java.nio.file.attribute.FileAttributeView> type)
        Checks whether or not this SMBFileStore supports the file attributes identified by the given file attribute view.
        Specified by:
        supportsFileAttributeView in class java.nio.file.FileStore
        Parameters:
        type - The type of the FileAttributeView for which support should be verified.
        Returns:
        True if FileAttributeView is supported, false otherwise.
      • supportsFileAttributeView

        public boolean supportsFileAttributeView​(java.lang.String name)
        Checks whether or not this SMBFileStore supports the file attributes identified by the given file attribute view.
        Specified by:
        supportsFileAttributeView in class java.nio.file.FileStore
        Parameters:
        name - Name of the FileAttributeView for which support should be verified.
        Returns:
        True if FileAttributeView is supported, false otherwise.
      • getFileStoreAttributeView

        public <V extends java.nio.file.attribute.FileStoreAttributeView> V getFileStoreAttributeView​(java.lang.Class<V> type)
        Always returns null as FileStoreAttributeView are currently not supported.
        Specified by:
        getFileStoreAttributeView in class java.nio.file.FileStore
        Parameters:
        type - The Class object corresponding to the attribute view
        Returns:
        null
      • getAttribute

        public java.lang.Object getAttribute​(java.lang.String attribute)
        Always throws an UnsupportedOperationException as FileStoreAttributeView are currently not supported.
        Specified by:
        getAttribute in class java.nio.file.FileStore
        Throws:
        java.lang.UnsupportedOperationException - Always
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object