com.jscape.inet.nntp

## Class NntpArticleHeader

- java.lang.Object
- - com.jscape.inet.mime.MimeMessage
  - - com.jscape.inet.nntp.NntpArticleHeader

- All Implemented Interfaces:
    java.io.Serializable
  Direct Known Subclasses:
    NntpArticle

      public class NntpArticleHeader
      extends MimeMessage
      implements java.io.Serializable

  Provides methods for constucting, editing and reconstructing a set of NNTP article headers for a given NNTP article. The NntpArticleHeader class provides a headers only view of an article retreived from an NNTP server.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `NntpArticleHeader()` Creates a new NntpArticleHeader object.
    `NntpArticleHeader(byte[] contents)` Creates a new NntpArticleHeader object.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getDate()` Gets Date header.
    `java.lang.String` | `getFrom()` Gets From header from article headers.
    `int` | `getID()` Gets unique message id according to NNTP server.
    `java.lang.String` | `getNewsgroups()` Gets Newsgroups header from article headers.
    `java.lang.String` | `getSubject()` Gets Subject header from article headers.
    `void` | `setDate(java.lang.String date)` Sets Date header.
    `void` | `setFrom(java.lang.String from)` Sets From header.
    `void` | `setSubject(java.lang.String subject)` Sets Subject header.

    - ### Methods inherited from class com.jscape.inet.mime.MimeMessage

      `addHeader, addHeader, addPart, addReplaceHeader, addReplaceHeader, getBody, getBodyAsFile, getBodyData, getBoundary, getContentTransferEncoding, getContentType, getHeader, getHeaders, getHeaders, getHeaderValue, getMessage, getPart, getParts, getRawBodyData, removeHeader, removePart, removeParts, setBody, setBody, setBody, setBody, setBodyAsFile, setContentType`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### NntpArticleHeader

          public NntpArticleHeader()

      Creates a new NntpArticleHeader object.

    - #### NntpArticleHeader

          public NntpArticleHeader(byte[] contents)
                            throws MimeException

      Creates a new NntpArticleHeader object.
      Parameters:
        `contents` - the contents of the article header
      Throws:
        `MimeException` - if a MIME related parsing error occurs

  - ### Method Detail

    - #### getFrom

          public java.lang.String getFrom()

      Gets From header from article headers.
      Returns:
        from

    - #### getSubject

          public java.lang.String getSubject()

      Gets Subject header from article headers.
      Returns:
        subject

    - #### getNewsgroups

          public java.lang.String getNewsgroups()

      Gets Newsgroups header from article headers.
      Returns:
        newsgroups

    - #### getID

          public int getID()

      Gets unique message id according to NNTP server. Use this ID when getting the article from the NNTP server.
      Returns:
        id the unique message id for this message according to NNTP server
      See Also:
        `Nntp.getArticle(int)`

    - #### setSubject

          public void setSubject(java.lang.String subject)
                          throws MimeException

      Sets Subject header.
      Parameters:
        `subject` - the subject
      Throws:
        `MimeException` - if a MIME related error occurs

    - #### setFrom

          public void setFrom(java.lang.String from)
                       throws MimeException

      Sets From header.
      Parameters:
        `from` - the from address
      Throws:
        `MimeException` - if a MIME related error occurs

    - #### setDate

          public void setDate(java.lang.String date)
                       throws MimeException

      Sets Date header.
      Parameters:
        `date` - the date
      Throws:
        `MimeException` - if a MIME related error occurs

    - #### getDate

          public java.lang.String getDate()

      Gets Date header.
      Returns:
        the date

Copyright © JSCAPE LLC. 1999-2021. All Rights Reserved