List of usage examples for org.springframework.http ResponseEntity ok
public static BodyBuilder ok()
From source file:com.consol.citrus.admin.web.ProjectController.java
@RequestMapping(method = RequestMethod.POST) public ResponseEntity open(@RequestBody String projectHome) { projectService.load(projectHome); return ResponseEntity.ok().build(); }
From source file:de.lgblaumeiser.ptm.rest.ActivityRestController.java
@RequestMapping(method = RequestMethod.POST, value = "/{activityId}") ResponseEntity<?> changeActivity(@PathVariable String activityId, @RequestBody ActivityBody activityData) { services.activityStore().retrieveById(valueOf(activityId)).ifPresent( a -> services.activityStore().store(a.changeActivity().setActivityName(activityData.activityName) .setBookingNumber(activityData.bookingNumber).setHidden(activityData.hidden).build())); return ResponseEntity.ok().build(); }
From source file:com.greglturnquist.HomeController.java
private ResponseEntity<?> getRawImage() { try {/*from w w w.j a v a 2 s. co m*/ Resource file = resourceLoader.getResource("file:upload-dir/keep-calm-and-learn-javascript.jpg"); return ResponseEntity.ok().contentLength(file.contentLength()).contentType(MediaType.IMAGE_JPEG) .body(new InputStreamResource(file.getInputStream())); } catch (IOException e) { return ResponseEntity.badRequest().body("Couldn't find it => " + e.getMessage()); } }
From source file:com.consol.citrus.demo.voting.web.VotingServiceController.java
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE) public ResponseEntity remove(@PathVariable("id") String votingId) { votingService.remove(votingId);/*from ww w. j a v a 2 s.co m*/ return ResponseEntity.ok().build(); }
From source file:com.saasovation.identityaccess.resource.NotificationResource.java
private ResponseEntity<String> currentNotificationLogResponse(NotificationLog aCurrentNotificationLog) { NotificationLogRepresentation log = new NotificationLogRepresentation(aCurrentNotificationLog); log.setLinkSelf(this.selfLink(aCurrentNotificationLog)); log.setLinkPrevious(this.previousLink(aCurrentNotificationLog)); String serializedLog = ObjectSerializer.instance().serialize(log); return ResponseEntity.ok().cacheControl(this.cacheControlFor(60)).body(serializedLog); }
From source file:fi.helsinki.opintoni.web.rest.publicapi.PublicImageResource.java
@RequestMapping(value = "/background/{oodiPersonId}", method = RequestMethod.GET, produces = MediaType.IMAGE_JPEG_VALUE) public ResponseEntity<BufferedImage> getUserBackgroundByOodiPersonId( @PathVariable("oodiPersonId") String oodiPersonId) throws IOException { return ResponseEntity.ok().headers(headersWithContentType(MediaType.IMAGE_JPEG)) .body(userSettingsService.getUserBackgroundImage(oodiPersonId)); }
From source file:org.lecture.controller.TutorialController.java
/** * Returns one Tutorial in html format./*from w w w . ja va2 s . c om*/ * * @param id the id of the topic to return. * @return a response. */ @RequestMapping(value = "/{id}", method = RequestMethod.GET, produces = "application/hal+json;charset=UTF-8") public ResponseEntity<TutorialResource> getOne(@PathVariable String id) { TutorialProcessor tutorialProcessor = new TutorialProcessor(); Tutorial tutorial = tutorialProcessor.processTutorial(tutorialRepository.findOne(id)); TutorialResource result = tutorialAssembler.toResource(tutorial); return ResponseEntity.ok().body(result); }
From source file:com.consol.citrus.admin.web.ProjectController.java
@RequestMapping(method = RequestMethod.PUT) public ResponseEntity update(@RequestBody Project project) { projectService.update(project); return ResponseEntity.ok().build(); }
From source file:org.kelvmiao.sevenwonders.web.controller.UserController.java
@RequestMapping(method = RequestMethod.GET, value = "/checkExist") ResponseEntity checkExist(@RequestParam("name") String name) { if (userService.checkExist(name)) return ResponseEntity.ok().build(); return ResponseEntity.noContent().build(); }