Package oshi.software.os
Class OSFileStore
java.lang.Object
oshi.software.os.OSFileStore
@NotThreadSafe public class OSFileStore extends java.lang.Object
A File Store is a storage pool, device, partition, volume, concrete file
system or other implementation specific means of file storage. See subclasses
for definitions as they apply to specific platforms.
Thread safe if both threads only use getters, or if setter usage is externally synchronized.
-
Constructor Summary
Constructors Constructor Description OSFileStore()Constructor for OSFileStore.OSFileStore(OSFileStore fileStore)Creates a copy of an OSFileStore. -
Method Summary
Modifier and Type Method Description java.lang.StringgetDescription()Description of the File SystemlonggetFreeInodes()Usable / free inodes on the drive.longgetFreeSpace()Free space on the drive.java.lang.StringgetLabel()Label of the File Systemjava.lang.StringgetLogicalVolume()Logical volume of the File System Provides an optional alternative volume identifier for the file system.java.lang.StringgetMount()Mountpoint of the File Systemjava.lang.StringgetName()Name of the File Systemjava.lang.StringgetOptions()Filesystem optionslonggetTotalInodes()Total / maximum number of inodes of the filesystem.longgetTotalSpace()Total space/capacity of the drive.java.lang.StringgetType()Type of the File System (FAT, NTFS, etx2, ext4, etc)longgetUsableSpace()Usable space on the drive.java.lang.StringgetUUID()UUID/GUID of the File Systemjava.lang.StringgetVolume()Volume name of the File SystemvoidsetDescription(java.lang.String value)Sets the File System descriptionvoidsetFreeInodes(long value)Sets usable inodes on the drive.voidsetFreeSpace(long value)Sets free space on the drive.voidsetLabel(java.lang.String value)Sets the label of the File SystemvoidsetLogicalVolume(java.lang.String value)Sets the logical volume of the File SystemvoidsetMount(java.lang.String value)Sets the mountpoint of the File SystemvoidsetName(java.lang.String value)Sets the File System namevoidsetOptions(java.lang.String value)Sets the File System optionsvoidsetTotalInodes(long value)Sets the total / maximum number of inodes on the filesystem.voidsetTotalSpace(long value)Sets the total space on the drive.voidsetType(java.lang.String value)Sets the File System typevoidsetUsableSpace(long value)Sets usable space on the drive.voidsetUUID(java.lang.String value)Sets the File System UUID/GUIDvoidsetVolume(java.lang.String value)Sets the volume name of the File Systemjava.lang.StringtoString()booleanupdateAtrributes()Make a best effort to update all the statistics about the file store without needing to recreate the file store list.
-
Constructor Details
-
OSFileStore
public OSFileStore()Constructor for OSFileStore.
-
OSFileStore
Creates a copy of an OSFileStore.- Parameters:
fileStore- OSFileStore which is copied
-
-
Method Details
-
getName
public java.lang.String getName()Name of the File System- Returns:
- The file system name
-
setName
public void setName(java.lang.String value)Sets the File System name- Parameters:
value- The name
-
getVolume
public java.lang.String getVolume()Volume name of the File System- Returns:
- The volume name of the file system
-
setVolume
public void setVolume(java.lang.String value)Sets the volume name of the File System- Parameters:
value- The volume name
-
getLabel
public java.lang.String getLabel()Label of the File System- Returns:
- The volume label of the file system, on Windows. Other operating systems is redundant with the name.
-
setLabel
public void setLabel(java.lang.String value)Sets the label of the File System- Parameters:
value- The label
-
getLogicalVolume
public java.lang.String getLogicalVolume()Logical volume of the File System Provides an optional alternative volume identifier for the file system. Only supported on Linux, provides symlink value via '/dev/mapper/' (used with LVM file systems).- Returns:
- The logical volume of the file system
-
setLogicalVolume
public void setLogicalVolume(java.lang.String value)Sets the logical volume of the File System- Parameters:
value- The logical volume
-
getMount
public java.lang.String getMount()Mountpoint of the File System- Returns:
- The mountpoint of the file system
-
setMount
public void setMount(java.lang.String value)Sets the mountpoint of the File System- Parameters:
value- The mountpoint
-
getDescription
public java.lang.String getDescription()Description of the File System- Returns:
- The file system description
-
setDescription
public void setDescription(java.lang.String value)Sets the File System description- Parameters:
value- The description
-
getType
public java.lang.String getType()Type of the File System (FAT, NTFS, etx2, ext4, etc)- Returns:
- The file system type
-
setType
public void setType(java.lang.String value)Sets the File System type- Parameters:
value- The type
-
getOptions
public java.lang.String getOptions()Filesystem options- Returns:
- A comma-deimited string of options
-
setOptions
public void setOptions(java.lang.String value)Sets the File System options- Parameters:
value- The options
-
getUUID
public java.lang.String getUUID()UUID/GUID of the File System- Returns:
- The file system UUID/GUID
-
setUUID
public void setUUID(java.lang.String value)Sets the File System UUID/GUID- Parameters:
value- The UUID/GUID
-
getFreeSpace
public long getFreeSpace()Free space on the drive. This space is unallocated but may require elevated permissions to write.- Returns:
- Free space on the drive (in bytes)
-
setFreeSpace
public void setFreeSpace(long value)Sets free space on the drive.- Parameters:
value- Bytes of free space.
-
getUsableSpace
public long getUsableSpace()Usable space on the drive. This is space available to unprivileged users.- Returns:
- Usable space on the drive (in bytes)
-
setUsableSpace
public void setUsableSpace(long value)Sets usable space on the drive.- Parameters:
value- Bytes of writable space.
-
getTotalSpace
public long getTotalSpace()Total space/capacity of the drive.- Returns:
- Total capacity of the drive (in bytes)
-
setTotalSpace
public void setTotalSpace(long value)Sets the total space on the drive.- Parameters:
value- Bytes of total space.
-
getFreeInodes
public long getFreeInodes()Usable / free inodes on the drive. Not applicable on Windows.- Returns:
- Usable / free inodes on the drive (count), or -1 if unimplemented
-
setFreeInodes
public void setFreeInodes(long value)Sets usable inodes on the drive.- Parameters:
value- Number of free inodes.
-
getTotalInodes
public long getTotalInodes()Total / maximum number of inodes of the filesystem. Not applicable on Windows.- Returns:
- Total / maximum number of inodes of the filesystem (count), or -1 if unimplemented
-
setTotalInodes
public void setTotalInodes(long value)Sets the total / maximum number of inodes on the filesystem.- Parameters:
value- Total / maximum count of inodes
-
updateAtrributes
public boolean updateAtrributes()Make a best effort to update all the statistics about the file store without needing to recreate the file store list. This method provides for more frequent periodic updates of file store statistics.- Returns:
- True if the update was (probably) successful, false if the disk was not found
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-