commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1085214 - /commons/proper/net/trunk/src/main/java/examples/mail/IMAPMail.java
Date Fri, 25 Mar 2011 00:12:35 GMT
Author: sebb
Date: Fri Mar 25 00:12:35 2011
New Revision: 1085214

URL: http://svn.apache.org/viewvc?rev=1085214&view=rev
Log:
Minor fix

Modified:
    commons/proper/net/trunk/src/main/java/examples/mail/IMAPMail.java

Modified: commons/proper/net/trunk/src/main/java/examples/mail/IMAPMail.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/examples/mail/IMAPMail.java?rev=1085214&r1=1085213&r2=1085214&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/examples/mail/IMAPMail.java (original)
+++ commons/proper/net/trunk/src/main/java/examples/mail/IMAPMail.java Fri Mar 25 00:12:35
2011
@@ -63,7 +63,7 @@ public final class IMAPMail
         imap.setDefaultTimeout(60000);
 
         // suppress login details
-        imap.addProtocolCommandListener(new PrintCommandListener(System.out, true, (char)
0, true));
+        imap.addProtocolCommandListener(new PrintCommandListener(System.out, true));
 
         try
         {
@@ -85,35 +85,44 @@ public final class IMAPMail
                 System.exit(3);
             }
 
+            imap.setSoTimeout(6000);
+            
             if (imap.capability())
             {
-                System.out.println("Server capabilities:");
-                System.out.println(imap.getReplyString());
+//                System.out.println("Server capabilities:");
+//                System.out.println(imap.getReplyString());
             }
 
             if (imap.select("inbox"))
             {
-                System.out.println("Selected inbox:");
-                System.out.println(imap.getReplyString());
+//                System.out.println("Selected inbox:");
+//                System.out.println(imap.getReplyString());
             }
 
-            if (imap.examine("inbox"))
+//            if (imap.examine("inbox"))
             {
-                System.out.println("Examined inbox:");
-                System.out.println(imap.getReplyString());
+//                System.out.println("Examined inbox:");
+//                System.out.println(imap.getReplyString());
             }
 
-            if (imap.status("inbox", null))
+//            if (imap.status("inbox", null))
             {
-                System.out.println("Inbox status:");
-                System.out.println(imap.getReplyString());
+//                System.out.println("Inbox status:");
+//                System.out.println(imap.getReplyString());
             }
+//            imap.sendCommand("EXAMINE","more");
+            {
+//                System.out.println(imap.getReplyString());
+            } 
+
+            imap.getAdditionalReply();
 
             imap.logout();
             imap.disconnect();
         }
         catch (IOException e)
         {
+            System.out.println(imap.getReplyString());
             e.printStackTrace();
             System.exit(10);
             return;



Mime
View raw message