use of nl.uva.cs.lobcder.rest.wrappers.UsersWrapperList in project lobcder by skoulouzis.
the class UsersService method getXml.
@Path("query/")
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public UsersWrapperList getXml() throws FileNotFoundException, VlException, URISyntaxException, IOException, MalformedURLException, Exception {
MyPrincipal mp = (MyPrincipal) request.getAttribute("myprincipal");
if (mp.isAdmin()) {
try (Connection cn = getCatalogue().getConnection()) {
List<UsersWrapper> res = queryUsers(cn);
UsersWrapperList uwl = new UsersWrapperList();
uwl.setUsers(res);
return uwl;
} catch (SQLException ex) {
log.log(Level.SEVERE, null, ex);
throw new WebApplicationException(Response.Status.INTERNAL_SERVER_ERROR);
}
}
return null;
}
Aggregations