Class SmtpMessage


  • public class SmtpMessage
    extends java.lang.Object
    Container for a complete SMTP message - headers and message body.
    • Constructor Summary

      Constructors 
      Constructor Description
      SmtpMessage()
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getBody()
      Get the message body.
      java.util.Iterator getHeaderNames()
      Get an Iterator over the header names.
      java.lang.String getHeaderValue​(java.lang.String name)
      Get the first values associated with a given header name.
      java.lang.String[] getHeaderValues​(java.lang.String name)
      Get the value(s) associated with the given header name.
      void store​(SmtpResponse response, java.lang.String params)
      Update the headers or body depending on the SmtpResponse object and line of input.
      java.lang.String toString()
      String representation of the SmtpMessage.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • SmtpMessage

        public SmtpMessage()
        Constructor. Initializes headers Map and body buffer.
    • Method Detail

      • store

        public void store​(SmtpResponse response,
                          java.lang.String params)
        Update the headers or body depending on the SmtpResponse object and line of input.
        Parameters:
        response - SmtpResponse object
        params - remainder of input line after SMTP command has been removed
      • getHeaderNames

        public java.util.Iterator getHeaderNames()
        Get an Iterator over the header names.
        Returns:
        an Iterator over the set of header names (String)
      • getHeaderValues

        public java.lang.String[] getHeaderValues​(java.lang.String name)
        Get the value(s) associated with the given header name.
        Parameters:
        name - header name
        Returns:
        value(s) associated with the header name
      • getHeaderValue

        public java.lang.String getHeaderValue​(java.lang.String name)
        Get the first values associated with a given header name.
        Parameters:
        name - header name
        Returns:
        first value associated with the header name
      • getBody

        public java.lang.String getBody()
        Get the message body.
        Returns:
        message body
      • toString

        public java.lang.String toString()
        String representation of the SmtpMessage.
        Overrides:
        toString in class java.lang.Object
        Returns:
        a String