Example usage for org.springframework.http HttpStatus valueOf

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

Introduction

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

Prototype

public static HttpStatus valueOf(int statusCode) 

Source Link

Document

Return the enum constant of this type with the specified numeric value.

Usage

From source file:io.curly.commons.config.feign.SpringErrorDecoder.java

private HttpStatus parseResponse(Response response) {
    return HttpStatus.valueOf(response.status());
}

From source file:org.craftercms.engine.exception.HttpStatusCodeException.java

public HttpStatusCodeException(int statusCode, String message, Throwable cause) {
    this(HttpStatus.valueOf(statusCode), message, cause);
}

From source file:com.sdl.odata.client.caller.MockController.java

@RequestMapping(value = "{code:\\d{3}}")
ResponseEntity<?> respondWithCode(@PathVariable int code) throws IOException {
    return ResponseEntity.status(HttpStatus.valueOf(code)).body(String.valueOf(code));
}

From source file:org.cloudifysource.restDoclet.docElements.DocResponseStatus.java

public String getCodeName() {
    return HttpStatus.valueOf(code).name();
}

From source file:grails.plugin.cloudfoundry.GrailsHttpResponse.java

public HttpStatus getStatusCode() throws IOException {
    return HttpStatus.valueOf(getRawStatusCode());
}

From source file:org.craftercms.engine.exception.HttpStatusCodeException.java

public HttpStatusCodeException(int statusCode, String message) {
    this(HttpStatus.valueOf(statusCode), message);
}

From source file:io.github.restdocsext.jersey.JerseyResponseConverter.java

@Override
public OperationResponse convert(ClientResponse response) {
    return new OperationResponseFactory().create(HttpStatus.valueOf(response.getStatus()),
            extractHeaders(response.getHeaders()), extractContent(response));
}

From source file:org.craftercms.engine.exception.HttpStatusCodeException.java

public HttpStatusCodeException(int statusCode, Throwable cause) {
    this(HttpStatus.valueOf(statusCode), cause);
}

From source file:com.intel.databackend.exceptions.DataInquiryException.java

public HttpStatus getHttpErrorStatus() {
    return HttpStatus.valueOf(getErrorCode());
}

From source file:com.enginizer.controller.MailingResource.java

@RequestMapping(value = "/sendEmail", method = RequestMethod.POST)
@CrossOrigin(origins = { "http://localhost:80", "http://uc8.co:80", "http://uc8.co", "http://localhost" })
public ResponseEntity<String> sendEMAIL(@ModelAttribute("email") Email email) {
    try {/* w  ww. j av  a 2  s. c  o  m*/
        mailSender.sendEmail(email);
        return new ResponseEntity<>(HttpStatus.OK);
    } catch (MailException e) {
        return new ResponseEntity<>(e.getMessage(), HttpStatus.valueOf(e.getStatus()));
    }
}