Class NNTP
- Direct Known Subclasses:
- NNTPClient
NNTPClient. The NNTP class is made public to provide access to
 various NNTP constants and to make it easier for adventurous programmers (or those with special needs) to interact with the NNTP protocol and implement their
 own clients. A set of methods with names corresponding to the NNTP command names are provided to facilitate this interaction.
 
 You should keep in mind that the NNTP server may choose to prematurely close a connection if the client has been idle for longer than a given time period or
 if the server is being shutdown by the operator or some other reason. The NNTP class will detect a premature NNTP server connection closing when it receives
 a NNTPReply.SERVICE_DISCONTINUED  response to a command. When that occurs, the NNTP class
 method encountering that reply will throw an NNTPConnectionClosedException . NNTPConectionClosedException is
 a subclass of IOException and therefore need not be caught separately, but if you are going to catch it separately, its catch block must
 appear before the more general IOException catch block. When you encounter an
 NNTPConnectionClosedException , you must disconnect the connection with disconnect()  to properly
 clean up the system resources used by NNTP. Before disconnecting, you may check the last reply code and text with getReplyCode  and
 getReplyString .
 
 Rather than list it separately for each method, we mention here that every method communicating with the server and throwing an IOException can also throw a
 MalformedServerReplyException , which is a subclass of IOException. A MalformedServerReplyException will be thrown when the
 reply received from the server deviates enough from the protocol specification that it cannot be interpreted in a useful manner despite attempts to be as
 lenient as possible.
 
