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 Summary

    Modifier and Type
    Method
    Description
    long
    Returns the number of bytes in this resource, if known.
    Returns the MIME type of this resource.
    void
    Writes resource body.
  • Method Details

    • getContentType

      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(OutputStream out) throws IOException
      Writes resource body.
      Parameters:
      out - destination stream
      Throws:
      IOException