Package oshi.software.os.windows
Class WindowsFileSystem
- java.lang.Object
-
- oshi.software.common.AbstractFileSystem
-
- oshi.software.os.windows.WindowsFileSystem
-
- All Implemented Interfaces:
FileSystem
@ThreadSafe public class WindowsFileSystem extends AbstractFileSystem
The Windows File System containsOSFileStore
s which are a storage pool, device, partition, volume, concrete file system or other implementation specific means of file storage. In Windows, these are represented by a drive letter, e.g., "A:\" and "C:\"
-
-
Field Summary
Fields Modifier and Type Field Description private static int
BUFSIZE
private static int
FILE_CASE_PRESERVED_NAMES
private static int
FILE_CASE_SENSITIVE_SEARCH
private static int
FILE_DAX_VOLUME
private static int
FILE_FILE_COMPRESSION
private static int
FILE_NAMED_STREAMS
private static int
FILE_PERSISTENT_ACLS
private static int
FILE_READ_ONLY_VOLUME
private static int
FILE_SEQUENTIAL_WRITE_ONCE
private static int
FILE_SUPPORTS_ENCRYPTION
private static int
FILE_SUPPORTS_OBJECT_IDS
private static int
FILE_SUPPORTS_REPARSE_POINTS
private static int
FILE_SUPPORTS_SPARSE_FILES
private static int
FILE_SUPPORTS_TRANSACTIONS
private static int
FILE_SUPPORTS_USN_JOURNAL
private static int
FILE_UNICODE_ON_DISK
private static int
FILE_VOLUME_IS_COMPRESSED
private static int
FILE_VOLUME_QUOTAS
(package private) static long
MAX_WINDOWS_HANDLES
private static java.util.Map<java.lang.Integer,java.lang.String>
OPTIONS_MAP
private static int
SEM_FAILCRITICALERRORS
-
Fields inherited from class oshi.software.common.AbstractFileSystem
NETWORK_FS_TYPES, PSEUDO_FS_TYPES
-
-
Constructor Summary
Constructors Constructor Description WindowsFileSystem()
Constructor for WindowsFileSystem.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static java.lang.String
getDriveType(java.lang.String drive)
Private method for getting mounted drive type.java.util.List<OSFileStore>
getFileStores(boolean localOnly)
Get file stores on this machine Instantiates a list ofOSFileStore
objects, representing a storage pool, device, partition, volume, concrete file system or other implementation specific means of file storage.(package private) static java.util.ArrayList<OSFileStore>
getLocalVolumes(java.lang.String volumeToMatch)
Package private method for getting all mounted local drives.long
getMaxFileDescriptors()
The maximum number of open file descriptors.long
getMaxFileDescriptorsPerProcess()
The maximum number of open file descriptors per process.long
getOpenFileDescriptors()
The current number of open file descriptors.(package private) static java.util.List<OSFileStore>
getWmiVolumes(java.lang.String nameToMatch, boolean localOnly)
Package private method for getting logical drives listed in WMI.-
Methods inherited from class oshi.software.common.AbstractFileSystem
getFileStores
-
-
-
-
Field Detail
-
BUFSIZE
private static final int BUFSIZE
- See Also:
- Constant Field Values
-
SEM_FAILCRITICALERRORS
private static final int SEM_FAILCRITICALERRORS
- See Also:
- Constant Field Values
-
FILE_CASE_SENSITIVE_SEARCH
private static final int FILE_CASE_SENSITIVE_SEARCH
- See Also:
- Constant Field Values
-
FILE_CASE_PRESERVED_NAMES
private static final int FILE_CASE_PRESERVED_NAMES
- See Also:
- Constant Field Values
-
FILE_FILE_COMPRESSION
private static final int FILE_FILE_COMPRESSION
- See Also:
- Constant Field Values
-
FILE_DAX_VOLUME
private static final int FILE_DAX_VOLUME
- See Also:
- Constant Field Values
-
FILE_NAMED_STREAMS
private static final int FILE_NAMED_STREAMS
- See Also:
- Constant Field Values
-
FILE_PERSISTENT_ACLS
private static final int FILE_PERSISTENT_ACLS
- See Also:
- Constant Field Values
-
FILE_READ_ONLY_VOLUME
private static final int FILE_READ_ONLY_VOLUME
- See Also:
- Constant Field Values
-
FILE_SEQUENTIAL_WRITE_ONCE
private static final int FILE_SEQUENTIAL_WRITE_ONCE
- See Also:
- Constant Field Values
-
FILE_SUPPORTS_ENCRYPTION
private static final int FILE_SUPPORTS_ENCRYPTION
- See Also:
- Constant Field Values
-
FILE_SUPPORTS_OBJECT_IDS
private static final int FILE_SUPPORTS_OBJECT_IDS
- See Also:
- Constant Field Values
-
FILE_SUPPORTS_REPARSE_POINTS
private static final int FILE_SUPPORTS_REPARSE_POINTS
- See Also:
- Constant Field Values
-
FILE_SUPPORTS_SPARSE_FILES
private static final int FILE_SUPPORTS_SPARSE_FILES
- See Also:
- Constant Field Values
-
FILE_SUPPORTS_TRANSACTIONS
private static final int FILE_SUPPORTS_TRANSACTIONS
- See Also:
- Constant Field Values
-
FILE_SUPPORTS_USN_JOURNAL
private static final int FILE_SUPPORTS_USN_JOURNAL
- See Also:
- Constant Field Values
-
FILE_UNICODE_ON_DISK
private static final int FILE_UNICODE_ON_DISK
- See Also:
- Constant Field Values
-
FILE_VOLUME_IS_COMPRESSED
private static final int FILE_VOLUME_IS_COMPRESSED
- See Also:
- Constant Field Values
-
FILE_VOLUME_QUOTAS
private static final int FILE_VOLUME_QUOTAS
- See Also:
- Constant Field Values
-
OPTIONS_MAP
private static final java.util.Map<java.lang.Integer,java.lang.String> OPTIONS_MAP
-
MAX_WINDOWS_HANDLES
static final long MAX_WINDOWS_HANDLES
-
-
Method Detail
-
getFileStores
public java.util.List<OSFileStore> getFileStores(boolean localOnly)
Description copied from interface:FileSystem
Get file stores on this machine Instantiates a list ofOSFileStore
objects, 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.- Returns:
- A list of
OSFileStore
objects or an empty array if none are present.
-
getLocalVolumes
static java.util.ArrayList<OSFileStore> getLocalVolumes(java.lang.String volumeToMatch)
Package private method for getting all mounted local drives.- Parameters:
volumeToMatch
- an optional string to filter match, null otherwise- Returns:
- A list of
OSFileStore
objects representing all local mounted volumes
-
getWmiVolumes
static java.util.List<OSFileStore> getWmiVolumes(java.lang.String nameToMatch, boolean localOnly)
Package private method for getting logical drives listed in WMI.- Parameters:
nameToMatch
- an optional string to filter match, null otherwiselocalOnly
- Whether to only search local drives- Returns:
- A list of
OSFileStore
objects representing all network mounted volumes
-
getDriveType
private static java.lang.String getDriveType(java.lang.String drive)
Private method for getting mounted drive type.- Parameters:
drive
- Mounted drive- Returns:
- A drive type description
-
getOpenFileDescriptors
public long getOpenFileDescriptors()
Description copied from interface:FileSystem
The 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:FileSystem
The 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:FileSystem
The 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.
-
-