- See Also:
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected ProtocolCommandSupportA ProtocolCommandSupport object used to manage the registering of ProtocolCommandListeners and te firing of ProtocolCommandEvents.protected BufferedReaderWrapsSocketClient._input_to communicate with server.protected BufferedWriterWrapsSocketClient._output_to communicate with server.static final intThe default NNTP port.Fields inherited from class org.apache.commons.net.SocketClient_defaultPort_, _hostname_, _input_, _output_, _serverSocketFactory_, _socket_, _socketFactory_, _timeout_, connectTimeout, NETASCII_EOL, remoteInetSocketAddress
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidInitiates control connections and gets initial reply, determining if the client is allowed to post to the server.intarticle()A convenience method to send the NNTP ARTICLE command to the server, receive the initial reply, and return the reply code.intarticle(int a) Deprecated.- for API compatibility only - DO NOT USEintarticle(long articleNumber) A convenience method to send the NNTP ARTICLE command to the server, receive the initial reply, and return the reply code.intA convenience method to send the NNTP ARTICLE command to the server, receive the initial reply, and return the reply code.intauthinfoPass(String password) A convenience method to send the AUTHINFO PASS command to the server, receive the reply, and return the reply code.intauthinfoUser(String user) A convenience method to send the AUTHINFO USER command to the server, receive the reply, and return the reply code.intbody()A convenience method to send the NNTP BODY command to the server, receive the initial reply, and return the reply code.intbody(int a) Deprecated.- for API compatibility only - DO NOT USEintbody(long articleNumber) A convenience method to send the NNTP BODY command to the server, receive the initial reply, and return the reply code.intA convenience method to send the NNTP BODY command to the server, receive the initial reply, and return the reply code.voidCloses the connection to the NNTP server and sets to null some internal data so that the memory may be reclaimed by the garbage collector.protected ProtocolCommandSupportProvide command support to super-classintgetReply()Fetches a reply from the NNTP server and returns the integer reply code.intReturns the integer value of the reply code of the last NNTP reply.Returns the entire text of the last NNTP server response exactly as it was received, not including the end of line marker.intA convenience method to send the NNTP GROUP command to the server, receive the reply, and return the reply code.inthead()A convenience method to send the NNTP HEAD command to the server, receive the initial reply, and return the reply code.inthead(int a) Deprecated.- for API compatibility only - DO NOT USEinthead(long articleNumber) A convenience method to send the NNTP HEAD command to the server, receive the initial reply, and return the reply code.intA convenience method to send the NNTP HEAD command to the server, receive the initial reply, and return the reply code.inthelp()A convenience method to send the NNTP HELP command to the server, receive the reply, and return the reply code.intA convenience method to send the NNTP IHAVE command to the server, receive the reply, and return the reply code.booleanIndicates whether or not the client is allowed to post articles to the server it is currently connected to.intlast()A convenience method to send the NNTP LAST command to the server, receive the reply, and return the reply code.intlist()A convenience method to send the NNTP LIST command to the server, receive the reply, and return the reply code.intlistActive(String wildmat) A convenience wrapper for the extended LIST command that takes an argument, allowing us to selectively list multiple groups.intA convenience method to send the "NEWGROUPS" command to the server, receive the reply, and return the reply code.intA convenience method to send the "NEWNEWS" command to the server, receive the reply, and return the reply code.intnext()A convenience method to send the NNTP NEXT command to the server, receive the reply, and return the reply code.intpost()A convenience method to send the NNTP POST command to the server, receive the reply, and return the reply code.intquit()A convenience method to send the NNTP QUIT command to the server, receive the reply, and return the reply code.intsendCommand(int command) Sends an NNTP command with no arguments to the server, waits for a reply and returns the numerical response code.intsendCommand(int command, String args) Sends an NNTP command to the server, waits for a reply and returns the numerical response code.intsendCommand(String command) Sends an NNTP command with no arguments to the server, waits for a reply and returns the numerical response code.intsendCommand(String command, String args) Sends an NNTP command to the server, waits for a reply and returns the numerical response code.intstat()A convenience method to send the NNTP STAT command to the server, receive the initial reply, and return the reply code.intstat(int a) Deprecated.- for API compatibility only - DO NOT USEintstat(long articleNumber) A convenience method to send the NNTP STAT command to the server, receive the initial reply, and return the reply code.intA convenience method to send the NNTP STAT command to the server, receive the initial reply, and return the reply code.intA convenience method to send the NNTP XHDR command to the server, receive the reply, and return the reply code.intA convenience method to send the NNTP XOVER command to the server, receive the reply, and return the reply code.Methods inherited from class org.apache.commons.net.SocketClientaddProtocolCommandListener, applySocketAttributes, checkOpenOutputStream, connect, connect, connect, connect, connect, connect, createCommandSupport, fireCommandSent, fireReplyReceived, getCharset, getCharsetName, getConnectTimeout, getDefaultPort, getDefaultTimeout, getKeepAlive, getLocalAddress, getLocalPort, getProxy, getReceiveBufferSize, getRemoteAddress, getRemoteInetSocketAddress, getRemotePort, getSendBufferSize, getServerSocketFactory, getSoLinger, getSoTimeout, getTcpNoDelay, isAvailable, isConnected, removeProtocolCommandListener, setCharset, setConnectTimeout, setDefaultPort, setDefaultTimeout, setKeepAlive, setProxy, setReceiveBufferSize, setSendBufferSize, setServerSocketFactory, setSocketFactory, setSoLinger, setSoTimeout, setTcpNoDelay, verifyRemote
- 
Field Details- 
DEFAULT_PORTThe default NNTP port. Its value is 119 according to RFC 977.- See Also:
 
- 
_reader_WrapsSocketClient._input_to communicate with server. Initialized by_connectAction_(). All server reads should be done through this variable.
- 
_writer_WrapsSocketClient._output_to communicate with server. Initialized by_connectAction_(). All server reads should be done through this variable.
- 
_commandSupport_A ProtocolCommandSupport object used to manage the registering of ProtocolCommandListeners and te firing of ProtocolCommandEvents.
 
- 
- 
Constructor Details- 
NNTPpublic NNTP()The default NNTP constructor. Sets the default port toDEFAULT_PORTand initializes internal data structures for saving NNTP reply information.
 
