List of usage examples for org.springframework.http HttpStatus NO_CONTENT
HttpStatus NO_CONTENT
To view the source code for org.springframework.http HttpStatus NO_CONTENT.
Click Source Link
From source file:guru.nidi.ramltester.spring.RamlRequestInterceptor.java
@Override public ClientHttpResponse intercept(HttpRequest request, byte[] body, ClientHttpRequestExecution execution) throws IOException { reportStore.storeReport(null);/*from w w w .j a va2 s . c om*/ final SpringHttpRequestRamlRequest ramlRequest = new SpringHttpRequestRamlRequest(request, body); final RamlReport report; final ClientHttpResponse response; if (notSending) { response = new MockClientHttpResponse((byte[]) null, HttpStatus.NO_CONTENT); report = checker.check(ramlRequest); } else { response = execution.execute(request, body); final SpringClientHttpResponseRamlResponse ramlResponse = new SpringClientHttpResponseRamlResponse( response); report = checker.check(ramlRequest, ramlResponse); } reportStore.storeReport(report); return response; }
From source file:com.tsg.cms.CategoryController.java
@RequestMapping(value = "/category/{id}", method = RequestMethod.DELETE) @ResponseStatus(HttpStatus.NO_CONTENT) public void deleteCategory(@PathVariable("id") int id) { dao.removeCategory(id);/*from w w w .j ava 2 s. com*/ }
From source file:nl.surfnet.coin.api.ConfigurableApiController.java
@RequestMapping(value = { "/group" }, method = RequestMethod.POST) @ResponseStatus(HttpStatus.NO_CONTENT) @ResponseBody/*from w w w.j a v a 2s . c o m*/ public void addGroup(@RequestBody Group20 group) { LOG.info("Request to add Group {}", group); configurableGroupProvider.addGroup(group); }
From source file:fr.gmjgav.controller.ReportController.java
@RequestMapping(value = "/{barId}/{beerId}", method = POST) public ResponseEntity<?> post(@PathVariable long barId, @PathVariable long beerId) { Bar bar = barRepository.findOne(barId); Beer beer = beerRepository.findOne(beerId); if (reportRepository.findByBarIdAndBeerId(barId, beerId).isEmpty()) { Report report = new Report(bar, beer); reportRepository.save(report);// ww w.j ava 2s. c om return new ResponseEntity<>(HttpStatus.CREATED); } return new ResponseEntity<>(HttpStatus.NO_CONTENT); }
From source file:com.swcguild.addressbookarch.controller.HomeController.java
@RequestMapping(value = "/address/{id}", method = RequestMethod.DELETE) @ResponseStatus(HttpStatus.NO_CONTENT) public void deleteAddress(@PathVariable("id") int id) { // remove the Address associated with the given id from the data layer dao.removeAddress(id);//from ww w . j a va 2 s. c o m }
From source file:com.thesoftwareguild.addressbook.controller.HomeController.java
@RequestMapping(value = "/address/{id}", method = RequestMethod.PUT) @ResponseStatus(HttpStatus.NO_CONTENT) public void putAddress(@PathVariable("id") int id, @Valid @RequestBody Address address) { address.setAddressId(id);//from ww w .j av a2 s.co m dao.updateAddress(address); }
From source file:org.openmrs.module.hl7query.web.controller.Hl7QuerySessionController.java
/** * Logs the client out//from w ww . j av a 2 s . c om * @should log the client out */ @RequestMapping(method = RequestMethod.DELETE) @ResponseBody @ResponseStatus(value = HttpStatus.NO_CONTENT) public void delete() { Context.logout(); }
From source file:org.zols.datastore.web.DataControler.java
@RequestMapping(value = "/{id}", method = PUT) @ResponseStatus(value = HttpStatus.NO_CONTENT) public void update(@PathVariable(value = "schemaId") String schemaName, @PathVariable(value = "id") String id, @RequestBody Map<String, Object> jsonData) throws DataStoreException { dataService.update(schemaName, jsonData); }
From source file:com.ge.predix.acs.commons.web.ResponseEntityBuilderTest.java
@Test public void testUpdatedWithLocation() { ResponseEntity<Object> created = ResponseEntityBuilder.created("/report/1", Boolean.TRUE); Assert.assertNotNull(created);// ww w . j a v a 2 s .c o m Assert.assertNull(created.getBody()); Assert.assertEquals(created.getStatusCode(), HttpStatus.NO_CONTENT); Assert.assertNotNull(created.getHeaders()); URI location = created.getHeaders().getLocation(); Assert.assertEquals(location.getPath(), "/report/1"); }
From source file:com.tsg.cms.BlogPostController.java
@RequestMapping(value = "/blogPost/{id}", method = RequestMethod.DELETE) @ResponseStatus(HttpStatus.NO_CONTENT) public void deleteBlogPost(@PathVariable("id") int id) { blogPostDao.removeBlogPost(id);/*from w ww . j a v a2s . co m*/ }