commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 16995] New: - Extensibility problems with the NNTP class
Date Wed, 12 Feb 2003 14:17:46 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16995>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16995

Extensibility problems with the NNTP class

           Summary: Extensibility problems with the NNTP class
           Product: Commons
           Version: Nightly Builds
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Net
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: sto@antares.no


org.apache.commons.net.nntp.NNTP provides support for issuing NNTP-commands
directly through the sendCommand() methods. This is useful when you need to send
NNTP extension commands to the server. The NNTP class also provides support for
reading the resulting reply code through the getReply() method. It does not,
however, provide any direct means of reading the command result string from the
stream. This can only be done by using the _reader BufferedReader instance,
which is declared with package access scope. Any class that wants to issue
commands via NNTP's sendCommand() method must therefore be in the
org.apache.commons.net.nntp package. The same goes for the _writer
BufferedWriter instance. Since it is reasonable to give any subclass of NNTP
access to these, I propose that their access scopes be changed to protected:

Change:

    BufferedWriter _writer;
    BufferedReader _reader;

to:

    protected BufferedWriter _writer;
    protected BufferedReader _reader;

In addition, it is useful to let clients of the NNTP class and its subclass,
NNTPClient, have access to these objects through accessor methods without the
need for subclassing. I propose to add public getter methods for these to the
NNTP class as well:

    public BufferedReader getReader()
    {
        return _reader;
    }

    public BufferedWriter getWriter()
    {
        return _writer;
    }

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message