- 
- 
Method Details- 
_connectAction_Initiates control connections and gets initial reply, determining if the client is allowed to post to the server. Initializes_reader_and_writer_to wrapSocketClient._input_andSocketClient._output_.- Overrides:
- _connectAction_in class- SocketClient
- Throws:
- IOException- (SocketException) if a problem occurs with the socket
 
- 
articleA convenience method to send the NNTP ARTICLE command to the server, receive the initial reply, and return the reply code.- Returns:
- The reply code received from the server.
- Throws:
- NNTPConnectionClosedException- If the NNTP server prematurely closes the connection as a result of the client being idle or some other reason causing the server to send NNTP reply code 400. This exception may be caught either as an IOException or independently as itself.
- IOException- If an I/O error occurs while either sending the command or receiving the server reply.
 
- 
articleDeprecated.- for API compatibility only - DO NOT USE- Parameters:
- a- article number
- Returns:
- number
- Throws:
- IOException- on error
 
- 
articleA convenience method to send the NNTP ARTICLE command to the server, receive the initial reply, and return the reply code.- Parameters:
- articleNumber- The number of the article to request from the currently selected newsgroup.
- Returns:
- The reply code received from the server.
- Throws:
- NNTPConnectionClosedException- If the NNTP server prematurely closes the connection as a result of the client being idle or some other reason causing the server to send NNTP reply code 400. This exception may be caught either as an IOException or independently as itself.
- IOException- If an I/O error occurs while either sending the command or receiving the server reply.
 
- 
articleA convenience method to send the NNTP ARTICLE command to the server, receive the initial reply, and return the reply code.- Parameters:
- messageId- The message identifier of the requested article, including the encapsulating < and > characters.
- Returns:
- The reply code received from the server.
- Throws:
- NNTPConnectionClosedException- If the NNTP server prematurely closes the connection as a result of the client being idle or some other reason causing the server to send NNTP reply code 400. This exception may be caught either as an IOException or independently as itself.
- IOException- If an I/O error occurs while either sending the command or receiving the server reply.
 
- 
authinfoPassA convenience method to send the AUTHINFO PASS command to the server, receive the reply, and return the reply code. If this step is required, it should immediately follow the AUTHINFO USER command (See RFC 2980)- Parameters:
- password- a valid password.
- Returns:
- The reply code received from the server. The server should return a 281 or 502 for this command.
- Throws:
- NNTPConnectionClosedException- If the NNTP server prematurely closes the connection as a result of the client being idle or some other reason causing the server to send NNTP reply code 400. This exception may be caught either as an IOException or independently as itself.
- IOException- If an I/O error occurs while either sending the command or receiving the server reply.
 
- 
authinfoUserA convenience method to send the AUTHINFO USER command to the server, receive the reply, and return the reply code. (See RFC 2980)- Parameters:
- user- A valid user name.
- Returns:
- The reply code received from the server. The server should return a 381 or 281 for this command.
- Throws:
- NNTPConnectionClosedException- If the NNTP server prematurely closes the connection as a result of the client being idle or some other reason causing the server to send NNTP reply code 400. This exception may be caught either as an IOException or independently as itself.
- IOException- If an I/O error occurs while either sending the command or receiving the server reply.
 
- 
bodyA convenience method to send the NNTP BODY command to the server, receive the initial reply, and return the reply code.- Returns:
- The reply code received from the server.
- Throws:
- NNTPConnectionClosedException- If the NNTP server prematurely closes the connection as a result of the client being idle or some other reason causing the server to send NNTP reply code 400. This exception may be caught either as an IOException or independently as itself.
- IOException- If an I/O error occurs while either sending the command or receiving the server reply.
 
- 
bodyDeprecated.- for API compatibility only - DO NOT USE- Parameters:
- a- article number
- Returns:
- number
- Throws:
- IOException- on error
 
- 
bodyA convenience method to send the NNTP BODY command to the server, receive the initial reply, and return the reply code.- Parameters:
- articleNumber- The number of the article to request from the currently selected newsgroup.
- Returns:
- The reply code received from the server.
- Throws:
- NNTPConnectionClosedException- If the NNTP server prematurely closes the connection as a result of the client being idle or some other reason causing the server to send NNTP reply code 400. This exception may be caught either as an IOException or independently as itself.
- IOException- If an I/O error occurs while either sending the command or receiving the server reply.
 
