Source source = resolver.resolveURI(uri);
if (source instanceof RestrictableSource) {
RestrictableSource restrictablesource = (RestrictableSource)source;
restrictablesource.setSourceCredential(new SourceCredential(principal, password));
SourcePermission permission =
new PrincipalSourcePermission(subject, privilege, inheritable, negative);
restrictablesource.removeSourcePermission(permission);