Class LinuxFileSystem
java.lang.Object
oshi.software.common.AbstractFileSystem
oshi.software.common.os.linux.LinuxFileSystem
- All Implemented Interfaces:
FileSystem
- Direct Known Subclasses:
LinuxFileSystemNF
The Linux File System contains
OSFileStores which are a storage pool, device, partition,
volume, concrete file system or other implementation specific means of file storage. In Linux, these are found in the
/proc/mount filesystem, excluding temporary and kernel mounts.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringConfiguration key for path excludes.static final StringConfiguration key for path includes.static final StringConfiguration key for volume excludes.static final StringConfiguration key for volume includes.Fields inherited from class AbstractFileSystem
NETWORK_FS_TYPES, PSEUDO_FS_TYPES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionBuilds a map of filesystem UUIDs to device paths.getFileStores(boolean localOnly) Get file stores on this machine Instantiates a list ofOSFileStoreobjects, representing a storage pool, device, partition, volume, concrete file system or other implementation specific means of file storage.longThe maximum number of open file descriptors.longThe maximum number of open file descriptors per process.longThe current number of open file descriptors.protected abstract long[]queryStatvfs(String path) Queries filesystem statistics for the given mount path.Methods inherited from class AbstractFileSystem
getFileStores
-
Field Details
-
OSHI_LINUX_FS_PATH_EXCLUDES
Configuration key for path excludes.- See Also:
-
OSHI_LINUX_FS_PATH_INCLUDES
Configuration key for path includes.- See Also:
-
OSHI_LINUX_FS_VOLUME_EXCLUDES
Configuration key for volume excludes.- See Also:
-
OSHI_LINUX_FS_VOLUME_INCLUDES
Configuration key for volume includes.- See Also:
-
-
Constructor Details
-
LinuxFileSystem
protected LinuxFileSystem()Default constructor.
-
-
Method Details
-
queryStatvfs
Queries filesystem statistics for the given mount path.Returns an array of [totalInodes, freeInodes, totalSpace, usableSpace, freeSpace], or
nullon failure (the caller will fall back toFilemethods for space values).- Parameters:
path- the mount path to query- Returns:
- array of [totalInodes, freeInodes, totalSpace, usableSpace, freeSpace], or
nullon failure
-
getFileStores
Description copied from interface:FileSystemGet file stores on this machine Instantiates a list ofOSFileStoreobjects, representing a storage pool, device, partition, volume, concrete file system or other implementation specific means of file storage.- Parameters:
localOnly- If true, filters the list to only local file stores. On Windows, also excluded CD-ROM drives.- Returns:
- A list of
OSFileStoreobjects or an empty array if none are present.
-
buildUuidMap
-
getOpenFileDescriptors
public long getOpenFileDescriptors()Description copied from interface:FileSystemThe current number of open file descriptors. A file descriptor is an abstract handle used to access I/O resources such as files and network connections. On UNIX-based systems there is a system-wide limit on the number of open file descriptors. On Windows systems, this method returns the total number of handles held by Processes. While Windows handles are conceptually similar to file descriptors, they may also refer to a number of non-I/O related objects.- Returns:
- The number of open file descriptors if available, 0 otherwise.
-
getMaxFileDescriptors
public long getMaxFileDescriptors()Description copied from interface:FileSystemThe maximum number of open file descriptors. A file descriptor is an abstract handle used to access I/O resources such as files and network connections. On UNIX-based systems there is a system-wide limit on the number of open file descriptors. On Windows systems, this method returns the theoretical max number of handles (2^24-2^15 on 32-bit, 2^24-2^16 on 64-bit). There may be a lower per-process limit. While Windows handles are conceptually similar to file descriptors, they may also refer to a number of non-I/O related objects.- Returns:
- The maximum number of file descriptors if available, 0 otherwise.
-
getMaxFileDescriptorsPerProcess
public long getMaxFileDescriptorsPerProcess()Description copied from interface:FileSystemThe maximum number of open file descriptors per process. This returns the upper limit which applies to each process. The actual limit of a process may be lower if configured.- Returns:
- The maximum number of file descriptors of each process if available, 0 otherwise.
-