Advertisement
Guest User

Untitled

a guest
Jun 28th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.56 KB | None | 0 0
  1. @GET
  2. @Path("{id}")
  3. @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
  4. public Response getPodcastById(@PathParam("id") Long id, @QueryParam("detailed") boolean detailed)
  5.         throws IOException, AppException {
  6.     Podcast podcastById = podcastService.getPodcastById(id);
  7.     return Response.ok() //200
  8.             .entity(podcastById, detailed ? new Annotation[]{PodcastDetailedView.Factory.get()} : new Annotation[0])
  9.             .header("Access-Control-Allow-Origin", "*")
  10.             .header("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT")
  11.             .allow("OPTIONS").build();
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement