gnu.mail.providers.nntp

Class NNTPMessage

Implemented Interfaces:
MimePart, Part

public final class NNTPMessage
extends MimeMessage

A JavaMail MIME message delegate for an NNTP article.
Version:
2.0
Author:
Chris Burdess

Nested Class Summary

Nested classes/interfaces inherited from class javax.mail.internet.MimeMessage

MimeMessage.RecipientType

Nested classes/interfaces inherited from class javax.mail.Message

Message.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

Enumeration
getAllHeaderLines()
Returns all the header-lines.
Enumeration
getAllHeaders()
Returns all the headers.
InputStream
getContentStream()
Returns the unencoded bytes of the content.
String[]
getHeader(String name)
Returns all the values for the specified header name.
String
getHeader(String name, 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.
Enumeration
getMatchingHeaderLines(String[] names)
Returns all the header-lines with any of the given names.
Enumeration
getMatchingHeaders(String[] names)
Returns all the headers with any of the given names.
String
getMessageId()
Enumeration
getNonMatchingHeaderLines(String[] names)
Returns all the header-lines without any of the given names.
Enumeration
getNonMatchingHeaders(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, getAllHeaderLines, getAllHeaders, getAllRecipients, getContent, getContentID, getContentLanguage, getContentMD5, getContentStream, getContentType, getDataHandler, getDescription, getDisposition, getEncoding, getFileName, getFlags, getFrom, getHeader, getHeader, getInputStream, getLineCount, getMatchingHeaderLines, getMatchingHeaders, getMessageID, getNonMatchingHeaderLines, getNonMatchingHeaders, getRawInputStream, getReceivedDate, getRecipients, getReplyTo, getSender, getSentDate, getSize, getSubject, isMimeType, isSet, parse, removeHeader, reply, saveChanges, setContent, setContent, setContentID, setContentLanguage, setContentMD5, setDataHandler, setDescription, setDescription, setDisposition, setFileName, setFlags, setFrom, setFrom, setHeader, setRecipients, setRecipients, setReplyTo, setSender, setSentDate, setSubject, setSubject, setText, setText, updateHeaders, writeTo, writeTo

Methods inherited from class javax.mail.Message

addFrom, addRecipient, addRecipients, getAllRecipients, getFlags, getFolder, getFrom, getMessageNumber, getReceivedDate, getRecipients, getReplyTo, getSentDate, getSubject, isExpunged, isSet, match, reply, saveChanges, setExpunged, setFlag, setFlags, setFrom, setFrom, setMessageNumber, setRecipient, setRecipients, setReplyTo, setSentDate, setSubject

Method Details

getAllHeaderLines

public Enumeration getAllHeaderLines()
            throws MessagingException
Returns all the header-lines.
Specified by:
getAllHeaderLines in interface MimePart
Overrides:
getAllHeaderLines in interface MimeMessage
Returns:
an Enumeration of Strings

getAllHeaders

public Enumeration getAllHeaders()
            throws MessagingException
Returns all the headers.
Specified by:
getAllHeaders in interface Part
Overrides:
getAllHeaders in interface MimeMessage
Returns:
an Enumeration of Header objects

getContentStream

public InputStream getContentStream()
            throws MessagingException
Returns the unencoded bytes of the content.
Overrides:
getContentStream in interface MimeMessage

getHeader

public String[] getHeader(String name)
            throws MessagingException
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 interface MimeMessage
Parameters:
name - the header name

getHeader

public String getHeader(String name,
                        String delimiter)
            throws MessagingException
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 interface MimeMessage
Parameters:
name - the header name
delimiter - the delimiter

getLineCount

public int getLineCount()
            throws MessagingException
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 interface MimeMessage

getMatchingHeaderLines

public Enumeration getMatchingHeaderLines(String[] names)
            throws MessagingException
Returns all the header-lines with any of the given names.
Specified by:
getMatchingHeaderLines in interface MimePart
Overrides:
getMatchingHeaderLines in interface MimeMessage
Returns:
an Enumeration of Strings

getMatchingHeaders

public Enumeration getMatchingHeaders(String[] names)
            throws MessagingException
Returns all the headers with any of the given names.
Specified by:
getMatchingHeaders in interface Part
Overrides:
getMatchingHeaders in interface MimeMessage
Returns:
an Enumeration of Header objects

getMessageId

public String getMessageId()

getNonMatchingHeaderLines

public Enumeration getNonMatchingHeaderLines(String[] names)
            throws MessagingException
Returns all the header-lines without any of the given names.
Specified by:
getNonMatchingHeaderLines in interface MimePart
Overrides:
getNonMatchingHeaderLines in interface MimeMessage
Returns:
an Enumeration of Strings

getNonMatchingHeaders

public Enumeration getNonMatchingHeaders(String[] names)
            throws MessagingException
Returns all the headers without any of the given names.
Specified by:
getNonMatchingHeaders in interface Part
Overrides:
getNonMatchingHeaders in interface MimeMessage
Returns:
an Enumeration of Header objects

getSize

public int getSize()
            throws MessagingException
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 interface MimeMessage

saveChanges

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

setFlags

public void setFlags(Flags flag,
                     boolean set)
            throws MessagingException
Sets the flags for this message.
Overrides:
setFlags in interface MimeMessage

© Copyright 2003, 2004 The Free Software Foundation, All rights reserved