com.jscape.inet.nntp

## Class NntpArticle

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

- All Implemented Interfaces:
    java.io.Serializable

      public class NntpArticle
      extends NntpArticleHeader

  Represents article header and body. This class extends MimeMessage and can be constructed using the default constructor or from existing Mime contents.
  See Also:
    `MimeMessage`, Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `NntpArticle()` Constructs a new `NntpArticle`.
    `NntpArticle(byte[] contents)` Constructs a new `NntpArticle` from existing MIME content.
    `NntpArticle(java.lang.String from, java.lang.String newsgroups, java.lang.String subject)` Constructs a new `NntpArticle`.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `setFrom(java.lang.String from)` Sets From header for this `NntpArticle`.
    `void` | `setNewsgroups(java.lang.String newsgroups)` Sets Newsgroups header for this `NntpArticle`.
    `void` | `setSubject(java.lang.String subject)` Sets Subject header for this `NntpArticle`.

    - ### Methods inherited from class com.jscape.inet.nntp.NntpArticleHeader

      `getDate, getFrom, getID, getNewsgroups, getSubject, setDate`

    - ### 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

    - #### NntpArticle

          public NntpArticle()

      Constructs a new `NntpArticle`.

    - #### NntpArticle

          public NntpArticle(java.lang.String from,
                             java.lang.String newsgroups,
                             java.lang.String subject)
                      throws MimeException

      Constructs a new `NntpArticle`. Article is constructed with provided From, Newsgroups and Subject headers.
      Parameters:
        `from` - the email address of the person responsible for this article
        `newsgroups` - a comma delimited list of newsgroups
        `subject` - the subject of the article
      Throws:
        `MimeException` - if a MIME related error occurs
      See Also:
        `MimeException`

    - #### NntpArticle

          public NntpArticle(byte[] contents)
                      throws MimeException

      Constructs a new `NntpArticle` from existing MIME content.
      Parameters:
        `contents` - the contents of mime message
      Throws:
        `MimeException` - if a MIME related error occurs
      See Also:
        `MimeException`

  - ### Method Detail

    - #### setFrom

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

      Sets From header for this `NntpArticle`.
      Overrides:
        `setFrom` in class `NntpArticleHeader`
      Parameters:
        `from` - the email address of the person responsible for this article
      Throws:
        `MimeException` - if a MIME related error occurs
      See Also:
        `MimeException`

    - #### setNewsgroups

          public void setNewsgroups(java.lang.String newsgroups)
                             throws MimeException

      Sets Newsgroups header for this `NntpArticle`.
      Parameters:
        `newsgroups` - a comma delimited list of newsgroups
      Throws:
        `MimeException` - if a MIME related error occurs
      See Also:
        `MimeException`

    - #### setSubject

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

      Sets Subject header for this `NntpArticle`.
      Overrides:
        `setSubject` in class `NntpArticleHeader`
      Parameters:
        `subject` - the subject of the article
      Throws:
        `MimeException` - if a MIME related error occurs
      See Also:
        `MimeException`

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