Class 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 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
    • 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-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 from
        name - the name to use as Content-Disposition attachment 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-Disposition attachment filename
        contentType - The content type of the stream
        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-disposition is set to attachment.
        Parameters:
        file - readable file to send back
        name - 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 back
        name - a name to use as Content-disposition's filename
        inline - true to set the response Content-Disposition to inline
    • Method Detail

      • 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()