Class WindowsOSFileStore

java.lang.Object
oshi.software.common.AbstractOSFileStore
oshi.software.common.os.windows.WindowsOSFileStore
All Implemented Interfaces:
OSFileStore

@ThreadSafe public abstract class WindowsOSFileStore extends AbstractOSFileStore
Common base class for Windows OSFileStore implementations, containing shared fields and getters.
  • Constructor Details

    • WindowsOSFileStore

      protected WindowsOSFileStore(String name, String volume, String label, String mount, String options, String uuid, boolean local, String logicalVolume, String description, String fsType, long freeSpace, long usableSpace, long totalSpace, long freeInodes, long totalInodes)
  • Method Details

    • getLogicalVolume

      public String getLogicalVolume()
      Description copied from interface: OSFileStore
      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
    • getDescription

      public String getDescription()
      Description copied from interface: OSFileStore
      Description of the File System.
      Returns:
      The file system description
    • getType

      public String getType()
      Description copied from interface: OSFileStore
      Type of the File System (FAT, NTFS, etx2, ext4, etc.)
      Returns:
      The file system type
    • getFreeSpace

      public long getFreeSpace()
      Description copied from interface: OSFileStore
      Free space on the drive. This space is unallocated but may require elevated permissions to write.
      Returns:
      Free space on the drive (in bytes)
    • getUsableSpace

      public long getUsableSpace()
      Description copied from interface: OSFileStore
      Usable space on the drive. This is space available to unprivileged users.
      Returns:
      Usable space on the drive (in bytes)
    • getTotalSpace

      public long getTotalSpace()
      Description copied from interface: OSFileStore
      Total space/capacity of the drive.
      Returns:
      Total capacity of the drive (in bytes)
    • getFreeInodes

      public long getFreeInodes()
      Description copied from interface: OSFileStore
      Usable / free inodes on the drive. Not applicable on Windows.
      Returns:
      Usable / free inodes on the drive (count), or -1 if unimplemented
    • getTotalInodes

      public long getTotalInodes()
      Description copied from interface: OSFileStore
      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
    • updateFrom

      protected void updateFrom(OSFileStore fileStore)
      Sets fields from a matching file store during attribute updates.
      Parameters:
      fileStore - the file store with updated values
    • updateSpace

      protected void updateSpace(long freeSpace, long usableSpace, long totalSpace)
      Updates only the space fields, bypassing full volume enumeration.
      Parameters:
      freeSpace - free space in bytes
      usableSpace - usable space in bytes
      totalSpace - total space in bytes