Microsoft SDK for Java

compareIncludeExcludePatterns

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.

Syntax

public static int compareIncludeExcludePatterns(WildcardExpression include1, WildcardExpression exclude1, WildcardExpression include2, WildcardExpression exclude2, int cmp);

Include/Exclude Pair Comparisons

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    

Return Value

Returns a new comparison result, merged with the previous comparison result using mergeComparisonResults.

Parameters

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.

Exceptions

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.

© 1999 Microsoft Corporation. All rights reserved. Terms of use.