@POST @Path("{id}") @Consumes(MediaType.APPLICATION_FORM_URLENCODED) public void edit( @PathParam("id") Long id, @FormParam("name") String name, @FormParam("description") String description) { Genre genre = genreManager.get(id); if (genre != null) { genreManager.update(genre, name, description); } }
@DELETE @Path("{id}") public void delete(@PathParam("id") Long id) { genreManager.delete(genreManager.get(id)); }
@GET @Path("{id}") public Genre get(@PathParam("id") Long id) { return genreManager.get(id); }