- 
bodyA convenience method to send the NNTP BODY command to the server, receive the initial reply, and return the reply code.- Parameters:
- messageId- The message identifier of the requested article, including the encapsulating < and > characters.
- Returns:
- The reply code received from the server.
- Throws:
- NNTPConnectionClosedException- If the NNTP server prematurely closes the connection as a result of the client being idle or some other reason causing the server to send NNTP reply code 400. This exception may be caught either as an IOException or independently as itself.
- IOException- If an I/O error occurs while either sending the command or receiving the server reply.
 
- 
disconnectCloses the connection to the NNTP server and sets to null some internal data so that the memory may be reclaimed by the garbage collector. The reply text and code information from the last command is voided so that the memory it used may be reclaimed.- Overrides:
- disconnectin class- SocketClient
- Throws:
- IOException- If an error occurs while disconnecting.
 
- 
getCommandSupportProvide command support to super-class- Overrides:
- getCommandSupportin class- SocketClient
- Returns:
- the CommandSupport instance, may be null
 
- 
getReplyFetches a reply from the NNTP server and returns the integer reply code. After calling this method, the actual reply text can be accessed fromgetReplyString. Only use this method if you are implementing your own NNTP client or if you need to fetch a secondary response from the NNTP server.- Returns:
- The integer value of the reply code of the fetched NNTP reply. in response to the command.
- Throws:
- NNTPConnectionClosedException- If the NNTP server prematurely closes the connection as a result of the client being idle or some other reason causing the server to send NNTP reply code 400. This exception may be caught either as an IOException or independently as itself.
- IOException- If an I/O error occurs while receiving the server reply.
 
- 
getReplyCodeReturns the integer value of the reply code of the last NNTP reply. You will usually only use this method after you connect to the NNTP server to check that the connection was successful sinceconnectis of type void.- Returns:
- The integer value of the reply code of the last NNTP reply.
 
- 
getReplyStringReturns the entire text of the last NNTP server response exactly as it was received, not including the end of line marker.- Returns:
- The entire text from the last NNTP response as a String.
 
- 
groupA convenience method to send the NNTP GROUP command to the server, receive the reply, and return the reply code.- Parameters:
- newsgroup- The name of the newsgroup to select.
- Returns:
- The reply code received from the server.
- Throws:
- NNTPConnectionClosedException- If the NNTP server prematurely closes the connection as a result of the client being idle or some other reason causing the server to send NNTP reply code 400. This exception may be caught either as an IOException or independently as itself.
- IOException- If an I/O error occurs while either sending the command or receiving the server reply.
 
- 
headA convenience method to send the NNTP HEAD command to the server, receive the initial reply, and return the reply code.- Returns:
- The reply code received from the server.
- Throws:
- NNTPConnectionClosedException- If the NNTP server prematurely closes the connection as a result of the client being idle or some other reason causing the server to send NNTP reply code 400. This exception may be caught either as an IOException or independently as itself.
- IOException- If an I/O error occurs while either sending the command or receiving the server reply.
 
- 
headDeprecated.- for API compatibility only - DO NOT USE- Parameters:
- a- article number
- Returns:
- number
- Throws:
- IOException- on error
 
- 
headA convenience method to send the NNTP HEAD command to the server, receive the initial reply, and return the reply code.- Parameters:
- articleNumber- The number of the article to request from the currently selected newsgroup.
- Returns:
- The reply code received from the server.
- Throws:
- NNTPConnectionClosedException- If the NNTP server prematurely closes the connection as a result of the client being idle or some other reason causing the server to send NNTP reply code 400. This exception may be caught either as an IOException or independently as itself.
- IOException- If an I/O error occurs while either sending the command or receiving the server reply.
 
