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