@ParametersAreNonnullByDefault public abstract class FileStoreBase extends FileStore
FileStore
Notes:
FileStoreAttributeView
s;Long.MAX_VALUE
; as
discussed on nio-dev, this is a reasonable value to return when the file
store has no information on the actual size.FileStore
Modifier | Constructor and Description |
---|---|
protected |
FileStoreBase(String name,
FileAttributesFactory factory,
boolean readOnly)
Alternate constructor
|
protected |
FileStoreBase(String name,
String type,
FileAttributesFactory factory,
boolean readOnly)
Main constructor
|
Modifier and Type | Method and Description |
---|---|
Object |
getAttribute(String attribute) |
<V extends FileStoreAttributeView> |
getFileStoreAttributeView(Class<V> type) |
long |
getTotalSpace() |
long |
getUnallocatedSpace() |
long |
getUsableSpace() |
boolean |
isReadOnly() |
String |
name() |
boolean |
supportsFileAttributeView(Class<? extends FileAttributeView> type) |
boolean |
supportsFileAttributeView(String name) |
String |
type() |
protected FileStoreBase(String name, String type, FileAttributesFactory factory, boolean readOnly)
name
- the name of the file storetype
- the type of the file storefactory
- the associated FileAttributesFactory
readOnly
- whether this filestore is read onlyprotected FileStoreBase(String name, FileAttributesFactory factory, boolean readOnly)
This constructor assumes that the name and type are the same; apart from that, all arguments are the same as for the other constructor.
name
- the name (and type) of the file storefactory
- the associated FileAttributesFactory
readOnly
- whether this filestore is read onlypublic final boolean isReadOnly()
isReadOnly
in class FileStore
public long getTotalSpace() throws IOException
getTotalSpace
in class FileStore
IOException
public long getUsableSpace() throws IOException
getUsableSpace
in class FileStore
IOException
public long getUnallocatedSpace() throws IOException
getUnallocatedSpace
in class FileStore
IOException
public final boolean supportsFileAttributeView(Class<? extends FileAttributeView> type)
supportsFileAttributeView
in class FileStore
public final boolean supportsFileAttributeView(String name)
supportsFileAttributeView
in class FileStore
public final <V extends FileStoreAttributeView> V getFileStoreAttributeView(Class<V> type)
getFileStoreAttributeView
in class FileStore
public final Object getAttribute(String attribute) throws IOException
getAttribute
in class FileStore
IOException