Interface ServerResource


  • public interface ServerResource
    Defines a resource suitable for serving by the ResourceHandler HTTP server handler.
    Since:
    3 Sep 2008
    Author:
    Mark Taylor
    • Method Detail

      • getContentType

        java.lang.String getContentType()
        Returns the MIME type of this resource.
        Returns:
        value of Content-Type HTTP header
      • getContentLength

        long getContentLength()
        Returns the number of bytes in this resource, if known.
        Returns:
        value of Content-Length HTTP header if known; otherwise a negative number
      • writeBody

        void writeBody​(java.io.OutputStream out)
                throws java.io.IOException
        Writes resource body.
        Parameters:
        out - destination stream
        Throws:
        java.io.IOException