}
public ListBoxModel doFillCredentialsIdItems(@AncestorInPath Item context,
@QueryParameter String realm) {
if (context == null || !context.hasPermission(Item.CONFIGURE)) {
return new StandardListBoxModel();
}
List<DomainRequirement> domainRequirements;
if (realm == null) {
domainRequirements = Collections.<DomainRequirement>emptyList();
} else {
if (realm.startsWith("<") && realm.contains(">")) {
int index = realm.indexOf('>');
assert index > 1;
domainRequirements = URIRequirementBuilder.fromUri(realm.substring(1, index).trim()).build();
} else {
domainRequirements = Collections.<DomainRequirement>emptyList();
}
}
return new StandardListBoxModel()
.withEmptySelection()
.withMatching(
CredentialsMatchers.anyOf(
CredentialsMatchers.instanceOf(StandardUsernamePasswordCredentials.class),
CredentialsMatchers.instanceOf(StandardCertificateCredentials.class),