Class FilenameUtils
java.lang.Object
com.streamwide.smartms.lib.template.serialization.FilenameUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanwildcardMatchOnSystem(String fileName, String wildcardMatcher) Checks a fileName to see if it matches the specified wildcard matcher using the case rules of the system.
-
Method Details
-
wildcardMatchOnSystem
public static boolean wildcardMatchOnSystem(@Nullable String fileName, @Nullable String wildcardMatcher) Checks a fileName to see if it matches the specified wildcard matcher using the case rules of the system.The wildcard matcher uses the characters '?' and '*' to represent a single or multiple (zero or more) wildcard characters. This is the same as often found on Dos/Unix command lines. The check is case-sensitive on Unix and case-insensitive on Windows.
wildcardMatch("c.txt", "*.txt") --> true wildcardMatch("c.txt", "*.jpg") --> false wildcardMatch("a/b/c.txt", "a/b/*") --> true wildcardMatch("c.txt", "*.???") --> true wildcardMatch("c.txt", "*.????") --> falseN.B. the sequence "*?" does not work properly at present in match strings.- Parameters:
fileName- the fileName to match onwildcardMatcher- the wildcard string to match against- Returns:
- true if the fileName matches the wildcard string
- See Also:
-