gnu.mail.providers.nntp
Class NNTPMessage

java.lang.Object
  extended by javax.mail.Message
      extended by javax.mail.internet.MimeMessage
          extended by gnu.mail.providers.nntp.NNTPMessage
All Implemented Interfaces:
MimePart, Part

public final class NNTPMessage
extends MimeMessage

A JavaMail MIME message delegate for an NNTP article.


Nested Class Summary
 
Nested classes/interfaces inherited from class javax.mail.internet.MimeMessage
MimeMessage.RecipientType
 
Field Summary
 
Fields inherited from class javax.mail.internet.MimeMessage
content, contentStream, dh, flags, headers, modified, saved
 
Fields inherited from class javax.mail.Message
expunged, folder, msgnum, session
 
Fields inherited from interface javax.mail.Part
ATTACHMENT, INLINE
 
Method Summary
 java.util.Enumeration getAllHeaderLines()
          Returns all the header-lines.
 java.util.Enumeration getAllHeaders()
          Returns all the headers.
 java.io.InputStream getContentStream()
          Returns the unencoded bytes of the content.
 java.lang.String[] getHeader(java.lang.String name)
          Returns all the values for the specified header name.
 java.lang.String getHeader(java.lang.String name, java.lang.String delimiter)
          Returns all the values for the specified header name as a single string, with headers separated by the given delimiter.
 int getLineCount()
          Returns the number of lines in the content of this message, or -1 if this number cannot be determined.
 java.util.Enumeration getMatchingHeaderLines(java.lang.String[] names)
          Returns all the header-lines with any of the given names.
 java.util.Enumeration getMatchingHeaders(java.lang.String[] names)
          Returns all the headers with any of the given names.
 java.lang.String getMessageId()
           
 java.util.Enumeration getNonMatchingHeaderLines(java.lang.String[] names)
          Returns all the header-lines without any of the given names.
 java.util.Enumeration getNonMatchingHeaders(java.lang.String[] names)
          Returns all the headers without any of the given names.
 int getSize()
          Returns the size of the content of this message in bytes, or -1 if the size cannot be determined.
 void saveChanges()
          Saves any changes to this message.
 void setFlags(Flags flag, boolean set)
          Sets the flags for this message.
 
Methods inherited from class javax.mail.internet.MimeMessage
addFrom, addHeader, addHeaderLine, addRecipients, addRecipients, createInternetHeaders, getAllRecipients, getContent, getContentID, getContentLanguage, getContentMD5, getContentType, getDataHandler, getDescription, getDisposition, getEncoding, getFileName, getFlags, getFrom, getInputStream, getMessageID, getRawInputStream, getReceivedDate, getRecipients, getReplyTo, getSender, getSentDate, getSubject, isMimeType, isSet, parse, removeHeader, reply, setContent, setContent, setContentID, setContentLanguage, setContentMD5, setDataHandler, setDescription, setDescription, setDisposition, setFileName, setFrom, setFrom, setHeader, setRecipients, setRecipients, setReplyTo, setSender, setSentDate, setSubject, setSubject, setText, setText, updateHeaders, writeTo, writeTo
 
Methods inherited from class javax.mail.Message
addRecipient, getFolder, getMessageNumber, isExpunged, match, setExpunged, setFlag, setMessageNumber, setRecipient
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getMessageId

public java.lang.String getMessageId()

getHeader

public java.lang.String[] getHeader(java.lang.String name)
                             throws MessagingException
Description copied from class: MimeMessage
Returns all the values for the specified header name. Note that headers may be encoded as per RFC 2047 if they contain non-US-ASCII characters: these should be decoded.

Specified by:
getHeader in interface Part
Overrides:
getHeader in class MimeMessage
Parameters:
name - the header name
Throws:
MessagingException

getHeader

public java.lang.String getHeader(java.lang.String name,
                                  java.lang.String delimiter)
                           throws MessagingException
Description copied from class: MimeMessage
Returns all the values for the specified header name as a single string, with headers separated by the given delimiter. If the delimiter is null, only the first header is returned.

Specified by:
getHeader in interface MimePart
Overrides:
getHeader in class MimeMessage
Parameters:
name - the header name
delimiter - the delimiter
Throws:
MessagingException

