Example usage for org.springframework.web.bind.annotation RequestMethod DELETE

List of usage examples for org.springframework.web.bind.annotation RequestMethod DELETE

Introduction

In this page you can find the example usage for org.springframework.web.bind.annotation RequestMethod DELETE.

Prototype

RequestMethod DELETE

To view the source code for org.springframework.web.bind.annotation RequestMethod DELETE.

Click Source Link

Usage

From source file:com.bcknds.demo.mongo.controller.TodoController.java

@RequestMapping(method = RequestMethod.DELETE)
public @ResponseBody boolean remove(@RequestBody final Todo todo) {
    return todoService.remove(todo);
}

From source file:org.kurento.repository.RepositoryController.java

@RequestMapping(method = RequestMethod.DELETE, value = "/{itemId}")
public void removeRepositoryItem(@PathVariable("itemId") String itemId, HttpServletResponse response) {
    try {//  w w w  .  ja  va  2  s .  co  m
        repoService.removeRepositoryItem(itemId);
    } catch (ItemNotFoundException e) {
        try {
            response.sendError(HttpStatus.NOT_FOUND.value(), e.getMessage());
        } catch (IOException ioe) {
            ioe.printStackTrace();
            throw new KurentoException(ioe);
        }
    }
}

From source file:com.boxedfolder.carrot.web.client.CrudResource.java

@JsonView(View.Client.class)
@ResponseStatus(HttpStatus.OK)/*from   ww w . j a  v a 2 s  .co  m*/
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
public void delete(@PathVariable("id") Long id) {
    service.delete(id);
}

From source file:com.github.lynxdb.server.api.http.handlers.EpUid.java

@RequestMapping(path = "/tsmeta", method = { RequestMethod.GET, RequestMethod.POST, RequestMethod.PUT,
        RequestMethod.DELETE }, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity tsmeta() {
    return ResponseEntity.status(HttpStatus.NOT_IMPLEMENTED).build();
}

From source file:com.tsguild.pumpingunitdb.controller.HomeController.java

@RequestMapping(value = "/unit/{id}", method = RequestMethod.DELETE)
@ResponseStatus(HttpStatus.NO_CONTENT)/*from  w w w  .  jav  a2  s. c o m*/
public void deleteUnit(@PathVariable("id") int id) {
    // remove the Contact associated with the given id from the data layer
    dao.removeUnit(id);
}

From source file:com.artivisi.salary.payroll.system.controller.CutiController.java

@RequestMapping(value = "/cuti", method = RequestMethod.DELETE)
public void deleteCuti(@PathVariable(value = "id") String id) throws Exception {
    if (id == null) {
        throw new Exception("id tidak ada");
    }/* w w  w .j  a  v a2  s .c o m*/
    Cuti cuti = cutiService.findOne(id);
    if (cuti == null) {
        throw new Exception("Data tidak ditemukan");
    }
    cutiService.delete(cuti);
}

From source file:cz.fi.muni.pa036.airticketbooking.rest.BaggageRest.java

@RequestMapping(method = RequestMethod.DELETE)
public void deleteBaggage(@RequestBody @Valid Long baggage) {
    BaggageDto p = baggageService.getById(baggage);
    baggageService.delete(p);
}

From source file:com.tsg.cms.CategoryController.java

@RequestMapping(value = "/category/{id}", method = RequestMethod.DELETE)
@ResponseStatus(HttpStatus.NO_CONTENT)// ww w.  ja v  a2s .  c o  m
public void deleteCategory(@PathVariable("id") int id) {
    dao.removeCategory(id);
}

From source file:com.github.dbourdette.otto.web.controller.sources.EventsController.java

@RequestMapping(method = RequestMethod.DELETE)
public String clear(@PathVariable String name) {
    Source source = Source.findByName(name);

    if (source.isCapped()) {
        return "redirect:/sources/{name}/events";
    }//w  ww .j a v  a 2 s . c om

    source.clearEvents();

    flashScope.message("Events have been cleared for source " + name);

    return "redirect:/sources/{name}/events";
}

From source file:io.pivotal.ecosystem.service.HelloController.java

@RequestMapping(value = "/users/{username}", method = RequestMethod.DELETE)
ResponseEntity<Void> deleteUser(@PathVariable(value = "username") String username) {
    if (!userStore.userExists(username)) {
        return new ResponseEntity<>(HttpStatus.NOT_FOUND);
    }// w  w  w .j av a  2s . c o m
    userStore.delete(username);
    return new ResponseEntity<>(HttpStatus.OK);
}