git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@1092610 13f79535-47bb-0310-9956-ffa450edef68master
@@ -88,8 +88,10 @@ public class FTP extends Task implements FTPTaskConfig { | |||||
protected static final int CHMOD = 5; | protected static final int CHMOD = 5; | ||||
protected static final int RM_DIR = 6; | protected static final int RM_DIR = 6; | ||||
protected static final int SITE_CMD = 7; | 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_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 | /** adjust uptodate calculations where server timestamps are HH:mm and client's | ||||
* are HH:mm:ss */ | * are HH:mm:ss */ | ||||
@@ -2375,7 +2377,7 @@ public class FTP extends Task implements FTPTaskConfig { | |||||
// failed because the directory already exists. | // failed because the directory already exists. | ||||
int rc = ftp.getReplyCode(); | int rc = ftp.getReplyCode(); | ||||
if (!(ignoreNoncriticalErrors | if (!(ignoreNoncriticalErrors | ||||
&& (rc == FTPReply.CODE_550 || rc == FTPReply.CODE_553 | |||||
&& (rc == CODE_550 || rc == CODE_553 | |||||
|| rc == CODE_521))) { | || rc == CODE_521))) { | ||||
throw new BuildException("could not create directory: " | throw new BuildException("could not create directory: " | ||||
+ ftp.getReplyString()); | + ftp.getReplyString()); | ||||
@@ -2406,7 +2408,7 @@ public class FTP extends Task implements FTPTaskConfig { | |||||
throws BuildException { | throws BuildException { | ||||
int rc = ftp.getReplyCode(); | int rc = ftp.getReplyCode(); | ||||
if (!(ignoreNoncriticalErrors | 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: " | throw new BuildException("could not create directory: " | ||||
+ ftp.getReplyString()); | + ftp.getReplyString()); | ||||
} | } | ||||
@@ -54,8 +54,10 @@ import org.apache.tools.ant.util.VectorSet; | |||||
public class FTPTaskMirrorImpl implements FTPTaskMirror { | 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_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! */ | /** Date formatter used in logging, note not thread safe! */ | ||||
private static final SimpleDateFormat TIMESTAMP_LOGGING_SDF = | 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 | // to indicate that an attempt to create a directory has | ||||
// failed because the directory already exists. | // failed because the directory already exists. | ||||
int rc = ftp.getReplyCode(); | 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: " | throw new BuildException("could not create directory: " | ||||
+ ftp.getReplyString()); | + ftp.getReplyString()); | ||||
} | } | ||||
@@ -1805,8 +1808,9 @@ public class FTPTaskMirrorImpl implements FTPTaskMirror { | |||||
private void handleMkDirFailure(FTPClient ftp) | private void handleMkDirFailure(FTPClient ftp) | ||||
throws BuildException { | throws BuildException { | ||||
int rc = ftp.getReplyCode(); | 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: " | throw new BuildException("could not create directory: " | ||||
+ ftp.getReplyString()); | + ftp.getReplyString()); | ||||
} | } | ||||