Interface IReplyContent

All Known Implementing Classes:
JSONReply, TextReply, XMLReply

public interface IReplyContent
Interface for processing of the reply content.
Author:
Christopher Mindus
  • Method Details Link icon

    • getAcceptedContent Link icon

      String getAcceptedContent()
      Gets the accepted contents.
      Returns:
      A String such as "text/html" or "text/plain, text/html".
    • isHandled Link icon

      boolean isHandled(String type)
      Checks if a content type is handled by this reply.
      Parameters:
      type - The content type from the HTTP header "Content-Type", without "charset".
      Returns:
      true if handled, false otherwise.
    • readReply Link icon

      void readReply(RESTfulReply reply, String data) throws IOException
      Called to format the request for this reply content, i.e. the accepted content.
      Parameters:
      reply - The reply instance.
      data - The String data from the reply.
      Throws:
      IOException - For I/O errors.
    • canFormat Link icon

      boolean canFormat()
      Checks if formatting the output is supported.
      Returns:
      true If formatting is supported.
    • getDescription Link icon

      String getDescription()
      Gets the format description.
      Returns:
      The description string.
    • formatHTTPReply Link icon

      String formatHTTPReply()
      Formats the URLConnection HTTP headers reply into a String.
      Returns:
      The formatted HTML reply string.
    • getRawOutput Link icon

      String getRawOutput(boolean format)
      Gets the raw text data from the reply.
      Parameters:
      format - Flag to format the output (used for JSON and XML).
      Returns:
      The String of the reply, or null if an exception occurred.