private static boolean isHostPattern(final String s) {
return s.indexOf('*') >= 0 || s.indexOf('?') >= 0;
}
private static boolean isHostMatch(final String pattern, final String name) {
final FileNameMatcher fn;
try {
fn = new FileNameMatcher(pattern, null);
}
catch(InvalidPatternException e) {
return false;
}
fn.append(name);
return fn.isMatch();
}