return new StringRepresentation("The alias '"+alias+"' is not a valid alias.");
}
if (alias!=null && !alias.equals(user.getAlias())) {
// rename
try {
if (!user.changeAlias(alias)) {
getResponse().setStatus(Status.CLIENT_ERROR_CONFLICT);
return new StringRepresentation("The alias '"+alias+"' is not available.");
}
} catch (SQLException ex) {
getContext().getLogger().log(Level.SEVERE,"Database error during while changing alias: "+ex.getMessage(),ex);