Class DefaultFileChannelHttpResponse

  • All Implemented Interfaces:
    ChunkedHttpResponse, io.netty.buffer.ByteBufHolder, io.netty.handler.codec.DecoderResultProvider, io.netty.handler.codec.http.FullHttpMessage, io.netty.handler.codec.http.FullHttpResponse, io.netty.handler.codec.http.HttpContent, io.netty.handler.codec.http.HttpMessage, io.netty.handler.codec.http.HttpObject, io.netty.handler.codec.http.HttpResponse, io.netty.handler.codec.http.LastHttpContent, io.netty.util.ReferenceCounted

    public class DefaultFileChannelHttpResponse
    extends io.netty.handler.codec.http.DefaultHttpResponse
    implements ChunkedHttpResponse
    • Field Summary

      • Fields inherited from interface io.netty.handler.codec.http.LastHttpContent

        EMPTY_LAST_CONTENT
    • Constructor Summary

      Constructors 
      Constructor Description
      DefaultFileChannelHttpResponse​(io.netty.handler.codec.http.HttpVersion version, io.netty.handler.codec.http.HttpResponseStatus status, boolean validateHeaders, boolean singleFieldHeaders, io.netty.buffer.ByteBufAllocator alloc, java.nio.channels.FileChannel fileChannel)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      io.netty.buffer.ByteBuf content()  
      io.netty.handler.codec.http.FullHttpResponse copy()  
      io.netty.handler.codec.http.FullHttpResponse duplicate()  
      int refCnt()
      Returns the reference count of this object.
      boolean release()
      Decreases the reference count by 1 and deallocates this object if the reference count reaches at 0.
      boolean release​(int decrement)
      Decreases the reference count by the specified decrement and deallocates this object if the reference count reaches at 0.
      io.netty.handler.codec.http.FullHttpResponse replace​(io.netty.buffer.ByteBuf content)  
      io.netty.handler.codec.http.FullHttpResponse retain()  
      io.netty.handler.codec.http.FullHttpResponse retain​(int increment)  
      io.netty.handler.codec.http.FullHttpResponse retainedDuplicate()  
      io.netty.handler.codec.http.FullHttpResponse setProtocolVersion​(io.netty.handler.codec.http.HttpVersion version)  
      io.netty.handler.codec.http.FullHttpResponse setStatus​(io.netty.handler.codec.http.HttpResponseStatus status)  
      io.netty.handler.codec.http.FullHttpResponse touch()  
      io.netty.handler.codec.http.FullHttpResponse touch​(java.lang.Object hint)  
      io.netty.handler.codec.http.HttpHeaders trailingHeaders()  
      void writeChunkedContent​(io.netty.channel.ChannelHandlerContext ctx, io.netty.util.concurrent.Promise<io.netty.handler.codec.http.LastHttpContent> writePromise)  
      • Methods inherited from class io.netty.handler.codec.http.DefaultHttpResponse

        equals, getStatus, hashCode, status, toString
      • Methods inherited from class io.netty.handler.codec.http.DefaultHttpMessage

        getProtocolVersion, headers, protocolVersion
      • Methods inherited from class io.netty.handler.codec.http.DefaultHttpObject

        decoderResult, getDecoderResult, setDecoderResult
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface io.netty.handler.codec.DecoderResultProvider

        decoderResult, setDecoderResult
      • Methods inherited from interface io.netty.handler.codec.http.HttpMessage

        getProtocolVersion, headers, protocolVersion
      • Methods inherited from interface io.netty.handler.codec.http.HttpObject

        getDecoderResult
      • Methods inherited from interface io.netty.handler.codec.http.HttpResponse

        getStatus, status
    • Constructor Detail

      • DefaultFileChannelHttpResponse

        public DefaultFileChannelHttpResponse​(@Nonnull
                                              io.netty.handler.codec.http.HttpVersion version,
                                              @Nonnull
                                              io.netty.handler.codec.http.HttpResponseStatus status,
                                              boolean validateHeaders,
                                              boolean singleFieldHeaders,
                                              @Nonnull
                                              io.netty.buffer.ByteBufAllocator alloc,
                                              @Nonnull
                                              java.nio.channels.FileChannel fileChannel)
    • Method Detail

      • writeChunkedContent

        public void writeChunkedContent​(io.netty.channel.ChannelHandlerContext ctx,
                                        io.netty.util.concurrent.Promise<io.netty.handler.codec.http.LastHttpContent> writePromise)
                                 throws java.io.IOException
        Specified by:
        writeChunkedContent in interface ChunkedHttpResponse
        Throws:
        java.io.IOException
      • trailingHeaders

        public io.netty.handler.codec.http.HttpHeaders trailingHeaders()
        Specified by:
        trailingHeaders in interface io.netty.handler.codec.http.LastHttpContent
      • content

        public io.netty.buffer.ByteBuf content()
        Specified by:
        content in interface io.netty.buffer.ByteBufHolder
      • copy

        public io.netty.handler.codec.http.FullHttpResponse copy()
        Specified by:
        copy in interface io.netty.buffer.ByteBufHolder
        Specified by:
        copy in interface io.netty.handler.codec.http.FullHttpMessage
        Specified by:
        copy in interface io.netty.handler.codec.http.FullHttpResponse
        Specified by:
        copy in interface io.netty.handler.codec.http.HttpContent
        Specified by:
        copy in interface io.netty.handler.codec.http.LastHttpContent
      • duplicate

        public io.netty.handler.codec.http.FullHttpResponse duplicate()
        Specified by:
        duplicate in interface io.netty.buffer.ByteBufHolder
        Specified by:
        duplicate in interface io.netty.handler.codec.http.FullHttpMessage
        Specified by:
        duplicate in interface io.netty.handler.codec.http.FullHttpResponse
        Specified by:
        duplicate in interface io.netty.handler.codec.http.HttpContent
        Specified by:
        duplicate in interface io.netty.handler.codec.http.LastHttpContent
      • retainedDuplicate

        public io.netty.handler.codec.http.FullHttpResponse retainedDuplicate()
        Specified by:
        retainedDuplicate in interface io.netty.buffer.ByteBufHolder
        Specified by:
        retainedDuplicate in interface io.netty.handler.codec.http.FullHttpMessage
        Specified by:
        retainedDuplicate in interface io.netty.handler.codec.http.FullHttpResponse
        Specified by:
        retainedDuplicate in interface io.netty.handler.codec.http.HttpContent
        Specified by:
        retainedDuplicate in interface io.netty.handler.codec.http.LastHttpContent
      • replace

        public io.netty.handler.codec.http.FullHttpResponse replace​(io.netty.buffer.ByteBuf content)
        Specified by:
        replace in interface io.netty.buffer.ByteBufHolder
        Specified by:
        replace in interface io.netty.handler.codec.http.FullHttpMessage
        Specified by:
        replace in interface io.netty.handler.codec.http.FullHttpResponse
        Specified by:
        replace in interface io.netty.handler.codec.http.HttpContent
        Specified by:
        replace in interface io.netty.handler.codec.http.LastHttpContent
      • retain

        public io.netty.handler.codec.http.FullHttpResponse retain​(int increment)
        Specified by:
        retain in interface io.netty.buffer.ByteBufHolder
        Specified by:
        retain in interface io.netty.handler.codec.http.FullHttpMessage
        Specified by:
        retain in interface io.netty.handler.codec.http.FullHttpResponse
        Specified by:
        retain in interface io.netty.handler.codec.http.HttpContent
        Specified by:
        retain in interface io.netty.handler.codec.http.LastHttpContent
        Specified by:
        retain in interface io.netty.util.ReferenceCounted
      • refCnt

        public int refCnt()
        Returns the reference count of this object. If 0, it means this object has been deallocated.
        Specified by:
        refCnt in interface io.netty.util.ReferenceCounted
      • retain

        public io.netty.handler.codec.http.FullHttpResponse retain()
        Specified by:
        retain in interface io.netty.buffer.ByteBufHolder
        Specified by:
        retain in interface io.netty.handler.codec.http.FullHttpMessage
        Specified by:
        retain in interface io.netty.handler.codec.http.FullHttpResponse
        Specified by:
        retain in interface io.netty.handler.codec.http.HttpContent
        Specified by:
        retain in interface io.netty.handler.codec.http.LastHttpContent
        Specified by:
        retain in interface io.netty.util.ReferenceCounted
      • touch

        public io.netty.handler.codec.http.FullHttpResponse touch()
        Specified by:
        touch in interface io.netty.buffer.ByteBufHolder
        Specified by:
        touch in interface io.netty.handler.codec.http.FullHttpMessage
        Specified by:
        touch in interface io.netty.handler.codec.http.FullHttpResponse
        Specified by:
        touch in interface io.netty.handler.codec.http.HttpContent
        Specified by:
        touch in interface io.netty.handler.codec.http.LastHttpContent
        Specified by:
        touch in interface io.netty.util.ReferenceCounted
      • touch

        public io.netty.handler.codec.http.FullHttpResponse touch​(java.lang.Object hint)
        Specified by:
        touch in interface io.netty.buffer.ByteBufHolder
        Specified by:
        touch in interface io.netty.handler.codec.http.FullHttpMessage
        Specified by:
        touch in interface io.netty.handler.codec.http.FullHttpResponse
        Specified by:
        touch in interface io.netty.handler.codec.http.HttpContent
        Specified by:
        touch in interface io.netty.handler.codec.http.LastHttpContent
        Specified by:
        touch in interface io.netty.util.ReferenceCounted
      • release

        public boolean release()
        Decreases the reference count by 1 and deallocates this object if the reference count reaches at 0.
        Specified by:
        release in interface io.netty.util.ReferenceCounted
        Returns:
        true if and only if the reference count became 0 and this object has been deallocated
      • release

        public boolean release​(int decrement)
        Decreases the reference count by the specified decrement and deallocates this object if the reference count reaches at 0.
        Specified by:
        release in interface io.netty.util.ReferenceCounted
        Parameters:
        decrement -
        Returns:
        true if and only if the reference count became 0 and this object has been deallocated
      • setStatus

        public io.netty.handler.codec.http.FullHttpResponse setStatus​(io.netty.handler.codec.http.HttpResponseStatus status)
        Specified by:
        setStatus in interface io.netty.handler.codec.http.FullHttpResponse
        Specified by:
        setStatus in interface io.netty.handler.codec.http.HttpResponse
        Overrides:
        setStatus in class io.netty.handler.codec.http.DefaultHttpResponse
      • setProtocolVersion

        public io.netty.handler.codec.http.FullHttpResponse setProtocolVersion​(io.netty.handler.codec.http.HttpVersion version)
        Specified by:
        setProtocolVersion in interface io.netty.handler.codec.http.FullHttpResponse
        Specified by:
        setProtocolVersion in interface io.netty.handler.codec.http.HttpMessage
        Specified by:
        setProtocolVersion in interface io.netty.handler.codec.http.HttpResponse
        Overrides:
        setProtocolVersion in class io.netty.handler.codec.http.DefaultHttpResponse