public class RenderBinary extends Result
Result.Payload| Constructor and Description |
|---|
RenderBinary(byte[] bytes)
Construct an inline binary response with a byte array
|
RenderBinary(byte[] bytes,
String attachmentName)
Construct a binary response with a byte array.
|
RenderBinary(File file)
Send a file as the response.
|
RenderBinary(File file,
String name)
Send a file as the response.
|
RenderBinary(File file,
String name,
boolean inline)
Send a file as the response.
|
RenderBinary(InputStream is,
String name)
send a binary stream as the response
|
RenderBinary(InputStream is,
String name,
boolean inline)
send a binary stream as the response
|
RenderBinary(InputStream is,
String name,
long length) |
RenderBinary(InputStream is,
String name,
long length,
boolean inline) |
RenderBinary(InputStream is,
String name,
long length,
String contentType,
boolean inline) |
RenderBinary(InputStream is,
String name,
String contentType,
boolean inline)
send a binary stream as the response
|
RenderBinary(org.osgl.Lang.Visitor<org.osgl.util.Output> contentWriter) |
| Modifier and Type | Method and Description |
|---|---|
void |
apply(org.osgl.http.H.Request req,
org.osgl.http.H.Response resp) |
RenderBinary |
contentType(org.osgl.http.H.Format contentType) |
RenderBinary |
contentType(String contentType) |
RenderBinary |
name(String attachmentName)
Set the attachment name.
|
addCookie, addHeader, applyAfterCommitHandler, applyBeforeCommitHandler, applyCookies, applyHeaders, applyMessage, applyStatus, clearThreadLocals, header, payload, status, status, statusCode, timestamp, touchPayloaddoFillInStackTrace, fillInStackTraceaddSuppressed, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringpublic RenderBinary(byte[] bytes)
Construct an inline binary response with a byte array
bytes - the byte arraypublic RenderBinary(byte[] bytes,
String attachmentName)
Construct a binary response with a byte array.
bytes - the byte arrayattachmentName - the attachment name. If not null the disposition will be attachment; otherwise inlinepublic RenderBinary(InputStream is, String name)
send a binary stream as the response
is - the stream to read fromname - the name to use as Content-Diposition attachement filenamepublic RenderBinary(InputStream is, String name, long length)
public RenderBinary(InputStream is, String name, boolean inline)
send a binary stream as the response
is - the stream to read fromname - the name to use as Content-Diposition attachement filenameinline - true to set the response Content-Disposition to inlinepublic RenderBinary(InputStream is, String name, String contentType, boolean inline)
send a binary stream as the response
is - the stream to read fromname - the name to use as Content-Diposition attachement filenamecontentType - the content type of the binary streaminline - true to set the response Content-Disposition to inlinepublic RenderBinary(InputStream is, String name, long length, String contentType, boolean inline)
public RenderBinary(InputStream is, String name, long length, boolean inline)
public RenderBinary(File file, String name)
Send a file as the response. Content-disposion is set to attachment.
file - readable file to send backname - a name to use as Content-disposion’s filenamepublic RenderBinary(File file)
Send a file as the response. Content-disposion is set to attachment, name is taken from file’s name
file - readable file to send backpublic RenderBinary(File file, String name, boolean inline)
Send a file as the response. Content-disposition is set to attachment, name is taken from file’s name
file - readable file to send backpublic RenderBinary(org.osgl.Lang.Visitor<org.osgl.util.Output> contentWriter)
public RenderBinary contentType(org.osgl.http.H.Format contentType)
public RenderBinary contentType(String contentType)
public RenderBinary name(String attachmentName)
Set the attachment name.
If the attachment name is not null and not empty, then it will set the disposition to attachment; otherwise it will set the disposition to inline
attachmentName - the attachment nameCopyright © 2014–2018 OSGL (Open Source General Library). All rights reserved.