Example usage for org.springframework.http HttpStatus LOCKED

List of usage examples for org.springframework.http HttpStatus LOCKED

Introduction

In this page you can find the example usage for org.springframework.http HttpStatus LOCKED.

Prototype

HttpStatus LOCKED

To view the source code for org.springframework.http HttpStatus LOCKED.

Click Source Link

Document

423 Locked .

Usage

From source file:org.bonitasoft.web.designer.studio.workspace.StudioWorkspaceResourceHandler.java

@Override
public void preOpen(final Path filePath) throws LockedResourceException, ResourceNotFoundException {
    try {/*from w  ww  .  j ava2 s.co m*/
        doPost(filePath, WorkspaceResourceEvent.PRE_OPEN);
    } catch (Exception e) {
        if (e instanceof HttpClientErrorException) {
            if (HttpStatus.LOCKED.equals(((HttpClientErrorException) e).getStatusCode())) {
                throw new LockedResourceException(filePath.toString(), e);
            }
        }
        handleResourceException(filePath, e);
    }
}

From source file:ca.hec.tenjin.tool.controller.ImportController.java

@ExceptionHandler(SyllabusLockedException.class)
@ResponseStatus(value = HttpStatus.LOCKED)
public @ResponseBody Object handleSyllabusLockedException(DeniedAccessException ex) {
    return null;//from w  w  w .jav a 2  s  .com
}

From source file:org.bonitasoft.web.designer.studio.workspace.StudioWorkspaceResourceHandlerTest.java

@Test(expected = LockedResourceException.class)
public void should_preOpen_throw_a_LockedResourceException_if_status_is_locked() throws Exception {
    server.request(by(uri("/workspace/PRE_OPEN"))).response(status(HttpStatus.LOCKED.value()));

    studioWorkspaceResourceHandler.preOpen(filePath);
}

From source file:net.navasoft.madcoin.backend.services.controller.SessionController.java

@ExceptionHandler(InexistentUserException.class)
@ResponseStatus(value = HttpStatus.LOCKED)
private @ResponseBody FailedResponseVO handleInexistentUser(SessionControllerException e) {
    FailedResponseVO value = new AuthenticationFailedResponseVO();
    value.setErrorMessage(e.getMessage());
    value.setCauses(e.getCauses());/*ww  w.j a va2s  .c  o  m*/
    value.setTip(e.formulateTips());
    return value;
}