- 
headA convenience method to send the NNTP HEAD command to the server, receive the initial reply, and return the reply code.- Parameters:
- messageId- The message identifier of the requested article, including the encapsulating < and > characters.
- Returns:
- The reply code received from the server.
- Throws:
- NNTPConnectionClosedException- If the NNTP server prematurely closes the connection as a result of the client being idle or some other reason causing the server to send NNTP reply code 400. This exception may be caught either as an IOException or independently as itself.
- IOException- If an I/O error occurs while either sending the command or receiving the server reply.
 
- 
helpA convenience method to send the NNTP HELP command to the server, receive the reply, and return the reply code.- Returns:
- The reply code received from the server.
- Throws:
- NNTPConnectionClosedException- If the NNTP server prematurely closes the connection as a result of the client being idle or some other reason causing the server to send NNTP reply code 400. This exception may be caught either as an IOException or independently as itself.
- IOException- If an I/O error occurs while either sending the command or receiving the server reply.
 
- 
ihaveA convenience method to send the NNTP IHAVE command to the server, receive the reply, and return the reply code.- Parameters:
- messageId- The article identifier, including the encapsulating < and > characters.
- Returns:
- The reply code received from the server.
- Throws:
- NNTPConnectionClosedException- If the NNTP server prematurely closes the connection as a result of the client being idle or some other reason causing the server to send NNTP reply code 400. This exception may be caught either as an IOException or independently as itself.
- IOException- If an I/O error occurs while either sending the command or receiving the server reply.
 
- 
isAllowedToPostIndicates whether or not the client is allowed to post articles to the server it is currently connected to.- Returns:
- True if the client can post articles to the server, false otherwise.
 
- 
lastA convenience method to send the NNTP LAST command to the server, receive the reply, and return the reply code.- Returns:
- The reply code received from the server.
- Throws:
- NNTPConnectionClosedException- If the NNTP server prematurely closes the connection as a result of the client being idle or some other reason causing the server to send NNTP reply code 400. This exception may be caught either as an IOException or independently as itself.
- IOException- If an I/O error occurs while either sending the command or receiving the server reply.
 
- 
listA convenience method to send the NNTP LIST command to the server, receive the reply, and return the reply code.- Returns:
- The reply code received from the server.
- Throws:
- NNTPConnectionClosedException- If the NNTP server prematurely closes the connection as a result of the client being idle or some other reason causing the server to send NNTP reply code 400. This exception may be caught either as an IOException or independently as itself.
- IOException- If an I/O error occurs while either sending the command or receiving the server reply.
 
- 
listActiveA convenience wrapper for the extended LIST command that takes an argument, allowing us to selectively list multiple groups.- Parameters:
- wildmat- A wildmat (pseudo-regex) pattern. See RFC 2980 for details.
- Returns:
- the reply code received from the server.
- Throws:
- IOException- if the command fails
 
- 
newgroupspublic int newgroups(String date, String time, boolean GMT, String distributions) throws IOException A convenience method to send the "NEWGROUPS" command to the server, receive the reply, and return the reply code.- Parameters:
- date- The date after which to check for new groups. Date format is YYMMDD
- time- The time after which to check for new groups. Time format is HHMMSS using a 24-hour clock.
- GMT- True if the time is in GMT, false if local server time.
- distributions- Comma-separated distribution list to check for new groups. Set to null if no distributions.
- Returns:
- The reply code received from the server.
- Throws:
- NNTPConnectionClosedException- If the NNTP server prematurely closes the connection as a result of the client being idle or some other reason causing the server to send NNTP reply code 400. This exception may be caught either as an IOException or independently as itself.
- IOException- If an I/O error occurs while either sending the command or receiving the server reply.
 