getAllHeaders

public java.util.Enumeration getAllHeaders()
                                    throws MessagingException
Description copied from class: MimeMessage
Returns all the headers.

Specified by:
getAllHeaders in interface Part
Overrides:
getAllHeaders in class MimeMessage
Returns:
an Enumeration of Header objects
Throws:
MessagingException

getMatchingHeaders

public java.util.Enumeration getMatchingHeaders(java.lang.String[] names)
                                         throws MessagingException
Description copied from class: MimeMessage
Returns all the headers with any of the given names.

Specified by:
getMatchingHeaders in interface Part
Overrides:
getMatchingHeaders in class MimeMessage
Parameters:
names - the header names to match
Returns:
an Enumeration of Header objects
Throws:
MessagingException

getNonMatchingHeaders

public java.util.Enumeration getNonMatchingHeaders(java.lang.String[] names)
                                            throws MessagingException
Description copied from class: MimeMessage
Returns all the headers without any of the given names.

Specified by:
getNonMatchingHeaders in interface Part
Overrides:
getNonMatchingHeaders in class MimeMessage
Parameters:
names - the header names to ignore
Returns:
an Enumeration of Header objects
Throws:
MessagingException

getAllHeaderLines

public java.util.Enumeration getAllHeaderLines()
                                        throws MessagingException
Description copied from class: MimeMessage
Returns all the header-lines.

Specified by:
getAllHeaderLines in interface MimePart
Overrides:
getAllHeaderLines in class MimeMessage
Returns:
an Enumeration of Strings
Throws:
MessagingException

getMatchingHeaderLines

public java.util.Enumeration getMatchingHeaderLines(java.lang.String[] names)
                                             throws MessagingException
Description copied from class: MimeMessage
Returns all the header-lines with any of the given names.

Specified by:
getMatchingHeaderLines in interface MimePart
Overrides:
getMatchingHeaderLines in class MimeMessage
Returns:
an Enumeration of Strings
Throws:
MessagingException

getNonMatchingHeaderLines

public java.util.Enumeration getNonMatchingHeaderLines(java.lang.String[] names)
                                                throws MessagingException
Description copied from class: MimeMessage
Returns all the header-lines without any of the given names.

Specified by:
getNonMatchingHeaderLines in interface MimePart
Overrides:
getNonMatchingHeaderLines in class MimeMessage
Returns:
an Enumeration of Strings
Throws:
MessagingException

getSize

public int getSize()
            throws MessagingException
Description copied from class: MimeMessage
Returns the size of the content of this message in bytes, or -1 if the size cannot be determined.

Note that this number may not be an exact measure, but if not -1, it will be suitable for display to the user.

Specified by:
getSize in interface Part
Overrides:
getSize in class MimeMessage
Throws:
MessagingException

getLineCount

public int getLineCount()
                 throws MessagingException
Description copied from class: MimeMessage
Returns the number of lines in the content of this message, or -1 if this number cannot be determined.

Note that this number may not be an exact measure, but if not -1, it will be suitable for display to the user.

Specified by:
getLineCount in interface Part
Overrides:
getLineCount in class MimeMessage
Throws:
MessagingException

getContentStream

public java.io.InputStream getContentStream()
                                     throws MessagingException
Description copied from class: MimeMessage
Returns the unencoded bytes of the content.

Overrides:
getContentStream in class MimeMessage
Throws:
MessagingException
See Also:
MimeBodyPart.getContentStream()

saveChanges

public void saveChanges()
                 throws MessagingException
Description copied from class: MimeMessage
Saves any changes to this message. Header fields in the message are updated appropriately to be consistent with the message contents.

Overrides:
saveChanges in class MimeMessage
Throws:
IllegalWriteException - if the underlying implementation does not support modification of existing values
MessagingException

setFlags

public void setFlags(Flags flag,
                     boolean set)
              throws MessagingException
Description copied from class: MimeMessage
Sets the flags for this message.

Overrides:
setFlags in class MimeMessage
Parameters:
flag - the flags to be set
set - the value to be set
Throws:
IllegalWriteException - if the underlying implementation does not support modification of existing values
MessagingException