// E.G. switching between a UNIX file system mode and
// a legacy file system.
if (task.getInitialSiteCommand() != null) {
RetryHandler h = new RetryHandler(task.getRetriesAllowed(), task);
final FTPClient lftp = ftp;
executeRetryable(h, new Retryable() {
public void execute() throws IOException {
doSiteCommand(lftp, task.getInitialSiteCommand());
}
}, "initial site command: " + task.getInitialSiteCommand());
}
// For a unix ftp server you can set the default mask for all files
// created.
if (task.getUmask() != null) {
RetryHandler h = new RetryHandler(task.getRetriesAllowed(), task);
final FTPClient lftp = ftp;
executeRetryable(h, new Retryable() {
public void execute() throws IOException {
doSiteCommand(lftp, "umask " + task.getUmask());
}
}, "umask " + task.getUmask());
}
// If the action is MK_DIR, then the specified remote
// directory is the directory to create.
if (task.getAction() == FTPTask.MK_DIR) {
RetryHandler h = new RetryHandler(task.getRetriesAllowed(), task);
final FTPClient lftp = ftp;
executeRetryable(h, new Retryable() {
public void execute() throws IOException {
makeRemoteDir(lftp, task.getRemotedir());
}
}, task.getRemotedir());
} else if (task.getAction() == FTPTask.SITE_CMD) {
RetryHandler h = new RetryHandler(task.getRetriesAllowed(), task);
final FTPClient lftp = ftp;
executeRetryable(h, new Retryable() {
public void execute() throws IOException {
doSiteCommand(lftp, task.getSiteCommand());
}
}, "Site Command: " + task.getSiteCommand());
} else {