/** * Build the <tt>HttpContent</tt> message. * * @return <tt>HttpContent</tt> */ public HttpContent build() { if (httpHeader == null) { throw new IllegalStateException("No HttpHeader specified to associate with this HttpContent."); } HttpContent httpContent = create(); httpContent.httpHeader = httpHeader; httpContent.setLast(last); if (content != null) { httpContent.setContent(content); } return httpContent; }
/** * Build the <tt>HttpContent</tt> message. * * @return <tt>HttpContent</tt> */ public HttpContent build() { if (httpHeader == null) { throw new IllegalStateException("No HttpHeader specified to associate with this HttpContent."); } HttpContent httpContent = create(); httpContent.httpHeader = httpHeader; httpContent.setLast(last); if (content != null) { httpContent.setContent(content); } return httpContent; }
/** * Build the <tt>HttpContent</tt> message. * * @return <tt>HttpContent</tt> */ public HttpContent build() { if (httpHeader == null) { throw new IllegalStateException("No HttpHeader specified to associate with this HttpContent."); } HttpContent httpContent = create(); httpContent.httpHeader = httpHeader; httpContent.setLast(last); if (content != null) { httpContent.setContent(content); } return httpContent; }
/** * Build the <tt>HttpContent</tt> message. * * @return <tt>HttpContent</tt> */ public HttpContent build() { if (httpHeader == null) { throw new IllegalStateException("No HttpHeader specified to associate with this HttpContent."); } HttpContent httpContent = create(); httpContent.httpHeader = httpHeader; httpContent.setLast(last); if (content != null) { httpContent.setContent(content); } return httpContent; }
/** * Build the <tt>HttpContent</tt> message. * * @return <tt>HttpContent</tt> */ public HttpContent build() { if (httpHeader == null) { throw new IllegalStateException("No HttpHeader specified to associate with this HttpContent."); } HttpContent httpContent = create(); httpContent.httpHeader = httpHeader; httpContent.setLast(last); if (content != null) { httpContent.setContent(content); } return httpContent; }
/** * Build the <tt>HttpContent</tt> message. * * @return <tt>HttpContent</tt> */ public HttpContent build() { if (httpHeader == null) { throw new IllegalStateException("No HttpHeader specified to associate with this HttpContent."); } HttpContent httpContent = create(); httpContent.httpHeader = httpHeader; httpContent.setLast(last); if (content != null) { httpContent.setContent(content); } return httpContent; }
/** * Build the <tt>HttpContent</tt> message. * * @return <tt>HttpContent</tt> */ public HttpContent build() { if (httpHeader == null) { throw new IllegalStateException("No HttpHeader specified to associate with this HttpContent."); } HttpContent httpContent = create(); httpContent.httpHeader = httpHeader; httpContent.setLast(last); if (content != null) { httpContent.setContent(content); } return httpContent; }
/** * Build the <tt>HttpContent</tt> message. * * @return <tt>HttpContent</tt> */ public HttpContent build() { if (httpHeader == null) { throw new IllegalStateException("No HttpHeader specified to associate with this HttpContent."); } HttpContent httpContent = create(); httpContent.httpHeader = httpHeader; httpContent.setLast(last); if (content != null) { httpContent.setContent(content); } return httpContent; }
/** * Build the <tt>HttpContent</tt> message. * * @return <tt>HttpContent</tt> */ public HttpContent build() { if (httpHeader == null) { throw new IllegalStateException("No HttpHeader specified to associate with this HttpContent."); } HttpContent httpContent = create(); httpContent.httpHeader = httpHeader; httpContent.setLast(last); if (content != null) { httpContent.setContent(content); } return httpContent; }
/** * Build the <tt>HttpContent</tt> message. * * @return <tt>HttpContent</tt> */ public HttpContent build() { if (httpHeader == null) { throw new IllegalStateException("No HttpHeader specified to associate with this HttpContent."); } HttpContent httpContent = create(); httpContent.httpHeader = httpHeader; httpContent.setLast(last); if (content != null) { httpContent.setContent(content); } return httpContent; }
requestPacket.setContentLengthLong(data.length); content.setLast(true); ctx.write(content, ((!requestPacket.isCommitted()) ? ctx.getTransportContext().getCompletionHandler() : null));
final HttpContent content = requestPacket.httpContentBuilder().content(buffer).build(); buffer.allowBufferDispose(false); content.setLast(true); ctx.write(content, ((!requestPacket.isCommitted()) ? ctx.getTransportContext().getCompletionHandler() : null));
@SuppressWarnings({"unchecked"}) public boolean doHandle(final FilterChainContext ctx, final Request request, final HttpRequestPacket requestPacket) throws IOException { String charset = request.getBodyEncoding(); if (charset == null) { charset = Charsets.ASCII_CHARSET.name(); } final byte[] data = request.getStringData().getBytes(charset); final MemoryManager mm = ctx.getMemoryManager(); final Buffer gBuffer = Buffers.wrap(mm, data); if (requestPacket.getContentLength() == -1) { if (!clientConfig.isCompressionEnabled()) { requestPacket.setContentLengthLong(data.length); } } final HttpContent content = requestPacket.httpContentBuilder().content(gBuffer).build(); content.setLast(true); ctx.write(content, ((!requestPacket.isCommitted()) ? ctx.getTransportContext().getCompletionHandler() : null)); return true; }
@SuppressWarnings({"unchecked"}) public boolean doHandle(final FilterChainContext ctx, final Request request, final HttpRequestPacket requestPacket) throws IOException { final MemoryManager mm = ctx.getMemoryManager(); final byte[] data = request.getByteData(); final Buffer gBuffer = Buffers.wrap(mm, data); if (requestPacket.getContentLength() == -1) { if (!clientConfig.isCompressionEnabled()) { requestPacket.setContentLengthLong(data.length); } } final HttpContent content = requestPacket.httpContentBuilder().content(gBuffer).build(); content.setLast(true); ctx.write(content, ((!requestPacket.isCommitted()) ? ctx.getTransportContext().getCompletionHandler() : null)); return true; }