FileStore represents a storage pool, device,
partition, volume, concrete file system or other implementation specific means
of file storage. The FileStore for where a file is stored is obtained
by invoking the getFileStore method, or all file
stores can be enumerated by invoking the getFileStores method.
In addition to the methods defined by this class, a file store may support
one or more FileStoreAttributeView classes
that provide a read-only or updatable view of a set of file store attributes.
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public abstract Object | Returns: the attribute value;null may be valid for some
attributesthe attribute to read attribute)Reads the value of a file store attribute. |
| public long | Returns: a positive value representing the block size of this file store, in bytesReturns the number of bytes per block in this file store. |
| public abstract < The V extends FileStoreAttributeView> VFileStoreAttributeView type | Returns: a file store attribute view of the specified type ornull if the attribute view is not availablethe type)Class object corresponding to the attribute viewReturns a |
| public abstract long | Returns: the size of the file store, in bytesReturns the size, in bytes, of the file store. |
| public abstract long | Returns: the current number of unallocated bytesReturns the number of unallocated bytes in the file store. |
| public abstract long | Returns: the current number of usable bytesReturns the number of bytes available to this Java virtual machine on the file store. |
| public abstract boolean | Returns: true if, and only if, this file store is read-onlyTells whether this file store is read-only. |
| public abstract String | |
| public abstract boolean | Returns: true if, and only if, the file attribute view is
supportedthe file attribute view type type)Tells whether or not this file store supports the file attributes identified by the given file attribute view. |
| public abstract boolean | Returns: true if, and only if, the file attribute view is
supportedthe name)name of file attribute viewTells whether or not this file store supports the file attributes identified by the given file attribute view. |
| public abstract String | Returns: a string representing the type of this file storeReturns the type of this file store. |
| FileStore | back to summary |
|---|---|
| protected FileStore() Initializes a new instance of this class. | |
| getAttribute | back to summary |
|---|---|
| public abstract Object getAttribute(String attribute) throws IOException Reads the value of a file store attribute. The view-name:attribute-namewhere the character ':' stands for itself.
view-name is the 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");
| |
| getBlockSize | back to summary |
|---|---|
| public long getBlockSize() throws IOException Returns the number of bytes per block in this file store. File storage is typically organized into discrete sequences of bytes called blocks. A block is the smallest storage unit of a file store. Every read and write operation is performed on a multiple of blocks. Implementation Specification The implementation in this class throws
| |
| getFileStoreAttributeView | back to summary |
|---|---|
| public abstract <V extends FileStoreAttributeView> V getFileStoreAttributeView(Class<V> type) Returns a 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
| |
| getTotalSpace | back to summary |
|---|---|
| public abstract long getTotalSpace() throws IOException Returns the size, in bytes, of the file store. If the total number of
bytes in the file store is greater than
| |
| getUnallocatedSpace | back to summary |
|---|---|
| public abstract long getUnallocatedSpace() throws IOException Returns the number of unallocated bytes in the file store.
If the number of unallocated bytes is greater than
The returned number of unallocated bytes is a hint, but not a guarantee, that it is possible to use most or any of these bytes. The number of unallocated bytes is most likely to be accurate immediately after this method returns. It is likely to be made inaccurate by any external I/O operations including those made on the system outside of this virtual machine.
| |
| getUsableSpace | back to summary |
|---|---|
| public abstract long getUsableSpace() throws IOException Returns the number of bytes available to this Java virtual machine on the
file store. If the number of bytes available is greater than
The returned number of available bytes is a hint, but not a guarantee, that it is possible to use most or any of these bytes. The number of usable bytes is most likely to be accurate immediately after this method returns. It is likely to be made inaccurate by any external I/O operations including those made on the system outside of this Java virtual machine.
| |
| isReadOnly | back to summary |
|---|---|
| public abstract boolean isReadOnly() Tells whether this file store is read-only. A file store is read-only if
it does not support write operations or other changes to files. Any
attempt to create a file, open an existing file for writing etc. causes
an
| |
| name | back to summary |
|---|---|
| public abstract String name() Returns the name of this file store. The format of the name is highly implementation specific. It will typically be the name of the storage pool or volume. The string returned by this method may differ from the string
returned by the
| |
| supportsFileAttributeView | back to summary |
|---|---|
| public abstract boolean supportsFileAttributeView(Class<? extends FileAttributeView> type) Tells whether or not this file store supports the file attributes identified by the given file attribute view. Invoking this method to test if the file store supports
| |
| supportsFileAttributeView | back to summary |
|---|---|
| public abstract boolean supportsFileAttributeView(String name) Tells whether or not this file store supports the file attributes identified by the given file attribute view. Invoking this method to test if the file store supports | |
| type | back to summary |
|---|---|
| public abstract String type() Returns the type of this file store. The format of the string returned by this method is highly implementation specific. It may indicate, for example, the format used or if the file store is local or remote.
| |