java.lang.Object
oshi.util.FileSystemUtil
Utility class for common filesystem code
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isFileStoreExcluded
(String path, String volume, List<PathMatcher> pathIncludes, List<PathMatcher> pathExcludes, List<PathMatcher> volumeIncludes, List<PathMatcher> volumeExcludes) Evaluates if file store (identified bypath
andvolume
) should be excluded or not based on configurationpathIncludes, pathExcludes, volumeIncludes, volumeExcludes
.static List<PathMatcher>
loadAndParseFileSystemConfig
(String configPropertyName) Load from config and parse file system include/exclude line.static boolean
matches
(Path text, List<PathMatcher> patterns) Checks iftext
matches any of @param patterns}.static List<PathMatcher>
parseFileSystemConfig
(String config) Parse file system include/exclude line.
-
Method Details
-
isFileStoreExcluded
public static boolean isFileStoreExcluded(String path, String volume, List<PathMatcher> pathIncludes, List<PathMatcher> pathExcludes, List<PathMatcher> volumeIncludes, List<PathMatcher> volumeExcludes) Evaluates if file store (identified bypath
andvolume
) should be excluded or not based on configurationpathIncludes, pathExcludes, volumeIncludes, volumeExcludes
. Inclusion has priority over exclusion. If no exclusion/inclusion pattern is specified, then filestore is not excluded.- Parameters:
path
- Mountpoint of filestore.volume
- Filestore volume.pathIncludes
- List of patterns for path inclusions.pathExcludes
- List of patterns for path exclusions.volumeIncludes
- List of patterns for volume inclusions.volumeExcludes
- List of patterns for volume exclusions.- Returns:
true
if file store should be excluded orfalse
otherwise.
-
loadAndParseFileSystemConfig
Load from config and parse file system include/exclude line.- Parameters:
configPropertyName
- The config property containing the line to be parsed.- Returns:
- List of PathMatchers to be used to match filestore volume and path.
-
parseFileSystemConfig
Parse file system include/exclude line.- Parameters:
config
- The config line to be parsed.- Returns:
- List of PathMatchers to be used to match filestore volume and path.
-
matches
Checks iftext
matches any of @param patterns}.- Parameters:
text
- The text to be matched.patterns
- List of patterns.- Returns:
true
if given text matches at least one glob pattern orfalse
otherwise.- See Also:
-