parser.addAllowedElement(XML.USER_NAME);
}
public Representation get()
{
AuthDB db = (AuthDB)getRequest().getAttributes().get(AuthApplication.DB_ATTR);
try {
Representation entity = new DBIteratorRepresentation(MediaType.APPLICATION_XML,XML.USERS_NAME,db.getUsers(true),false);
entity.setCharacterSet(CharacterSet.UTF_8);
return entity;
} catch (SQLException ex) {
getContext().getLogger().log(Level.SEVERE,"Cannot get users from database.",ex);
getResponse().setStatus(Status.SERVER_ERROR_INTERNAL);