// Calling getAbsolutePath will ensure the filterPath has the native file separator characters. But
// it is also important that the pattern use native separators because the ultimate matching will be
// against native file paths.
filterPattern = FileUtil.useNativeSlash(filterPattern);
return new PathFilter(FilenameUtils.normalize(filterPath.getAbsolutePath()), filterPattern);
}