Class OSFileStore

java.lang.Object
oshi.software.os.OSFileStore

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.
  • 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.String getDescription()
    Description of the File System
    long getFreeInodes()
    Usable / free inodes on the drive.
    long getFreeSpace()
    Free space on the drive.
    java.lang.String getLogicalVolume()
    Logical volume of the File System Provides an optional alternative volume identifier for the file system.
    java.lang.String getMount()
    Mountpoint of the File System
    java.lang.String getName()
    Name of the File System
    java.lang.String getOptions()
    Filesystem options
    long getTotalInodes()
    Total / maximum number of inodes of the filesystem.
    long getTotalSpace()
    Total space/capacity of the drive.
    java.lang.String getType()
    Type of the File System (FAT, NTFS, etx2, ext4, etc)
    long getUsableSpace()
    Usable space on the drive.
    java.lang.String getUUID()
    UUID/GUID of the File System
    java.lang.String getVolume()
    Volume of the File System
    void setDescription​(java.lang.String value)
    Sets the File System description
    void setFreeInodes​(long value)
    Sets usable inodes on the drive.
    void setFreeSpace​(long value)
    Sets free space on the drive.
    void setLogicalVolume​(java.lang.String value)
    Sets the logical volume of the File System
    void setMount​(java.lang.String value)
    Sets the mountpoint of the File System
    void setName​(java.lang.String value)
    Sets the File System name
    void setOptions​(java.lang.String value)
    Sets the File System options
    void setTotalInodes​(long value)
    Sets the total / maximum number of inodes on the filesystem.
    void setTotalSpace​(long value)
    Sets the total space on the drive.
    void setType​(java.lang.String value)
    Sets the File System type
    void setUsableSpace​(long value)
    Sets usable space on the drive.
    void setUUID​(java.lang.String value)
    Sets the File System UUID/GUID
    void setVolume​(java.lang.String value)
    Sets the volume of the File System
    java.lang.String toString()  
    boolean updateAtrributes()
    Make a best effort to update all the statistics about the file store without needing to recreate the file store list.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • OSFileStore

      public OSFileStore()

      Constructor for OSFileStore.

    • OSFileStore

      public OSFileStore​(OSFileStore fileStore)
      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 of the File System
      Returns:
      The volume of the file system
    • 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
    • setVolume

      public void setVolume​(java.lang.String value)
      Sets the volume of the File System
      Parameters:
      value - The volume
    • 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:
      toString in class java.lang.Object