Package play.mvc.results
Class RenderBinary
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- play.utils.FastRuntimeException
-
- play.mvc.results.Result
-
- play.mvc.results.RenderBinary
-
- All Implemented Interfaces:
java.io.Serializable
public class RenderBinary extends Result
200 OK with application/octet-stream- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description RenderBinary(java.io.File file)
Send a file as the response.RenderBinary(java.io.File file, java.lang.String name)
Send a file as the response.RenderBinary(java.io.File file, java.lang.String name, boolean inline)
Send a file as the response.RenderBinary(java.io.InputStream is, java.lang.String name)
Send a binary stream as the responseRenderBinary(java.io.InputStream is, java.lang.String name, boolean inline)
Send a binary stream as the responseRenderBinary(java.io.InputStream is, java.lang.String name, long length)
RenderBinary(java.io.InputStream is, java.lang.String name, long length, boolean inline)
RenderBinary(java.io.InputStream is, java.lang.String name, long length, java.lang.String contentType, boolean inline)
RenderBinary(java.io.InputStream is, java.lang.String name, java.lang.String contentType, boolean inline)
Send a binary stream as the response
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
apply(Http.Request request, Http.Response response)
java.lang.String
getContentType()
java.io.File
getFile()
long
getLength()
java.lang.String
getName()
boolean
isInline()
-
Methods inherited from class play.mvc.results.Result
getEncoding, setContentTypeIfNotSet
-
Methods inherited from class play.utils.FastRuntimeException
fillInStackTrace
-
-
-
-
Constructor Detail
-
RenderBinary
public RenderBinary(java.io.InputStream is, java.lang.String name)
Send a binary stream as the response- Parameters:
is
- the stream to read fromname
- the name to use as Content-Disposition attachment filename
-
RenderBinary
public RenderBinary(java.io.InputStream is, java.lang.String name, long length)
-
RenderBinary
public RenderBinary(java.io.InputStream is, java.lang.String name, boolean inline)
Send a binary stream as the response- Parameters:
is
- the stream to read fromname
- the name to use as Content-Disposition attachment filenameinline
- true to set the response Content-Disposition to inline
-
RenderBinary
public RenderBinary(java.io.InputStream is, java.lang.String name, java.lang.String contentType, boolean inline)
Send a binary stream as the response- Parameters:
is
- the stream to read fromname
- the name to use as Content-Disposition attachment filenamecontentType
- The content type of the streaminline
- true to set the response Content-Disposition to inline
-
RenderBinary
public RenderBinary(java.io.InputStream is, java.lang.String name, long length, java.lang.String contentType, boolean inline)
-
RenderBinary
public RenderBinary(java.io.InputStream is, java.lang.String name, long length, boolean inline)
-
RenderBinary
public RenderBinary(java.io.File file, java.lang.String name)
Send a file as the response. Content-disposition is set to attachment.- Parameters:
file
- readable file to send backname
- a name to use as Content-disposition's filename
-
RenderBinary
public RenderBinary(java.io.File file)
Send a file as the response. Content-disposition is set to attachment, name is taken from file's name- Parameters:
file
- readable file to send back
-
RenderBinary
public RenderBinary(java.io.File file, java.lang.String name, boolean inline)
Send a file as the response. Content-disposition is set to attachment, name is taken from file's name- Parameters:
file
- readable file to send backname
- a name to use as Content-disposition's filenameinline
- true to set the response Content-Disposition to inline
-
-
Method Detail
-
apply
public void apply(Http.Request request, Http.Response response)
-
isInline
public boolean isInline()
-
getLength
public long getLength()
-
getFile
public java.io.File getFile()
-
getName
public java.lang.String getName()
-
getContentType
public java.lang.String getContentType()
-
-