/** * Constructs a new access control policy condition that compares two * strings. * * @param type * The type of comparison to perform. * @param key * The access policy condition key specifying where to get the * first string for the comparison (ex: aws:UserAgent). See * {@link ConditionFactory} for a list of the condition keys * available for all services. * @param value * The second string to compare against. When using * {@link StringComparisonType#StringLike} or * {@link StringComparisonType#StringNotLike} this may contain * the multi-character wildcard (*) or the single-character * wildcard (?). */ public StringCondition(StringComparisonType type, String key, String value) { super.type = type.toString(); super.conditionKey = key; super.values = Arrays.asList(new String[] {value}); }
/** * Constructs a new access control policy condition that compares two * strings. * * @param type The type of comparison to perform. * @param key The access policy condition key specifying where to get the * first string for the comparison (ex: aws:UserAgent). See * {@link ConditionFactory} for a list of the condition keys * available for all services. * @param value The second string to compare against. When using * {@link StringComparisonType#StringLike} or * {@link StringComparisonType#StringNotLike} this may contain * the multi-character wildcard (*) or the single-character * wildcard (?). */ public StringCondition(StringComparisonType type, String key, String value) { super.type = type.toString(); super.conditionKey = key; super.values = Arrays.asList(new String[] { value }); }
/** * Constructs a new access control policy condition that compares two * strings. * * @param type * The type of comparison to perform. * @param key * The access policy condition key specifying where to get the * first string for the comparison (ex: aws:UserAgent). See * {@link ConditionFactory} for a list of the condition keys * available for all services. * @param value * The second string to compare against. When using * {@link StringComparisonType#StringLike} or * {@link StringComparisonType#StringNotLike} this may contain * the multi-character wildcard (*) or the single-character * wildcard (?). */ public StringCondition(StringComparisonType type, String key, String value) { super.type = type.toString(); super.conditionKey = key; super.values = Arrays.asList(new String[] {value}); }
/** * Constructs a new access control policy condition that compares two * strings. * * @param type * The type of comparison to perform. * @param key * The access policy condition key specifying where to get the * first string for the comparison (ex: aws:UserAgent). See * {@link ConditionFactory} for a list of the condition keys * available for all services. * @param value * The second string to compare against. When using * {@link StringComparisonType#StringLike} or * {@link StringComparisonType#StringNotLike} this may contain * the multi-character wildcard (*) or the single-character * wildcard (?). */ public StringCondition(StringComparisonType type, String key, String value) { super.type = type.toString(); super.conditionKey = key; super.values = Arrays.asList(new String[] {value}); }
/** * Constructs a new access control policy condition that compares two * strings. * * @param type The type of comparison to perform. * @param key The access policy condition key specifying where to get the * first string for the comparison (ex: aws:UserAgent). See * {@link ConditionFactory} for a list of the condition keys * available for all services. * @param value The second string to compare against. When using * {@link StringComparisonType#StringLike} or * {@link StringComparisonType#StringNotLike} this may contain * the multi-character wildcard (*) or the single-character * wildcard (?). */ public StringCondition(StringComparisonType type, String key, String value) { super.type = type.toString(); super.conditionKey = key; super.values = Arrays.asList(new String[] { value }); }
/** * Constructs a new access control policy condition that compares two * strings. * * @param type The type of comparison to perform. * @param key The access policy condition key specifying where to get the * first string for the comparison (ex: aws:UserAgent). See * {@link ConditionFactory} for a list of the condition keys * available for all services. * @param value The second string to compare against. When using * {@link StringComparisonType#StringLike} or * {@link StringComparisonType#StringNotLike} this may contain * the multi-character wildcard (*) or the single-character * wildcard (?). */ public StringCondition(StringComparisonType type, String key, String value) { super.type = type.toString(); super.conditionKey = key; super.values = Arrays.asList(new String[] { value }); }
@Test public void testS3ConditionFactory() { CannedAccessControlList acl = CannedAccessControlList.Private; Condition c = S3ConditionFactory.newCannedACLCondition(acl); assertEquals(c.getType(), StringComparisonType.StringEquals.toString()); assertEquals(c.getConditionKey(), "s3:x-amz-acl"); assertEquals(c.getValues().get(0), acl.toString()); }