}
public String addUser(String userName, String password, String firstName, String lastName, String email) throws IOException {
log.fine("Adding " + userName + "," + firstName + "," + lastName + "," + email);
String xml = createUserXml(userName, password, firstName, lastName, email);
Post request = new Post(getUsersUrl(), credentials);
request.addFile("file", xml.getBytes());
String result = request.executeAsString();
if (request.isUnAuthorized())
throw new UnAuthorizedException("Cannot add user " + userName, getUsersUrl());
if (request.isForbidden())
throw new DuplicateNameException("Cannot add user " + userName, getUsersUrl());
if (!request.isSuccessful())
throw new IOException("POST on " + getUsersUrl() + " with payload " + userName + "," + firstName + "," + lastName + "," + email + " not successful: " + result);
return request.getLocation();
}