@@ -22,9 +22,9 @@ import org.apache.tools.ant.Project;
/**
/**
* The sole purpose of this class is (note that it is package-private
* The sole purpose of this class is (note that it is package-private
* is to serve as a separate, static compilation unit for importing
* FTPClientConfig, to enable users who wish to use the FTP task
* without using its new features to avoid the need to
* is to serve as a separate, static compilation unit for importing
* FTPClientConfig, to enable users who wish to use the FTP task
* without using its new features to avoid the need to
* upgrade to jakarta-commons-net 1.4.0, where FTPClientConfig was
* upgrade to jakarta-commons-net 1.4.0, where FTPClientConfig was
* introduced.
* introduced.
*/
*/
@@ -40,53 +40,52 @@ class FTPConfigurator {
static FTPClient configure(FTPClient client, FTP task) {
static FTPClient configure(FTPClient client, FTP task) {
task.log("custom configuration", Project.MSG_VERBOSE);
task.log("custom configuration", Project.MSG_VERBOSE);
FTPClientConfig config;
FTPClientConfig config;
String systemTypeKey = task.getSystemTypeKey();
String systemTypeKey = task.getSystemTypeKey();
if (systemTypeKey != null && !"".equals(systemTypeKey)) {
if (systemTypeKey != null && !"".equals(systemTypeKey)) {
config = new FTPClientConfig(systemTypeKey);
config = new FTPClientConfig(systemTypeKey);
task.log("custom config: system key = "
task.log("custom config: system key = "
+ systemTypeKey, Project.MSG_VERBOSE);
+ systemTypeKey, Project.MSG_VERBOSE);
} else {
} else {
config = new FTPClientConfig();
config = new FTPClientConfig();
task.log("custom config: system key = default (UNIX)",
task.log("custom config: system key = default (UNIX)",
Project.MSG_VERBOSE);
Project.MSG_VERBOSE);
}
}
String defaultDateFormatConfig = task.getDefaultDateFormatConfig();
String defaultDateFormatConfig = task.getDefaultDateFormatConfig();
if (defaultDateFormatConfig != null) {
if (defaultDateFormatConfig != null) {
config.setDefaultDateFormatStr(defaultDateFormatConfig);
config.setDefaultDateFormatStr(defaultDateFormatConfig);
task.log("custom config: default date format = "
task.log("custom config: default date format = "
+ defaultDateFormatConfig, Project.MSG_VERBOSE);
+ defaultDateFormatConfig, Project.MSG_VERBOSE);
}
}
String recentDateFormatConfig = task.getRecentDateFormatConfig();
String recentDateFormatConfig = task.getRecentDateFormatConfig();
if (recentDateFormatConfig != null) {
if (recentDateFormatConfig != null) {
config.setRecentDateFormatStr(recentDateFormatConfig);
config.setRecentDateFormatStr(recentDateFormatConfig);
task.log("custom config: recent date format = "
task.log("custom config: recent date format = "
+ recentDateFormatConfig, Project.MSG_VERBOSE);
+ recentDateFormatConfig, Project.MSG_VERBOSE);
}
}
String serverLanguageCodeConfig = task.getServerLanguageCodeConfig();
String serverLanguageCodeConfig = task.getServerLanguageCodeConfig();
if (serverLanguageCodeConfig != null) {
if (serverLanguageCodeConfig != null) {
config.setServerLanguageCode(serverLanguageCodeConfig);
config.setServerLanguageCode(serverLanguageCodeConfig);
task.log("custom config: server language code = "
task.log("custom config: server language code = "
+ serverLanguageCodeConfig, Project.MSG_VERBOSE);
+ serverLanguageCodeConfig, Project.MSG_VERBOSE);
}
}
String serverTimeZoneConfig = task.getServerTimeZoneConfig();
String serverTimeZoneConfig = task.getServerTimeZoneConfig();
if (serverTimeZoneConfig != null) {
if (serverTimeZoneConfig != null) {
config.setServerTimeZoneId(serverTimeZoneConfig);
config.setServerTimeZoneId(serverTimeZoneConfig);
task.log("custom config: server time zone ID = "
task.log("custom config: server time zone ID = "
+ serverTimeZoneConfig, Project.MSG_VERBOSE);
+ serverTimeZoneConfig, Project.MSG_VERBOSE);
}
}
String shortMonthNamesConfig = task.getShortMonthNamesConfig();
String shortMonthNamesConfig = task.getShortMonthNamesConfig();
if (shortMonthNamesConfig != null) {
if (shortMonthNamesConfig != null) {
config.setShortMonthNames(shortMonthNamesConfig);
config.setShortMonthNames(shortMonthNamesConfig);
task.log("custom config: short month names = "
task.log("custom config: short month names = "
+ shortMonthNamesConfig, Project.MSG_VERBOSE);
+ shortMonthNamesConfig, Project.MSG_VERBOSE);
}
}
client.configure(config);
client.configure(config);
return client;
return client;
}
}
}
}