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:net.seedboxer.web.controller.rs.ContentsAPI.java

@RequestMapping(value = "delete", method = RequestMethod.DELETE)
public @ResponseBody APIResponse deleteContents(@RequestBody ContentInfo contentInfo) {
    try {//w w  w.j a  va  2s.c o m
        contentsService.deleteUserContent(getUser(), contentInfo);
        return APIResponse.createSuccessfulResponse();
    } catch (Exception e) {
        LOGGER.error("Can not delete user content", e);
        return APIResponse.createErrorResponse("Can not delete user content");
    }
}

From source file:net.seedboxer.web.controller.rs.admin.UsersAPI.java

@RequestMapping(value = "delete", method = RequestMethod.DELETE)
public @ResponseBody APIResponse deleteUser(@RequestBody UserInfo user) {
    try {/*w ww  .j  a va 2  s.c o  m*/
        adminService.deleteUser(user);
        return APIResponse.createSuccessfulResponse();
    } catch (Exception e) {
        LOGGER.error("Can not delete user", e);
        return APIResponse.createErrorResponse("Can not delete user");
    }
}

From source file:com.linksinnovation.elearning.controller.api.QuizController.java

@PreAuthorize("hasAuthority('Administrator') or hasAuthority('Instructor')")
@RequestMapping(value = "/{courseId}", method = RequestMethod.DELETE)
public Course delete(@PathVariable("courseId") Long courseId, @RequestBody Quiz quiz) {
    Course course = courseRepositroy.findOne(courseId);
    course.getQuizzes().remove(quiz);//from w  w  w .j  av a 2 s  .  c om
    return courseRepositroy.save(course);
}

From source file:org.callistasoftware.netcare.api.rest.ActivityTypeApi.java

@RequestMapping(value = "/{id}", method = RequestMethod.DELETE, produces = "application/json")
@ResponseBody//  ww  w .  ja  v  a  2 s. co m
public ServiceResult<ActivityType> deleteTemplate(@PathVariable(value = "id") final Long id) {
    this.logAccessWithoutPdl("delete", "activity_template");
    return this.service.deleteActivityTemplate(id);
}

From source file:com.nebhale.springone2014.web.GamesController.java

@RequestMapping(method = RequestMethod.DELETE, value = "/{gameId}")
@ResponseStatus(HttpStatus.OK)/*from   w w w .j ava2  s.  c  o m*/
void destroyGame(@PathVariable Long gameId) throws GameDoesNotExistException {
    this.gameRepository.remove(gameId);
}

From source file:com.torchmind.stockpile.server.controller.v1.NameController.java

/**
 * <code>DELETE /v1/name</code>
 *
 * Purges a name from the cache.//from   w w  w .j  av  a 2s. co  m
 *
 * @param name a display name.
 */
@ResponseStatus(HttpStatus.NO_CONTENT)
@RequestMapping(method = RequestMethod.DELETE)
public void purgeBody(@Nonnull @RequestBody String name) {
    this.purge(name);
}

From source file:be.ucll.udas.rest.controller.CodeSnippetRESTController.java

@RequestMapping(method = RequestMethod.DELETE, path = "/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
public CodeSnippet deleteCodeSnippet(@PathVariable("id") long id) throws HTTPWrapperException {
    try {//w  w w .j ava 2 s . c  om
        CodeSnippet codesnippet = udas.getCodeSnippet(id);
        udas.deleteCodeSnippet(codesnippet);
        return codesnippet;
    } catch (DomainException ex) {
        Logger.getLogger(ProjectRESTController.class.getName()).log(Level.SEVERE, null, ex);
        throw new HTTPWrapperException(ex);
    }
}

From source file:gt.dakaik.rest.interfaces.WSMenu.java

@Transactional()
@RequestMapping(value = "/delete/{id}", method = RequestMethod.DELETE)
public ResponseEntity<Menu> onDelete(@RequestParam(value = "idUser", defaultValue = "0") int idUsuario,
        @RequestParam(value = "token", defaultValue = "") String token, @PathVariable("id") Long idProfile)
        throws EntidadNoEncontradaException;

From source file:hr.softwarecity.osijek.controllers.LaravaeController.java

@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
public ResponseEntity deleteLaravaeArea(@PathVariable long id) {
    Logger.getLogger("LaravaeController.java").log(Level.INFO, "Recognized request to /" + id + " path");
    Larvae found = laravaeRepository.findByLarvae(id);
    Logger.getLogger("LaravaeController.java").log(Level.INFO, "Retrieved laravae " + found.toString());
    laravaeRepository.delete(found);/*from w ww. java2 s  .  co  m*/
    Logger.getLogger("LaravaeController.java").log(Level.INFO,
            "Successfully delete laravae " + found.toString());
    return new ResponseEntity(HttpStatus.OK);
}

From source file:org.easit.core.controllers.facebook.FacebookProfileController.java

@RequestMapping(value = "/disconnect/facebook", method = RequestMethod.DELETE)
public RedirectView removeConnection(NativeWebRequest request) {
    RedirectView redirect = connectController.removeConnection("facebook",
            connectionRepository.findPrimaryConnection(Facebook.class).getKey().getProviderUserId(), request);

    request.setAttribute("connectedToFacebook", connectionRepository.findConnections("facebook").size() > 0,
            WebRequest.SCOPE_SESSION);/*from   w w  w. j a va  2  s . com*/
    request.setAttribute("connectedToAny", connectionRepository.findAllConnections().size() > 0,
            WebRequest.SCOPE_SESSION);
    return redirect;
}