Example usage for org.apache.http.impl EnglishReasonPhraseCatalog INSTANCE

List of usage examples for org.apache.http.impl EnglishReasonPhraseCatalog INSTANCE

Introduction

In this page you can find the example usage for org.apache.http.impl EnglishReasonPhraseCatalog INSTANCE.

Prototype

EnglishReasonPhraseCatalog INSTANCE

To view the source code for org.apache.http.impl EnglishReasonPhraseCatalog INSTANCE.

Click Source Link

Usage

From source file:org.raml.jaxrs.codegen.core.Names.java

public static String buildResponseMethodName(final int statusCode, final MimeType mimeType) {
    final String status = EnglishReasonPhraseCatalog.INSTANCE.getReason(statusCode, DEFAULT_LOCALE);
    return uncapitalize(
            getShortMimeType(mimeType) + buildJavaFriendlyName(defaultIfBlank(status, "_" + statusCode)));
}

From source file:ste.web.http.HttpUtils.java

public static BasicHttpResponse getBasicResponse(final boolean withEntity) {
    BasicHttpResponse response = new BasicHttpResponse(HttpVersion.HTTP_1_1, HttpStatus.SC_OK,
            EnglishReasonPhraseCatalog.INSTANCE.getReason(HttpStatus.SC_OK, Locale.ENGLISH));

    if (withEntity) {
        response.setEntity(new BasicHttpEntity());
    }// w w  w .  j  a v a 2  s. c om

    return response;
}