@ParametersAreNonnullByDefault public abstract class FileStoreBase extends FileStore
| Modifier | Constructor and Description |
|---|---|
protected |
FileStoreBase(String name,
boolean readOnly) |
protected |
FileStoreBase(String name,
String type,
boolean readOnly) |
| Modifier and Type | Method and Description |
|---|---|
Object |
getAttribute(String attribute)
Reads the value of a file store attribute.
|
<V extends FileStoreAttributeView> |
getFileStoreAttributeView(Class<V> type)
Returns a
FileStoreAttributeView of the given type. |
boolean |
isReadOnly()
Tells whether this file store is read-only.
|
String |
name()
Returns the name of this file store.
|
String |
type()
Returns the type of this file store.
|
getTotalSpace, getUnallocatedSpace, getUsableSpace, supportsFileAttributeView, supportsFileAttributeViewprotected FileStoreBase(String name, boolean readOnly)
public final String name()
The string returned by this method may differ from the string
returned by the toString method.
public final String type()
public final boolean isReadOnly()
IOException to be thrown.isReadOnly in class FileStoretrue if, and only if, this file store is read-onlypublic final <V extends FileStoreAttributeView> V getFileStoreAttributeView(Class<V> type)
FileStoreAttributeView of the given type.
This method is intended to be used where the file store attribute
view defines type-safe methods to read or update the file store
attributes.
The type parameter is the type of the attribute view required and
the method returns an instance of that type if supported.
getFileStoreAttributeView in class FileStoretype - the Class object corresponding to the attribute viewnull if the attribute view is not availablepublic final Object getAttribute(String attribute) throws IOException
The attribute parameter identifies the attribute to be read
and takes the form:
view-name:attribute-namewhere the character
':' stands for itself.
view-name is the name of
a AttributeView that identifies a set of file
attributes.
attribute-name is the name of the attribute.
Usage Example: Suppose we want to know if ZFS compression is enabled (assuming the "zfs" view is supported):
boolean compression = (Boolean)fs.getAttribute("zfs:compression");
getAttribute in class FileStoreattribute - the attribute to readnull may be a valid valid for some
attributesUnsupportedOperationException - if the attribute view is not
available or it does not support
reading the attributeIOException - if an I/O error occurs