This method of the PermissionUtils Class compares sets of resources specified by include/exclude patterns. The include pattern specifies resources for which access will be granted, and the exclude rules specify resources that are to be excluded from the include rules.
public static int compareIncludeExcludePatterns(WildcardExpression include1, WildcardExpression exclude1, WildcardExpression include2, WildcardExpression exclude2, int cmp);
Pair 1 | Pair 2 | Result |
include * | include * | SUBSET |
exclude *.txt | ||
include * | include *.doc | SUPERSET |
exclude *.txt | ||
include * | include * | OVERLAP |
exclude *.txt | exclude *.doc | |
include * | include * | SUBSET |
exclude *.txt | exclude MyText.txt | |
include * | include *.txt | DISJOINT |
exclude *.txt |
Returns a new comparison result, merged with the previous comparison result using mergeComparisonResults.
include1 | For the first permission, the patterns that specify resources to grant access to, or null. |
exclude1 | For the first permission, the patterns that specify resources to exclude from the include rules. |
include2 | For the second permission, the patterns that specify resources to grant access to. |
exclude2 | For the second permission, the patterns that specify resources to exclude from the include rules. |
cmp | A previous comparison result for other resources of the permissions. For the first resource of a permission, this is typically SetComparison.EMPTY. |
IllegalArgumentException if any of the exclude rules are not a subset of one or more of the include rules, or if the exclude rules are specified without the include rules.