ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r1092610 - in /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net: FTP.java FTPTaskMirrorImpl.java
Date Fri, 15 Apr 2011 07:24:36 GMT
Author: bodewig
Date: Fri Apr 15 07:24:35 2011
New Revision: 1092610

URL: http://svn.apache.org/viewvc?rev=1092610&view=rev
Log:
commons-net trunk has removed all static final ints from FTPReply

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/FTPTaskMirrorImpl.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java?rev=1092610&r1=1092609&r2=1092610&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java Fri Apr 15
07:24:35 2011
@@ -88,8 +88,10 @@ public class FTP extends Task implements
     protected static final int CHMOD = 5;
     protected static final int RM_DIR = 6;
     protected static final int SITE_CMD = 7;
-    /** return code of ftp - not implemented in commons-net version 1.0 */
+    /** return code of ftp */
     private static final int CODE_521 = 521;
+    private static final int CODE_550 = 550;
+    private static final int CODE_553 = 553;
 
     /** adjust uptodate calculations where server timestamps are HH:mm and client's
      * are HH:mm:ss */
@@ -2375,7 +2377,7 @@ public class FTP extends Task implements
                     //  failed because the directory already exists.
                     int rc = ftp.getReplyCode();
                     if (!(ignoreNoncriticalErrors
-                          && (rc == FTPReply.CODE_550 || rc == FTPReply.CODE_553
+                          && (rc == CODE_550 || rc == CODE_553
                               || rc == CODE_521))) {
                         throw new BuildException("could not create directory: "
                                                  + ftp.getReplyString());
@@ -2406,7 +2408,7 @@ public class FTP extends Task implements
         throws BuildException {
         int rc = ftp.getReplyCode();
         if (!(ignoreNoncriticalErrors
-              && (rc == FTPReply.CODE_550 || rc == FTPReply.CODE_553 || rc == CODE_521)))
{
+              && (rc == CODE_550 || rc == CODE_553 || rc == CODE_521))) {
             throw new BuildException("could not create directory: "
                                      + ftp.getReplyString());
         }

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/FTPTaskMirrorImpl.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/FTPTaskMirrorImpl.java?rev=1092610&r1=1092609&r2=1092610&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/FTPTaskMirrorImpl.java
(original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/FTPTaskMirrorImpl.java
Fri Apr 15 07:24:35 2011
@@ -54,8 +54,10 @@ import org.apache.tools.ant.util.VectorS
 
 public class FTPTaskMirrorImpl implements FTPTaskMirror {
 
-    /** return code of ftp - not implemented in commons-net version 1.0 */
+    /** return code of ftp */
     private static final int CODE_521 = 521;
+    private static final int CODE_550 = 550;
+    private static final int CODE_553 = 553;
 
     /** Date formatter used in logging, note not thread safe! */
     private static final SimpleDateFormat TIMESTAMP_LOGGING_SDF =
@@ -1775,8 +1777,9 @@ public class FTPTaskMirrorImpl implement
                     //  to indicate that an attempt to create a directory has
                     //  failed because the directory already exists.
                     int rc = ftp.getReplyCode();
-                    if (!(task.isIgnoreNoncriticalErrors() && (rc == FTPReply.CODE_550
-                                                               || rc == FTPReply.CODE_553
|| rc == CODE_521))) {
+                    if (!(task.isIgnoreNoncriticalErrors() && (rc == CODE_550
+                                                               || rc == CODE_553
+                                                               || rc == CODE_521))) {
                         throw new BuildException("could not create directory: "
                                                  + ftp.getReplyString());
                     }
@@ -1805,8 +1808,9 @@ public class FTPTaskMirrorImpl implement
     private void handleMkDirFailure(FTPClient ftp)
         throws BuildException {
         int rc = ftp.getReplyCode();
-        if (!(task.isIgnoreNoncriticalErrors() && (rc == FTPReply.CODE_550
-                                                   || rc == FTPReply.CODE_553 || rc == CODE_521)))
{
+        if (!(task.isIgnoreNoncriticalErrors() && (rc == CODE_550
+                                                   || rc == CODE_553
+                                                   || rc == CODE_521))) {
             throw new BuildException("could not create directory: "
                                      + ftp.getReplyString());
         }



Mime
View raw message