- 
newnewspublic int newnews(String newsgroups, String date, String time, boolean GMT, String distributions) throws IOException A convenience method to send the "NEWNEWS" command to the server, receive the reply, and return the reply code.- Parameters:
- newsgroups- A comma-separated list of newsgroups to check for new news.
- date- The date after which to check for new news. Date format is YYMMDD
- time- The time after which to check for new news. Time format is HHMMSS using a 24-hour clock.
- GMT- True if the time is in GMT, false if local server time.
- distributions- Comma-separated distribution list to check for new news. Set to null if no distributions.
- Returns:
- The reply code received from the server.
- Throws:
- NNTPConnectionClosedException- If the NNTP server prematurely closes the connection as a result of the client being idle or some other reason causing the server to send NNTP reply code 400. This exception may be caught either as an IOException or independently as itself.
- IOException- If an I/O error occurs while either sending the command or receiving the server reply.
 
- 
nextA convenience method to send the NNTP NEXT command to the server, receive the reply, and return the reply code.- Returns:
- The reply code received from the server.
- Throws:
- NNTPConnectionClosedException- If the NNTP server prematurely closes the connection as a result of the client being idle or some other reason causing the server to send NNTP reply code 400. This exception may be caught either as an IOException or independently as itself.
- IOException- If an I/O error occurs while either sending the command or receiving the server reply.
 
- 
postA convenience method to send the NNTP POST command to the server, receive the reply, and return the reply code.- Returns:
- The reply code received from the server.
- Throws:
- NNTPConnectionClosedException- If the NNTP server prematurely closes the connection as a result of the client being idle or some other reason causing the server to send NNTP reply code 400. This exception may be caught either as an IOException or independently as itself.
- IOException- If an I/O error occurs while either sending the command or receiving the server reply.
 
- 
quitA convenience method to send the NNTP QUIT command to the server, receive the reply, and return the reply code.- Returns:
- The reply code received from the server.
- Throws:
- NNTPConnectionClosedException- If the NNTP server prematurely closes the connection as a result of the client being idle or some other reason causing the server to send NNTP reply code 400. This exception may be caught either as an IOException or independently as itself.
- IOException- If an I/O error occurs while either sending the command or receiving the server reply.
 
- 
sendCommandSends an NNTP command with no arguments to the server, waits for a reply and returns the numerical response code. After invocation, for more detailed information, the actual reply text can be accessed by callinggetReplyString.- Parameters:
- command- The NNTPCommand constant corresponding to the NNTP command to send.
- Returns:
- The integer value of the NNTP reply code returned by the server in response to the command. in response to the command.
- Throws:
- NNTPConnectionClosedException- If the NNTP server prematurely closes the connection as a result of the client being idle or some other reason causing the server to send NNTP reply code 400. This exception may be caught either as an IOException or independently as itself.
- IOException- If an I/O error occurs while either sending the command or receiving the server reply.
 
- 
sendCommandSends an NNTP command to the server, waits for a reply and returns the numerical response code. After invocation, for more detailed information, the actual reply text can be accessed by callinggetReplyString.- Parameters:
- command- The NNTPCommand constant corresponding to the NNTP command to send.
- args- The arguments to the NNTP command. If this parameter is set to null, then the command is sent with no argument.
- Returns:
- The integer value of the NNTP reply code returned by the server in response to the command. in response to the command.
- Throws:
- NNTPConnectionClosedException- If the NNTP server prematurely closes the connection as a result of the client being idle or some other reason causing the server to send NNTP reply code 400. This exception may be caught either as an IOException or independently as itself.
- IOException- If an I/O error occurs while either sending the command or receiving the server reply.
 
- 
sendCommandSends an NNTP command with no arguments to the server, waits for a reply and returns the numerical response code. After invocation, for more detailed information, the actual reply text can be accessed by callinggetReplyString.- Parameters:
- command- The text representation of the NNTP command to send.
- Returns:
- The integer value of the NNTP reply code returned by the server in response to the command. in response to the command.
- Throws:
- NNTPConnectionClosedException- If the NNTP server prematurely closes the connection as a result of the client being idle or some other reason causing the server to send NNTP reply code 400. This exception may be caught either as an IOException or independently as itself.
- IOException- If an I/O error occurs while either sending the command or receiving the server reply.
 
