diff --git a/docs/manual/OptionalTasks/ftp.html b/docs/manual/OptionalTasks/ftp.html index 1a4aac96c..da8aa42e6 100644 --- a/docs/manual/OptionalTasks/ftp.html +++ b/docs/manual/OptionalTasks/ftp.html @@ -187,18 +187,33 @@ coming from your ftp server (ls -l on the ftp prompt).

If none of these is specified, the default mechanism of letting the system auto-detect the server OS type based on the FTP SYST command and assuming - standard formatting for that OS type will be used.

- + standard formatting for that OS type will be used. +

+ To aid in property-file-based development where a build script is configured + with property files, for any of these attributes, a value of "" + is equivalent to not specifying it. +

+ Please understand that these options are incompatible with the autodetection + scheme. If any of these options is specified, (other than with a value of + "" ) a system type must be chosen and if systemTypeKey is not + specified, UNIX will be assumed. The philosophy behind this is that these + options are for setting non-standard formats, and a build-script author who + knows what system he is dealing with will know what options to need to be + set. Otherwise, these options should be left alone and the default + autodetection scheme can be used and will work in the majority of cases. +

systemTypeKey Specifies the type of system in use on the server. - Supported values are "UNIX", "VMS", "WINDOWS", "OS/2", "OS/400", "MVS". - If not specified, and no other xxxConfig attributes are specified, the - autodectection mechanism based on the FTP SYST command will be used. + Supported values are "UNIX", "VMS", "WINDOWS", "OS/2", "OS/400", + "MVS". If not specified, (or specified as "") and if + no other xxxConfig attributes are specified, the autodectection mechanism + based on the FTP SYST command will be used. No, but if any of the following xxxConfig - attributes is specified, UNIX will be assumed. + attributes is specified, UNIX will be assumed, even if "" + is specified here. @@ -208,7 +223,8 @@ coming from your ftp server (ls -l on the ftp prompt). Asia/Jakarta) the timezone used by the server for timestamps. This enables Ant timestamp dependency checking even when the server is in a different timezone than the client. - If not specified, the timezone of the client is assumed. + If not specified, (or specified as ""), the timezone of the + client is assumed. No @@ -219,8 +235,8 @@ coming from your ftp server (ls -l on the ftp prompt). to parse dates. In some cases this will be the only date format used. In others, (unix for example) this will be used for dates older than a year old. (See recentDateFormatConfig). If not specified, - the default date format for the system type indicated by the - systemTypeKey attribute will be used. + (or specified as ""), the default date format for the system + type indicated by the systemTypeKey attribute will be used. No. @@ -230,9 +246,9 @@ coming from your ftp server (ls -l on the ftp prompt). recentDateFormatConfig Specify in java.text.SimpleDateFormat notation, (e.g. MMM dd hh:mm) the date format used by the FTP server - to parse dates less than a year old. If not specified, and if the system - type indicated by the system key uses a recent date format, its standard - format will be used. + to parse dates less than a year old. If not specified (or specified as + ""), and if the system type indicated by the system key uses + a recent date format, its standard format will be used. No diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java b/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java index 2412021ce..30c4103ff 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java @@ -1257,67 +1257,96 @@ public class FTP /** * Method for setting FTPClientConfig remote system key. * - * @param systemTypeKey + * @param systemTypeKey the key to be set - BUT if blank + * the default value of null will be kept. * @see org.apache.commons.net.ftp.FTPClientConfig */ public void setSystemTypeKey(String systemKey) { - this.systemTypeKey = systemKey; - configurationHasBeenSet(); + if (systemKey != null && !systemKey.equals("")) + { + this.systemTypeKey = systemKey; + configurationHasBeenSet(); + } } /** - * Delegate method for FTPClientConfig.setDefaultDateFormatStr(String). + * Delegate method for + * FTPClientConfig.setDefaultDateFormatStr(String). * - * @param defaultDateFormatConfig + * @param defaultDateFormatConfig configuration to be set, unless it is + * null or empty string, in which case ignored. * @see org.apache.commons.net.ftp.FTPClientConfig */ public void setDefaultDateFormatConfig(String defaultDateFormat) { - this.defaultDateFormatConfig = defaultDateFormat; - configurationHasBeenSet(); + if (defaultDateFormat != null && !defaultDateFormat.equals("")) + { + this.defaultDateFormatConfig = defaultDateFormat; + configurationHasBeenSet(); + } } /** - * Delegate method for FTPClientConfig.setRecentDateFormatStr(String). + * Delegate method for + * FTPClientConfig.setRecentDateFormatStr(String). * - * @param recentDateFormatConfig + * @param recentDateFormatConfig configuration to be set, unless it is + * null or empty string, in which case ignored. * @see org.apache.commons.net.ftp.FTPClientConfig */ public void setRecentDateFormatConfig(String recentDateFormat) { - this.recentDateFormatConfig = recentDateFormat; - configurationHasBeenSet(); + if (recentDateFormat != null && !recentDateFormat.equals("")) + { + this.recentDateFormatConfig = recentDateFormat; + configurationHasBeenSet(); + } } /** - * Delegate method for FTPClientConfig.setServerLanguageCode(String). + * Delegate method for + * FTPClientConfig.setServerLanguageCode(String). * - * @param serverLanguageCodeConfig + * @param serverLanguageCodeConfig configuration to be set, unless it is + * null or empty string, in which case ignored. * @see org.apache.commons.net.ftp.FTPClientConfig */ public void setServerLanguageCodeConfig(String serverLanguageCode) { - this.serverLanguageCodeConfig = serverLanguageCode; - configurationHasBeenSet(); + if (serverLanguageCode != null && !serverLanguageCode.equals("")) + { + this.serverLanguageCodeConfig = serverLanguageCode; + configurationHasBeenSet(); + } } /** - * Delegate method for FTPClientConfig.setServerTimeZoneId(String). + * Delegate method for + * FTPClientConfig.setServerTimeZoneId(String). * - * @param serverTimeZoneConfig + * @param serverTimeZoneConfig configuration to be set, unless it is + * null or empty string, in which case ignored. * @see org.apache.commons.net.ftp.FTPClientConfig */ public void setServerTimeZoneConfig(String serverTimeZoneId) { - this.serverTimeZoneConfig = serverTimeZoneId; - configurationHasBeenSet(); + if (serverTimeZoneId != null && !serverTimeZoneId.equals("")) + { + this.serverTimeZoneConfig = serverTimeZoneId; + configurationHasBeenSet(); + } } /** - * Delegate method for FTPClientConfig.setShortMonthNames(String). + * Delegate method for + * FTPClientConfig.setShortMonthNames(String). * - * @param shortMonthNamesConfig + * @param shortMonthNamesConfig configuration to be set, unless it is + * null or empty string, in which case ignored. * @see org.apache.commons.net.ftp.FTPClientConfig */ public void setShortMonthNamesConfig(String shortMonthNames) { - this.shortMonthNamesConfig = shortMonthNames; - configurationHasBeenSet(); + if (shortMonthNames != null && !shortMonthNames.equals("")) + { + this.shortMonthNamesConfig = shortMonthNames; + configurationHasBeenSet(); + } }