commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1086051 - in /commons/proper/net/trunk/src: changes/changes.xml main/java/org/apache/commons/net/imap/AuthenticatingIMAPClient.java main/java/org/apache/commons/net/imap/IMAP.java
Date Sun, 27 Mar 2011 22:00:07 GMT
Author: sebb
Date: Sun Mar 27 22:00:07 2011
New Revision: 1086051

URL: http://svn.apache.org/viewvc?rev=1086051&view=rev
Log:
NET-394 Are the sendUntaggedCommand() methods needed?
Renamed the method as sendData(), as it's not a command.

Modified:
    commons/proper/net/trunk/src/changes/changes.xml
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/imap/AuthenticatingIMAPClient.java
    commons/proper/net/trunk/src/main/java/org/apache/commons/net/imap/IMAP.java

Modified: commons/proper/net/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/changes/changes.xml?rev=1086051&r1=1086050&r2=1086051&view=diff
==============================================================================
--- commons/proper/net/trunk/src/changes/changes.xml (original)
+++ commons/proper/net/trunk/src/changes/changes.xml Sun Mar 27 22:00:07 2011
@@ -57,6 +57,10 @@ The <action> type attribute can be add,u
 
     <body>
         <release version="3.0" date="TBA" description="TBA">
+            <action issue="NET-394" dev="sebb" type="update">
+            Are the sendUntaggedCommand() methods needed?
+            Renamed the method as sendData(), as it's not a command.
+            </action>
             <action issue="NET-392" dev="sebb" type="update">
             Use enum for IMAPCommand.
             </action>

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/imap/AuthenticatingIMAPClient.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/imap/AuthenticatingIMAPClient.java?rev=1086051&r1=1086050&r2=1086051&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/imap/AuthenticatingIMAPClient.java
(original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/imap/AuthenticatingIMAPClient.java
Sun Mar 27 22:00:07 2011
@@ -149,7 +149,7 @@ public class AuthenticatingIMAPClient ex
             case PLAIN:
             {
                 // the server sends an empty response ("+ "), so we don't have to read it.
-                int result = sendUntaggedCommand(
+                int result = sendData(
                     new String(
                         Base64.encodeBase64(("\000" + username + "\000" + password).getBytes())
                         )
@@ -176,7 +176,7 @@ public class AuthenticatingIMAPClient ex
                 toEncode[usernameBytes.length] = ' ';
                 System.arraycopy(hmacResult, 0, toEncode, usernameBytes.length + 1, hmacResult.length);
                 // send the reply and read the server code:
-                int result = sendUntaggedCommand(new String(Base64.encodeBase64(toEncode)));
+                int result = sendData(new String(Base64.encodeBase64(toEncode)));
                 if (result == IMAPReply.OK)
                 {
                     setState(IMAP.IMAPState.AUTH_STATE);
@@ -187,12 +187,12 @@ public class AuthenticatingIMAPClient ex
             {
                 // the server sends fixed responses (base64("Username") and
                 // base64("Password")), so we don't have to read them.
-                if (sendUntaggedCommand(
+                if (sendData(
                     new String(Base64.encodeBase64(username.getBytes()))) != IMAPReply.CONT)
                 {
                     return false;
                 }
-                int result = sendUntaggedCommand(
+                int result = sendData(
                     new String(Base64.encodeBase64(password.getBytes())));
                 if (result == IMAPReply.OK)
                 {

Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/imap/IMAP.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/imap/IMAP.java?rev=1086051&r1=1086050&r2=1086051&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/imap/IMAP.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/imap/IMAP.java Sun Mar 27
22:00:07 2011
@@ -368,56 +368,17 @@ public class IMAP extends SocketClient
     }
 
     /**
-     * Sends an untagged command an arguments to the server and returns the reply code.
+     * Sends data to the server and returns the reply code.
      * <p>
      * @param command  The IMAP command to send.
-     * @param args     The command arguments.
      * @return  The server reply code (see IMAPReply).
      */
-    public int sendUntaggedCommand(String command, String args) throws IOException
-    {
-        return sendCommandWithID(null, command, args);
-    }
-
-    /**
-     * Sends an untagged command with no arguments to the server and returns the
-     * reply code.
-     * <p>
-     * @param command  The IMAP command to send.
-     * @return  The server reply code (see IMAPReply).
-     */
-    public int sendUntaggedCommand(String command) throws IOException
+    public int sendData(String command) throws IOException
     {
         return sendCommandWithID(null, command, null);
     }
 
     /**
-     * Sends an untagged command an arguments to the server and returns the reply code.
-     * <p>
-     * @param command  The IMAP command to send
-     *                  (one of the IMAPCommand constants).
-     * @param args     The command arguments.
-     * @return  The server reply code (see IMAPReply).
-     */
-    public int sendUntaggedCommand(IMAPCommand command, String args) throws IOException
-    {
-        return sendCommandWithID(null, IMAPCommand.getCommand(command), args);
-    }
-
-    /**
-     * Sends an untagged command with no arguments to the server and returns the
-     * reply code.
-     * <p>
-     * @param command  The IMAP command to send
-     *                  (one of the IMAPCommand constants).
-     * @return  The server reply code (see IMAPReply).
-    **/
-    public int sendUntaggedCommand(IMAPCommand command) throws IOException
-    {
-        return sendCommandWithID(null, IMAPCommand.getCommand(command), null);
-    }
-
-    /**
      * Returns an array of lines received as a reply to the last command
      * sent to the server.  The lines have end of lines truncated.
      * @return The last server response.



Mime
View raw message