commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1085866 - /commons/proper/net/trunk/src/main/java/examples/mail/IMAPMail.java
Date Sun, 27 Mar 2011 04:10:30 GMT
Author: sebb
Date: Sun Mar 27 04:10:29 2011
New Revision: 1085866

URL: http://svn.apache.org/viewvc?rev=1085866&view=rev
Log:
Tidy code

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=1085866&r1=1085865&r2=1085866&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 Sun Mar 27 04:10:29
2011
@@ -71,9 +71,7 @@ public final class IMAPMail
         }
         catch (IOException e)
         {
-            System.err.println("Could not connect to server.");
-            e.printStackTrace();
-            System.exit(2);
+            throw new RuntimeException("Could not connect to server.", e);
         }
 
         try
@@ -87,35 +85,13 @@ public final class IMAPMail
 
             imap.setSoTimeout(6000);
             
-            if (imap.capability())
-            {
-//                System.out.println("Server capabilities:");
-//                System.out.println(imap.getReplyString());
-            }
+            imap.capability();
 
-            if (imap.select("inbox"))
-            {
-//                System.out.println("Selected inbox:");
-//                System.out.println(imap.getReplyString());
-            }
+            imap.select("inbox");
 
-//            if (imap.examine("inbox"))
-            {
-//                System.out.println("Examined inbox:");
-//                System.out.println(imap.getReplyString());
-            }
-
-//            if (imap.status("inbox", null))
-            {
-//                System.out.println("Inbox status:");
-//                System.out.println(imap.getReplyString());
-            }
-//            imap.sendCommand("EXAMINE","more");
-            {
-//                System.out.println(imap.getReplyString());
-            } 
+            imap.examine("inbox");
 
-            imap.getAdditionalReply();
+            imap.status("inbox", null);
 
             imap.logout();
             imap.disconnect();



Mime
View raw message