Class GeminiResponse

java.lang.Object
org.netpreserve.jwarc.Message
org.netpreserve.jwarc.GeminiResponse

public class GeminiResponse extends Message
  • Constructor Details

    • GeminiResponse

      public GeminiResponse(int status, String meta, MessageBody body)
  • Method Details

    • parse

      public static GeminiResponse parse(ReadableByteChannel channel, ByteBuffer buffer) throws IOException
      Throws:
      IOException
    • status

      public int status()
    • statusHttpEquivalent

      public int statusHttpEquivalent()
      Returns the HTTP equivalent of the status code. (e.g. 20 -> 200, 51 -> 404)
    • meta

      public String meta()
    • serializeHeader

      public byte[] serializeHeader()
      Description copied from class: Message
      Serializes the message header.
      Overrides:
      serializeHeader in class Message
    • contentType

      public MediaType contentType()
      Description copied from class: Message
      The media type of the body.

      Returns "application/octet-stream" if the Content-Type header is missing.

      Overrides:
      contentType in class Message