- 
sendCommandSends an NNTP command to the server, waits for a reply and returns the numerical response code. After invocation, for more detailed information, the actual reply text can be accessed by callinggetReplyString.- Parameters:
- command- The text representation of the NNTP command to send.
- args- The arguments to the NNTP command. If this parameter is set to null, then the command is sent with no argument.
- Returns:
- The integer value of the NNTP reply code returned by the server in response to the command.
- Throws:
- NNTPConnectionClosedException- If the NNTP server prematurely closes the connection as a result of the client being idle or some other reason causing the server to send NNTP reply code 400. This exception may be caught either as an IOException or independently as itself.
- IOException- If an I/O error occurs while either sending the command or receiving the server reply.
 
- 
statA convenience method to send the NNTP STAT command to the server, receive the initial reply, and return the reply code.- Returns:
- The reply code received from the server.
- Throws:
- NNTPConnectionClosedException- If the NNTP server prematurely closes the connection as a result of the client being idle or some other reason causing the server to send NNTP reply code 400. This exception may be caught either as an IOException or independently as itself.
- IOException- If an I/O error occurs while either sending the command or receiving the server reply.
 
- 
statDeprecated.- for API compatibility only - DO NOT USE- Parameters:
- a- article number
- Returns:
- number
- Throws:
- IOException- on error
 
- 
statA convenience method to send the NNTP STAT command to the server, receive the initial reply, and return the reply code.- Parameters:
- articleNumber- The number of the article to request from the currently selected newsgroup.
- Returns:
- The reply code received from the server.
- Throws:
- NNTPConnectionClosedException- If the NNTP server prematurely closes the connection as a result of the client being idle or some other reason causing the server to send NNTP reply code 400. This exception may be caught either as an IOException or independently as itself.
- IOException- If an I/O error occurs while either sending the command or receiving the server reply.
 
- 
statA convenience method to send the NNTP STAT command to the server, receive the initial reply, and return the reply code.- Parameters:
- messageId- The message identifier of the requested article, including the encapsulating < and > characters.
- Returns:
- The reply code received from the server.
- Throws:
- NNTPConnectionClosedException- If the NNTP server prematurely closes the connection as a result of the client being idle or some other reason causing the server to send NNTP reply code 400. This exception may be caught either as an IOException or independently as itself.
- IOException- If an I/O error occurs while either sending the command or receiving the server reply.
 
- 
xhdrA convenience method to send the NNTP XHDR command to the server, receive the reply, and return the reply code.- Parameters:
- header- a String naming a header line (e.g., "subject"). See RFC-1036 for a list of valid header lines.
- selectedArticles- a String representation of the range of article headers required. This may be an article number, or a range of article numbers in the form "XXXX-YYYY", where XXXX and YYYY are valid article numbers in the current group. It also may be of the form "XXX-", meaning "return XXX and all following articles" In this revision, the last format is not possible (yet).
- Returns:
- The reply code received from the server.
- Throws:
- NNTPConnectionClosedException- If the NNTP server prematurely closes the connection as a result of the client being idle or some other reason causing the server to send NNTP reply code 400. This exception may be caught either as an IOException or independently as itself.
- IOException- If an I/O error occurs while either sending the command or receiving the server reply.
 
- 
xoverA convenience method to send the NNTP XOVER command to the server, receive the reply, and return the reply code.- Parameters:
- selectedArticles- a String representation of the range of article headers required. This may be an article number, or a range of article numbers in the form "XXXX-YYYY", where XXXX and YYYY are valid article numbers in the current group. It also may be of the form "XXX-", meaning "return XXX and all following articles" In this revision, the last format is not possible (yet).
- Returns:
- The reply code received from the server.
- Throws:
- NNTPConnectionClosedException- If the NNTP server prematurely closes the connection as a result of the client being idle or some other reason causing the server to send NNTP reply code 400. This exception may be caught either as an IOException or independently as itself.
- IOException- If an I/O error occurs while either sending the command or receiving the server reply.
 
 
-