|
|
@@ -180,8 +180,12 @@ public class FTP |
|
|
* followSymlinks defaults to false |
|
|
* followSymlinks defaults to false |
|
|
*/ |
|
|
*/ |
|
|
protected class FTPDirectoryScanner extends DirectoryScanner { |
|
|
protected class FTPDirectoryScanner extends DirectoryScanner { |
|
|
|
|
|
// CheckStyle:VisibilityModifier OFF - bc |
|
|
protected FTPClient ftp = null; |
|
|
protected FTPClient ftp = null; |
|
|
|
|
|
// CheckStyle:VisibilityModifier ON |
|
|
|
|
|
|
|
|
private String rootPath = null; |
|
|
private String rootPath = null; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* since ant 1.6 |
|
|
* since ant 1.6 |
|
|
* this flag should be set to true on UNIX and can save scanning time |
|
|
* this flag should be set to true on UNIX and can save scanning time |
|
|
@@ -542,8 +546,7 @@ public class FTP |
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void forceRemoteSensitivityCheck() |
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
private void forceRemoteSensitivityCheck() { |
|
|
if (!remoteSensitivityChecked) { |
|
|
if (!remoteSensitivityChecked) { |
|
|
try { |
|
|
try { |
|
|
checkRemoteSensitivity(ftp.listFiles(), ftp.printWorkingDirectory()); |
|
|
checkRemoteSensitivity(ftp.listFiles(), ftp.printWorkingDirectory()); |
|
|
@@ -813,7 +816,9 @@ public class FTP |
|
|
// hit a hidden file assume not a symlink |
|
|
// hit a hidden file assume not a symlink |
|
|
relPath = relPath + currentElement; |
|
|
relPath = relPath + currentElement; |
|
|
currentPath = currentPath + remoteFileSep + currentElement; |
|
|
currentPath = currentPath + remoteFileSep + currentElement; |
|
|
log("Hidden file " + relPath + " assumed to not be a symlink.", Project.MSG_VERBOSE); |
|
|
|
|
|
|
|
|
log("Hidden file " + relPath |
|
|
|
|
|
+ " assumed to not be a symlink.", |
|
|
|
|
|
Project.MSG_VERBOSE); |
|
|
} else { |
|
|
} else { |
|
|
traversesSymlinks = traversesSymlinks || theFile.isSymbolicLink(); |
|
|
traversesSymlinks = traversesSymlinks || theFile.isSymbolicLink(); |
|
|
relPath = relPath + theFile.getName(); |
|
|
relPath = relPath + theFile.getName(); |
|
|
@@ -900,6 +905,10 @@ public class FTP |
|
|
return traversesSymlinks; |
|
|
return traversesSymlinks; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Get a string rep of this object. |
|
|
|
|
|
* @return a string containing the pwd and the file. |
|
|
|
|
|
*/ |
|
|
public String toString() { |
|
|
public String toString() { |
|
|
return "AntFtpFile: " + curpwd + "%" + ftpFile; |
|
|
return "AntFtpFile: " + curpwd + "%" + ftpFile; |
|
|
} |
|
|
} |
|
|
@@ -1297,8 +1306,7 @@ public class FTP |
|
|
* @see org.apache.commons.net.ftp.FTPClientConfig |
|
|
* @see org.apache.commons.net.ftp.FTPClientConfig |
|
|
*/ |
|
|
*/ |
|
|
public void setSystemTypeKey(FTPSystemType systemKey) { |
|
|
public void setSystemTypeKey(FTPSystemType systemKey) { |
|
|
if (systemKey != null && !systemKey.getValue().equals("")) |
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
if (systemKey != null && !systemKey.getValue().equals("")) { |
|
|
this.systemTypeKey = systemKey; |
|
|
this.systemTypeKey = systemKey; |
|
|
configurationHasBeenSet(); |
|
|
configurationHasBeenSet(); |
|
|
} |
|
|
} |
|
|
@@ -1311,8 +1319,7 @@ public class FTP |
|
|
* @see org.apache.commons.net.ftp.FTPClientConfig |
|
|
* @see org.apache.commons.net.ftp.FTPClientConfig |
|
|
*/ |
|
|
*/ |
|
|
public void setDefaultDateFormatConfig(String defaultDateFormat) { |
|
|
public void setDefaultDateFormatConfig(String defaultDateFormat) { |
|
|
if (defaultDateFormat != null && !defaultDateFormat.equals("")) |
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
if (defaultDateFormat != null && !defaultDateFormat.equals("")) { |
|
|
this.defaultDateFormatConfig = defaultDateFormat; |
|
|
this.defaultDateFormatConfig = defaultDateFormat; |
|
|
configurationHasBeenSet(); |
|
|
configurationHasBeenSet(); |
|
|
} |
|
|
} |
|
|
@@ -1325,8 +1332,7 @@ public class FTP |
|
|
* @see org.apache.commons.net.ftp.FTPClientConfig |
|
|
* @see org.apache.commons.net.ftp.FTPClientConfig |
|
|
*/ |
|
|
*/ |
|
|
public void setRecentDateFormatConfig(String recentDateFormat) { |
|
|
public void setRecentDateFormatConfig(String recentDateFormat) { |
|
|
if (recentDateFormat != null && !recentDateFormat.equals("")) |
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
if (recentDateFormat != null && !recentDateFormat.equals("")) { |
|
|
this.recentDateFormatConfig = recentDateFormat; |
|
|
this.recentDateFormatConfig = recentDateFormat; |
|
|
configurationHasBeenSet(); |
|
|
configurationHasBeenSet(); |
|
|
} |
|
|
} |
|
|
@@ -1339,8 +1345,7 @@ public class FTP |
|
|
* @see org.apache.commons.net.ftp.FTPClientConfig |
|
|
* @see org.apache.commons.net.ftp.FTPClientConfig |
|
|
*/ |
|
|
*/ |
|
|
public void setServerLanguageCodeConfig(LanguageCode serverLanguageCode) { |
|
|
public void setServerLanguageCodeConfig(LanguageCode serverLanguageCode) { |
|
|
if (serverLanguageCode != null && !serverLanguageCode.equals("")) |
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
if (serverLanguageCode != null && !serverLanguageCode.equals("")) { |
|
|
this.serverLanguageCodeConfig = serverLanguageCode; |
|
|
this.serverLanguageCodeConfig = serverLanguageCode; |
|
|
configurationHasBeenSet(); |
|
|
configurationHasBeenSet(); |
|
|
} |
|
|
} |
|
|
@@ -1353,8 +1358,7 @@ public class FTP |
|
|
* @see org.apache.commons.net.ftp.FTPClientConfig |
|
|
* @see org.apache.commons.net.ftp.FTPClientConfig |
|
|
*/ |
|
|
*/ |
|
|
public void setServerTimeZoneConfig(String serverTimeZoneId) { |
|
|
public void setServerTimeZoneConfig(String serverTimeZoneId) { |
|
|
if (serverTimeZoneId != null && !serverTimeZoneId.equals("")) |
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
if (serverTimeZoneId != null && !serverTimeZoneId.equals("")) { |
|
|
this.serverTimeZoneConfig = serverTimeZoneId; |
|
|
this.serverTimeZoneConfig = serverTimeZoneId; |
|
|
configurationHasBeenSet(); |
|
|
configurationHasBeenSet(); |
|
|
} |
|
|
} |
|
|
@@ -1368,8 +1372,7 @@ public class FTP |
|
|
* @see org.apache.commons.net.ftp.FTPClientConfig |
|
|
* @see org.apache.commons.net.ftp.FTPClientConfig |
|
|
*/ |
|
|
*/ |
|
|
public void setShortMonthNamesConfig(String shortMonthNames) { |
|
|
public void setShortMonthNamesConfig(String shortMonthNames) { |
|
|
if (shortMonthNames != null && !shortMonthNames.equals("")) |
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
if (shortMonthNames != null && !shortMonthNames.equals("")) { |
|
|
this.shortMonthNamesConfig = shortMonthNames; |
|
|
this.shortMonthNamesConfig = shortMonthNames; |
|
|
configurationHasBeenSet(); |
|
|
configurationHasBeenSet(); |
|
|
} |
|
|
} |
|
|
@@ -1518,14 +1521,14 @@ public class FTP |
|
|
Class.forName("org.apache.commons.net.ftp.FTPClientConfig"); |
|
|
Class.forName("org.apache.commons.net.ftp.FTPClientConfig"); |
|
|
} catch (ClassNotFoundException e) { |
|
|
} catch (ClassNotFoundException e) { |
|
|
throw new BuildException( |
|
|
throw new BuildException( |
|
|
"commons-net.jar >= 1.4.0 is required for at least one of the attributes specified."); |
|
|
|
|
|
|
|
|
"commons-net.jar >= 1.4.0 is required for at least one" |
|
|
|
|
|
+ " of the attributes specified."); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
protected void executeRetryable(RetryHandler h, Retryable r, String descr) |
|
|
protected void executeRetryable(RetryHandler h, Retryable r, String descr) |
|
|
throws IOException |
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
throws IOException { |
|
|
h.execute(r, descr); |
|
|
h.execute(r, descr); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@@ -1626,7 +1629,8 @@ public class FTP |
|
|
listFile(ftp, fbw, dsfile); |
|
|
listFile(ftp, fbw, dsfile); |
|
|
break; |
|
|
break; |
|
|
case CHMOD: |
|
|
case CHMOD: |
|
|
doSiteCommand(ftp, "chmod " + chmod + " " + resolveFile(dsfile)); |
|
|
|
|
|
|
|
|
doSiteCommand(ftp, "chmod " + chmod |
|
|
|
|
|
+ " " + resolveFile(dsfile)); |
|
|
transferred++; |
|
|
transferred++; |
|
|
break; |
|
|
break; |
|
|
default: |
|
|
default: |
|
|
@@ -2448,7 +2452,9 @@ public class FTP |
|
|
private static final String[] VALID_GRANULARITIES = { |
|
|
private static final String[] VALID_GRANULARITIES = { |
|
|
"", "MINUTE", "NONE" |
|
|
"", "MINUTE", "NONE" |
|
|
}; |
|
|
}; |
|
|
/* |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Get the valid values. |
|
|
* @return the list of valid Granularity values |
|
|
* @return the list of valid Granularity values |
|
|
*/ |
|
|
*/ |
|
|
public String[] getValues() { |
|
|
public String[] getValues() { |
|
|
@@ -2494,7 +2500,8 @@ public class FTP |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Get the valid values. |
|
|
* @return the list of valid system types. |
|
|
* @return the list of valid system types. |
|
|
*/ |
|
|
*/ |
|
|
public String[] getValues() { |
|
|
public String[] getValues() { |
|
|
@@ -2507,6 +2514,9 @@ public class FTP |
|
|
return ftpst; |
|
|
return ftpst; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
/** |
|
|
|
|
|
* Enumerated class for languages. |
|
|
|
|
|
*/ |
|
|
public static class LanguageCode extends EnumeratedAttribute { |
|
|
public static class LanguageCode extends EnumeratedAttribute { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -2525,8 +2535,9 @@ public class FTP |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
|
* @return the list of valid system types. |
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Return the value values. |
|
|
|
|
|
* @return the list of valid language types. |
|
|
*/ |
|
|
*/ |
|
|
public String[] getValues() { |
|
|
public String[] getValues() { |
|
|
return VALID_LANGUAGE_CODES; |
|
|
return VALID_LANGUAGE_CODES; |
|
|
|