play.mvc.results
Class RenderBinary

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by play.mvc.results.Result
                  extended by 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
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 response
RenderBinary(java.io.InputStream is, java.lang.String name, boolean inline)
          send a binary stream as the response
RenderBinary(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
 void apply(Http.Request request, Http.Response response)
           
 
Methods inherited from class play.mvc.results.Result
setContentTypeIfNotSet
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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 from
name - the name to use as Content-Diposition attachement 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 from
name - the name to use as Content-Diposition attachement filename
inline - 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 from
name - the name to use as Content-Diposition attachement filename
inline - 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-disposion is set to attachment.

Parameters:
file - readable file to send back
name - a name to use as Content-disposion's filename

RenderBinary

public RenderBinary(java.io.File file)
Send a file as the response. Content-disposion 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-disposion is set to attachment, name is taken from file's name

Parameters:
file - readable file to send back
Method Detail

apply

public void apply(Http.Request request,
                  Http.Response response)
Specified by:
apply in class Result


Guillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly