Browse Source

commons-net trunk has removed all static final ints from FTPReply

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@1092610 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 14 years ago
parent
commit
d2693fcfed
2 changed files with 14 additions and 8 deletions
  1. +5
    -3
      src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java
  2. +9
    -5
      src/main/org/apache/tools/ant/taskdefs/optional/net/FTPTaskMirrorImpl.java

+ 5
- 3
src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java View File

@@ -88,8 +88,10 @@ public class FTP extends Task implements FTPTaskConfig {
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 FTPTaskConfig {
// 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 FTPTaskConfig {
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());
}


+ 9
- 5
src/main/org/apache/tools/ant/taskdefs/optional/net/FTPTaskMirrorImpl.java View File

@@ -54,8 +54,10 @@ import org.apache.tools.ant.util.VectorSet;

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 implements FTPTaskMirror {
// 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 implements FTPTaskMirror {
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());
}


Loading…
Cancel
Save