}
public URI createRole(String rolename, Credentials credentials) throws RoleExistsException, IOException {
Value userExists = getResource(new URIValue(domain+roles+rolename), credentials);
if ( userExists == NullValue.NULL || userExists != null ) {
throw new RoleExistsException(new ErrorMessage("roleExists", new String[] { rolename }));
} else {
URI roleUri = new URIValue(roles+rolename);
MkcolMethod mkcolMethod = new MkcolMethod(domain+roleUri.toString());
mkcolMethod.setDoAuthentication(true);
HttpState httpState = new HttpState();