[ 
https://issues.apache.org/jira/browse/NET-333?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13012020#comment-13012020
 ] 

Bogdan Drozdowski commented on NET-333:
---------------------------------------

What fields in IMAPReply are needed? The reply codes? Now, since reply parsing 
is in the same class, they're just in case the user wants to check manually.

Yes, users can override the generateCommandID() method, but not only this 
requires a new class (can't do this from a class that's just using IMAP), but 
also the users can't override the initial tag this way.

Had a look at the code, looks good to me. I see you're testing the tag 
generator - good, because I've only checked only about 30 or 40 tags in a row 
(without sending any commands). On the other hand, if the generator increases 
the length instead of wrapping, a new test will have to be written (but it's 
not a problem right now). I've just spotted a tiny thing: in the example class, 
IMAPMail.java, you have:
{code}
// enable the next line if the server certificate has expired:
// ((IMAPSClient) 
imap).setTrustManager(TrustManagerUtils.getValidateServerCertificateTrustManager());
{code}
while I think it should be:
{code}
// enable the next line if the server certificate has NOT expired:
// ((IMAPSClient) 
imap).setTrustManager(TrustManagerUtils.getValidateServerCertificateTrustManager());
{code}
A tiny thing, but can confuse (if I'm right). And
{code}
    public String getIMAPCommand() {
        return imapCommand != null ? imapCommand : name();
    }
{code}
should be changed to:
{code}
    public String getIMAPCommand() {
        return imapCommand != null ? imapCommand : toString();
    }
{code}
because, as far as I remember, toString() actually returns the name of the 
constant, while name() returns something more - a more (or fully) qualified 
name of the constant. Probably not the thing we want. The enum can't be 
extended by user code, but looks cleaner than the original class.

> would you provide a class used for imap protocol?
> -------------------------------------------------
>
>                 Key: NET-333
>                 URL: https://issues.apache.org/jira/browse/NET-333
>             Project: Commons Net
>          Issue Type: Improvement
>            Reporter: iceviewer
>         Attachments: IMAP.zip, IMAPMail.java
>
>
> would you provide a class used for imap protocol?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to