Package ch.pontius.nio.smb
Class SMBFileStore
- java.lang.Object
-
- java.nio.file.FileStore
-
- ch.pontius.nio.smb.SMBFileStore
-
public final class SMBFileStore extends java.nio.file.FileStoreThis class represents a single SMB share on a specificSMBFileSystem. 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 booleanequals(java.lang.Object o)java.lang.ObjectgetAttribute(java.lang.String attribute)Always throws anUnsupportedOperationExceptionasFileStoreAttributeVieware currently not supported.<V extends java.nio.file.attribute.FileStoreAttributeView>
VgetFileStoreAttributeView(java.lang.Class<V> type)Always returns null asFileStoreAttributeVieware currently not supported.longgetTotalSpace()Returns the total capacity of the share represented by thisSMBFileStoreinstance.longgetUnallocatedSpace()Returns the number of bytes that are currently available on the share represented by thisSMBFileStoreinstance.longgetUsableSpace()Returns the number of bytes that are currently available on the share represented by thisSMBFileStoreinstance.inthashCode()booleanisReadOnly()Returns false because generally,SMBFileStore's are not considered to be read-only.java.lang.Stringname()Returns the full name of thisSMBFileStore, which includes the FQN of theSMBFileSystemand the name of the associated share.booleansupportsFileAttributeView(java.lang.Class<? extends java.nio.file.attribute.FileAttributeView> type)Checks whether or not thisSMBFileStoresupports the file attributes identified by the given file attribute view.booleansupportsFileAttributeView(java.lang.String name)Checks whether or not thisSMBFileStoresupports the file attributes identified by the given file attribute view.java.lang.Stringtype()Returns the type of theSMBFileStore, which is "share".
-
-
-
Method Detail
-
name
public java.lang.String name()
Returns the full name of thisSMBFileStore, which includes the FQN of theSMBFileSystemand the name of the associated share.- Specified by:
namein classjava.nio.file.FileStore- Returns:
- Full name of
SMBFileStore
-
type
public java.lang.String type()
Returns the type of theSMBFileStore, which is "share".- Specified by:
typein classjava.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:
isReadOnlyin classjava.nio.file.FileStore- Returns:
- false
-
getTotalSpace
public long getTotalSpace() throws java.io.IOExceptionReturns the total capacity of the share represented by thisSMBFileStoreinstance.- Specified by:
getTotalSpacein classjava.nio.file.FileStore- Returns:
- Total capacity of the share represented by this
SMBFileStoreinstance - Throws:
java.io.IOException- If total capacity cannot be determined.
-
getUsableSpace
public long getUsableSpace() throws java.io.IOExceptionReturns the number of bytes that are currently available on the share represented by thisSMBFileStoreinstance. The value returned by this method is always the same asgetUnallocatedSpace()- Specified by:
getUsableSpacein classjava.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.IOExceptionReturns the number of bytes that are currently available on the share represented by thisSMBFileStoreinstance. The value returned by this method is always the same asgetUsableSpace()- Specified by:
getUnallocatedSpacein classjava.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 thisSMBFileStoresupports the file attributes identified by the given file attribute view.- Specified by:
supportsFileAttributeViewin classjava.nio.file.FileStore- Parameters:
type- The type of theFileAttributeViewfor which support should be verified.- Returns:
- True if
FileAttributeViewis supported, false otherwise.
-
supportsFileAttributeView
public boolean supportsFileAttributeView(java.lang.String name)
Checks whether or not thisSMBFileStoresupports the file attributes identified by the given file attribute view.- Specified by:
supportsFileAttributeViewin classjava.nio.file.FileStore- Parameters:
name- Name of theFileAttributeViewfor which support should be verified.- Returns:
- True if
FileAttributeViewis supported, false otherwise.
-
getFileStoreAttributeView
public <V extends java.nio.file.attribute.FileStoreAttributeView> V getFileStoreAttributeView(java.lang.Class<V> type)
Always returns null asFileStoreAttributeVieware currently not supported.- Specified by:
getFileStoreAttributeViewin classjava.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 anUnsupportedOperationExceptionasFileStoreAttributeVieware currently not supported.- Specified by:
getAttributein classjava.nio.file.FileStore- Throws:
java.lang.UnsupportedOperationException- Always
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-