Example #1
0
 private Feed findOrThrowException(Long id) {
   Feed feed = feedRepository.findOne(id);
   if (feed == null) {
     throw new ResourceNotFoundException();
   }
   return feed;
 }
Example #2
0
 @RequestMapping(value = "", method = GET)
 public FeedGetResponse get(@PathVariable("id") Long id) {
   Feed feed = feedRepository.findOne(id);
   if (feed != null) {
     return resourceAssemblers.toResource(feed, FeedGetResponse.class);
   } else {
     return new FeedGetResponse();
   }
 }