The Mac File System contains oshi.software.os.OSFileStores which are a storage pool, device, partition, volume, concrete file system or other implementation specific means of file storage. In macOS, these are found in the /Volumes directory.
| 65 | * the /Volumes directory. |
| 66 | */ |
| 67 | @ThreadSafe |
| 68 | public class MacFileSystem extends AbstractFileSystem { |
| 69 | |
| 70 | private static final Logger LOG = LoggerFactory.getLogger(MacFileSystem.class); |
| 71 | |
| 72 | public static final String OSHI_MAC_FS_PATH_EXCLUDES = "oshi.os.mac.filesystem.path.excludes"; |
| 73 | public static final String OSHI_MAC_FS_PATH_INCLUDES = "oshi.os.mac.filesystem.path.includes"; |
| 74 | public static final String OSHI_MAC_FS_VOLUME_EXCLUDES = "oshi.os.mac.filesystem.volume.excludes"; |
| 75 | public static final String OSHI_MAC_FS_VOLUME_INCLUDES = "oshi.os.mac.filesystem.volume.includes"; |
| 76 | |
| 77 | private static final List<PathMatcher> FS_PATH_EXCLUDES = FileSystemUtil |
| 78 | .loadAndParseFileSystemConfig(OSHI_MAC_FS_PATH_EXCLUDES); |
| 79 | private static final List<PathMatcher> FS_PATH_INCLUDES = FileSystemUtil |
| 80 | .loadAndParseFileSystemConfig(OSHI_MAC_FS_PATH_INCLUDES); |
| 81 | private static final List<PathMatcher> FS_VOLUME_EXCLUDES = FileSystemUtil |
| 82 | .loadAndParseFileSystemConfig(OSHI_MAC_FS_VOLUME_EXCLUDES); |
| 83 | private static final List<PathMatcher> FS_VOLUME_INCLUDES = FileSystemUtil |
| 84 | .loadAndParseFileSystemConfig(OSHI_MAC_FS_VOLUME_INCLUDES); |
| 85 | |
| 86 | // Regexp matcher for /dev/disk1 etc. |
| 87 | private static final Pattern LOCAL_DISK = Pattern.compile("/dev/disk\\d"); |
| 88 | |
| 89 | // User specifiable flags. |
| 90 | private static final int MNT_RDONLY = 0x00000001; |
| 91 | private static final int MNT_SYNCHRONOUS = 0x00000002; |
| 92 | private static final int MNT_NOEXEC = 0x00000004; |
| 93 | private static final int MNT_NOSUID = 0x00000008; |
| 94 | private static final int MNT_NODEV = 0x00000010; |
| 95 | private static final int MNT_UNION = 0x00000020; |
| 96 | private static final int MNT_ASYNC = 0x00000040; |
| 97 | private static final int MNT_CPROTECT = 0x00000080; |
| 98 | private static final int MNT_EXPORTED = 0x00000100; |
| 99 | private static final int MNT_QUARANTINE = 0x00000400; |
| 100 | private static final int MNT_LOCAL = 0x00001000; |
| 101 | private static final int MNT_QUOTA = 0x00002000; |
| 102 | private static final int MNT_ROOTFS = 0x00004000; |
| 103 | private static final int MNT_DOVOLFS = 0x00008000; |
| 104 | private static final int MNT_DONTBROWSE = 0x00100000; |
| 105 | private static final int MNT_IGNORE_OWNERSHIP = 0x00200000; |
| 106 | private static final int MNT_AUTOMOUNTED = 0x00400000; |
| 107 | private static final int MNT_JOURNALED = 0x00800000; |
| 108 | private static final int MNT_NOUSERXATTR = 0x01000000; |
| 109 | private static final int MNT_DEFWRITE = 0x02000000; |
| 110 | private static final int MNT_MULTILABEL = 0x04000000; |
| 111 | private static final int MNT_NOATIME = 0x10000000; |
| 112 | |
| 113 | private static final Map<Integer, String> OPTIONS_MAP = new HashMap<>(); |
| 114 | static { |
| 115 | OPTIONS_MAP.put(MNT_SYNCHRONOUS, "synchronous"); |
| 116 | OPTIONS_MAP.put(MNT_NOEXEC, "noexec"); |
| 117 | OPTIONS_MAP.put(MNT_NOSUID, "nosuid"); |
| 118 | OPTIONS_MAP.put(MNT_NODEV, "nodev"); |
| 119 | OPTIONS_MAP.put(MNT_UNION, "union"); |
| 120 | OPTIONS_MAP.put(MNT_ASYNC, "asynchronous"); |
| 121 | OPTIONS_MAP.put(MNT_CPROTECT, "content-protection"); |
| 122 | OPTIONS_MAP.put(MNT_EXPORTED, "exported"); |
| 123 | OPTIONS_MAP.put(MNT_QUARANTINE, "quarantined"); |
| 124 | OPTIONS_MAP.put(MNT_LOCAL, "local"); |
nothing calls this directly
no test coverage detected