} catch (Exception e) {
e.printStackTrace();
roles = "failure";
}
response.setEntity(new StringRepresentation(roles, MediaType.TEXT_PLAIN));
} else if (request.getMethod().equals(Method.GET)) {
response.setEntity(new StringRepresentation(fetchDetailsByUserName(username),
MediaType.TEXT_PLAIN));
} else if (request.getMethod().equals(Method.DELETE)) {
String message;
try {
myUserService.deleteUser(username);
message = username + " deleted";
} catch (Exception e) {
message = "couldn't delete " + username;
}
response.setEntity(new StringRepresentation(message, MediaType.TEXT_PLAIN));
} else {
response.setStatus(Status.CLIENT_ERROR_BAD_REQUEST);
}
}