Post an article to the NNTP server. This method returns a DotTerminatedMessageWriter instance to which the article can be written. Null is returned if the posting attempt fails. You should check
isAllowedToPost() before trying to post. However, a posting attempt can fail due to malformed headers.
You must not issue any commands to the NNTP server (i.e., call any (other methods) until you finish writing to the returned Writer instance and close it. The NNTP protocol uses the same stream for issuing commands as it does for returning results. Therefore the returned Writer actually writes directly to the NNTP connection. After you close the writer, you can execute new commands. If you do not follow these requirements your program will not work properly.
Different NNTP servers will require different header formats, but you can use the provided SimpleNNTPHeader class to construct the bare minimum acceptable header for most news readers. To construct more complicated headers you should refer to RFC 822. When the Java Mail API is finalized, you will be able to use it to compose fully compliant Internet text messages. The DotTerminatedMessageWriter takes care of doubling line-leading dots and ending the message with a single dot upon closing, so all you have to worry about is writing the header and the message.
Upon closing the returned Writer, you need to call completePendingCommand() to finalize the posting and verify its success or failure from the server reply.
@return A DotTerminatedMessageWriter to which the article (includingheader) can be written. Returns null if the command fails.
@exception IOException If an I/O error occurs while either sending acommand to the server or receiving a reply from the server.