Package org.elasticsearch.common.xcontent

Examples of org.elasticsearch.common.xcontent.XContentBuilder.contentType()


            this.content = BytesArray.EMPTY;
            this.contentType = BytesRestResponse.TEXT_CONTENT_TYPE;
        } else {
            XContentBuilder builder = convert(channel, t);
            this.content = builder.bytes();
            this.contentType = builder.contentType().restContentType();
        }
    }

    private static XContentBuilder convert(RestChannel channel, Throwable t) throws IOException {
        XContentBuilder builder = channel.newBuilder().startObject()
View Full Code Here


            this.content = BytesArray.EMPTY;
            this.contentType = TEXT_CONTENT_TYPE;
        } else {
            XContentBuilder builder = convert(channel, status, t);
            this.content = builder.bytes();
            this.contentType = builder.contentType().restContentType();
        }
        if (t instanceof HasRestHeaders) {
            addHeaders(((HasRestHeaders) t).getHeaders());
        }
        this.contentThreadSafe = true;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.