Class MacOSFileStore
java.lang.Object
oshi.software.common.AbstractOSFileStore
oshi.software.common.os.mac.MacOSFileStore
- All Implemented Interfaces:
OSFileStore
- Direct Known Subclasses:
MacOSFileStoreJNA
Common OSFileStore fields and getters for macOS implementations.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMacOSFileStore(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 Summary
Modifier and TypeMethodDescriptionDescription of the File System.longUsable / free inodes on the drive.longFree space on the drive.Logical volume of the File System.longTotal / maximum number of inodes of the filesystem.longTotal space/capacity of the drive.getType()Type of the File System (FAT, NTFS, etx2, ext4, etc.)longUsable space on the drive.protected voidupdateFrom(OSFileStore fileStore) Copies attributes from another file store into this one.protected voidupdateSpaceAndInodes(long freeSpace, long usableSpace, long totalSpace, long freeInodes, long totalInodes) Updates only the space and inode fields, bypassing full enumeration.Methods inherited from class AbstractOSFileStore
getLabel, getMount, getName, getOptions, getUUID, getVolume, isLocal, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface OSFileStore
updateAttributes
-
Constructor Details
-
MacOSFileStore
-
-
Method Details
-
getLogicalVolume
Description copied from interface:OSFileStoreLogical 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
Description copied from interface:OSFileStoreDescription of the File System.- Returns:
- The file system description
-
getType
Description copied from interface:OSFileStoreType of the File System (FAT, NTFS, etx2, ext4, etc.)- Returns:
- The file system type
-
getFreeSpace
public long getFreeSpace()Description copied from interface:OSFileStoreFree 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:OSFileStoreUsable 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:OSFileStoreTotal space/capacity of the drive.- Returns:
- Total capacity of the drive (in bytes)
-
getFreeInodes
public long getFreeInodes()Description copied from interface:OSFileStoreUsable / 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:OSFileStoreTotal / 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
Copies attributes from another file store into this one.- Parameters:
fileStore- the source file store
-
updateSpaceAndInodes
protected void updateSpaceAndInodes(long freeSpace, long usableSpace, long totalSpace, long freeInodes, long totalInodes) Updates only the space and inode fields, bypassing full enumeration.- Parameters:
freeSpace- free space in bytesusableSpace- usable space in bytestotalSpace- total space in bytesfreeInodes- free inodestotalInodes- total inodes
-