Examples of sendStream()


Examples of org.jivesoftware.smackx.filetransfer.OutgoingFileTransfer.sendStream()

        try {
          URL url = new URL(attachmentUrl);
          // Send the file
          is = url.openStream();
          OutgoingFileTransfer.setResponseTimeout(10000);
          transfer.sendStream(is, url.getFile(), is.available(), message);
          logger.debug("Sent message '{}' with attachment '{}' to '{}'.", new String[] { message, attachmentUrl, to });
          success = true;
        } catch (IOException e) {
          logger.error("Could not open url '{}' for sending it via XMPP", attachmentUrl, e);
        } finally {
View Full Code Here

Examples of ratpack.http.Response.sendStream()

  public void render(Context context, ServerSentEvents object) throws Exception {
    Response response = context.getResponse();
    response.getHeaders().add(HttpHeaderConstants.CONTENT_TYPE, TEXT_EVENT_STREAM_CHARSET_UTF_8);
    response.getHeaders().add(HttpHeaderConstants.CACHE_CONTROL, HttpHeaderConstants.NO_CACHE_FULL);
    response.getHeaders().add(HttpHeaderConstants.PRAGMA, HttpHeaderConstants.NO_CACHE);
    response.sendStream(Streams.map(object.getPublisher(), encoder));
  }

  public static class Encoder implements Function<ServerSentEvent, ByteBuf> {
    private final ByteBufAllocator bufferAllocator;
View Full Code Here

Examples of ratpack.http.Response.sendStream()

  public void render(Context context, ResponseChunks chunks) throws Exception {
    Response response = context.getResponse();
    response.getHeaders().add(HttpHeaderConstants.TRANSFER_ENCODING, HttpHeaderConstants.CHUNKED);
    response.getHeaders().set(HttpHeaderConstants.CONTENT_TYPE, chunks.getContentType());
    Publisher<? extends ByteBuf> publisher = chunks.publisher(context.getLaunchConfig().getBufferAllocator());
    response.sendStream(publisher);
  }

}
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.