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.springsource.greenhouse.develop.AppController.java

/**
 * Delete an application for the developer.
 *//* w  w  w. j a  v  a 2  s . com*/
@RequestMapping(value = "/develop/apps/{slug}", method = RequestMethod.DELETE)
public String delete(@PathVariable String slug, Account account) {
    connectedAppRepository.deleteApp(account.getId(), slug);
    return "redirect:/develop/apps";
}

From source file:org.callistasoftware.netcare.web.mobile.controller.PushApi.java

@RequestMapping(value = "/gcm", method = RequestMethod.DELETE)
@ResponseBody/*  ww w  .ja v  a2 s  .c  o  m*/
public void gcmUnregistration() {
    this.logAccessWithoutPdl("unregister", "gcm");
    service.unregisterGcm();
}

From source file:org.openmrs.module.webservices.rest.web.controller.BarebonesResourceController.java

@RequestMapping(value = "/barebones/{barebonesId}", method = RequestMethod.DELETE)
@ResponseBody//from  w w w . j ava  2 s  . c  om
public SimpleBarebones deleteBarebones(@PathVariable int barebonesId) {
    Barebones barebones = Context.getService(BarebonesService.class).getBarebonesById(barebonesId);

    //set adverse reaction retired to true and retirer to authenticated user
    barebones.setRetired(true);
    barebones.setRetiredBy(Context.getAuthenticatedUser());
    barebones.setDateRetired(new Date());
    barebones.setRetireReason("Deleted");
    Barebones newBarebones = Context.getService(BarebonesService.class).saveOrUpdateBarebones(barebones);

    return new SimpleBarebones(newBarebones);
}

From source file:edu.sjsu.cmpe275.lab2.controller.ManageFriendshipController.java

/** Remove a friendship object
 (10) Remove a friend/*from ww w  .ja v  a 2  s.com*/
 Path:friends/{id1}/{id2}
 Method: DELETE
        
 This request removes the friendship relation between the two persons.
 If either person does not exist, return 404.
 If the two persons are not friends, return 404. Otherwise,
 Remove this friendship relation. Return HTTP code 200 and a meaningful text message if all is successful.
        
 * @param a         Description of a
 * @param b         Description of b
 * @return         Description of c
 */

@RequestMapping(value = "/{id1}/{id2}", method = RequestMethod.DELETE)
@ResponseBody
public ResponseEntity deleteFriendship(@PathVariable("id1") long id1, @PathVariable("id2") long id2) {
    int result = friendshipDao.delete(id1, id2);
    if (result == 0) {
        return new ResponseEntity(new String[] { "Delete friendship successfuly" }, HttpStatus.OK);
    } else {
        return new ResponseEntity(new String[] { "Can not find persons" }, HttpStatus.NOT_FOUND);
    }
}

From source file:org.messic.server.facade.controllers.rest.AuthorController.java

@ApiMethod(path = "/services/authors/{authorSid}", verb = ApiVerb.DELETE, description = "Remove an author (and all its content) with sid {authorSid}", produces = {})
@ApiErrors(apierrors = { @ApiError(code = UnknownMessicRESTException.VALUE, description = "Unknown error"),
        @ApiError(code = NotAuthorizedMessicRESTException.VALUE, description = "Forbidden access") })
@RequestMapping(value = "/{authorSid}", method = RequestMethod.DELETE)
@ResponseStatus(HttpStatus.OK)//from  w  ww .  ja v  a  2  s  . c  o m
@ResponseBody
@ApiResponseObject
public void removeAuthor(
        @PathVariable @ApiParam(name = "authorSid", description = "Sid of the author to remove", paramType = ApiParamType.PATH, required = true) Long authorSid)
        throws UnknownMessicRESTException, NotAuthorizedMessicRESTException {
    User user = SecurityUtil.getCurrentUser();
    try {
        authorAPI.remove(user, authorSid);
    } catch (Exception e) {
        log.error("failed!", e);
        throw new UnknownMessicRESTException(e);
    }
}

From source file:com.haoocai.jscheduler.web.controller.TaskController.java

@RequestMapping(value = "/delete/{namespace}/{app}/{name}", method = RequestMethod.DELETE)
public CommonResult deleteTask(@PathVariable String namespace, @PathVariable String app,
        @PathVariable String name) {
    taskService.delete(new TaskID(namespace, app, name));
    return CommonResult.successRet();
}

From source file:fi.vm.sade.osoitepalvelu.kooste.mvc.SavesController.java

@ApiOperation("Poistaa yksittisen kyttjn oman tallennetun haun.")
@ApiResponse(code = HttpStatus.SC_NOT_FOUND, message = "Hakua ei lytynyt id:ll.")
//    @ResponseStatus(value = HttpStatus.SC_OK)
@RequestMapping(value = "{id}", method = RequestMethod.DELETE)
@ResponseBody/*from   w  ww .  j  a va  2s  . c o m*/
public int delete(@PathVariable("id") long id) throws NotFoundException {
    savedSearchService.deleteSavedSearch(id);
    return HttpStatus.SC_OK;
}

From source file:org.nekorp.workflow.backend.controller.imp.UploadControllerImp.java

/**{@inheritDoc}*/
@Override/*from  w w  w .  j  a v  a2s  .c om*/
@RequestMapping(value = "/imagenes/{rawBlobKey}", method = RequestMethod.DELETE)
public void deleteImage(@PathVariable final String rawBlobKey, final HttpServletResponse response) {
    try {
        BlobKey blobKey = new BlobKey(rawBlobKey);
        blobstoreService.delete(blobKey);
        response.setStatus(HttpStatus.ACCEPTED.value());
    } catch (Exception e) {
        response.setStatus(HttpStatus.NOT_FOUND.value());
    }
}

From source file:com.pablinchapin.anacleto.mongodb.controller.UserController.java

@RequestMapping(value = "/{userId}", method = RequestMethod.DELETE)
@ApiOperation(value = "Delete a user", notes = "Delete a user by userId")
public ResponseEntity<Void> deleteUser(@PathVariable String userId) {
    log.info("Delete user " + userId);
    usersService.deleteUser(userId);/*from   www .  j av  a2s  . co m*/

    return ResponseEntity.noContent().build();
}

From source file:cz.fi.muni.pa165.mushroomhunter.rest.LocationRest.java

@RequestMapping(value = "{locationId}", method = RequestMethod.DELETE)
public void deleteLocation(@PathVariable Long locationId) {
    LocationDto location = locationService.find(locationId);
    Long currentUserId = securityService.getCurrentlyLoggedUser().getId();
    if (!securityService.hasPermissionToModifyEntity(location.getOwnerId())) {
        throw new AccessDeniedException(
                "Access denied: User " + currentUserId + " cannot delete location " + location.getId());
    }/*from  ww  w .  ja v  a 2s . c  o m*/
    locationService.delete(location);
}