public class FTPUploader extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
UPLOAD_DIR |
static String |
UPLOAD_DIR_FAILURE |
static String |
UPLOAD_DIR_FINISH |
static String |
UPLOAD_DIR_START |
static String |
UPLOAD_FAILURE |
static String |
UPLOAD_FILE |
static String |
UPLOAD_FILE_REPLY |
static String |
UPLOAD_RETRY_FAILURE |
static String |
UPLOAD_START |
static String |
UPLOAD_SUCCESS |
| Constructor and Description |
|---|
FTPUploader() |
| Modifier and Type | Method and Description |
|---|---|
protected org.apache.commons.net.ftp.FTPClient |
getFTPClient(String ftpServer,
String username,
String password) |
private boolean |
isCommandFailed(int replyCode) |
protected void |
uploadDirectory(org.apache.commons.net.ftp.FTPClient ftpClient,
String sourceDirectoryPath,
String targetDirectoryPath,
String logPrefix)
Recursively upload a directory to FTP server with the provided FTP client object.
|
protected boolean |
uploadDirectory(String ftpServer,
String username,
String password,
String sourceDirectoryPath,
String targetDirectoryPath)
Upload directory to specified FTP server without retries.
|
void |
uploadDirectoryWithRetries(String ftpServer,
String username,
String password,
String sourceDirectory,
String targetDirectory,
int maxRetryCount)
Upload directory to specified FTP server with retries.
|
protected void |
uploadFile(org.apache.commons.net.ftp.FTPClient ftpClient,
String sourceFilePath,
String targetFilePath,
String logPrefix)
Upload a single file to FTP server with the provided FTP client object.
|
public static final String UPLOAD_START
public static final String UPLOAD_SUCCESS
public static final String UPLOAD_FAILURE
public static final String UPLOAD_RETRY_FAILURE
public static final String UPLOAD_DIR_START
public static final String UPLOAD_DIR_FINISH
public static final String UPLOAD_DIR_FAILURE
public static final String UPLOAD_DIR
public static final String UPLOAD_FILE
public static final String UPLOAD_FILE_REPLY
public void uploadDirectoryWithRetries(String ftpServer, String username, String password, String sourceDirectory, String targetDirectory, int maxRetryCount) throws AzureExecutionException
ftpServer - username - password - sourceDirectory - targetDirectory - maxRetryCount - AzureExecutionExceptionprotected boolean uploadDirectory(String ftpServer, String username, String password, String sourceDirectoryPath, String targetDirectoryPath)
ftpServer - username - password - sourceDirectoryPath - targetDirectoryPath - protected void uploadDirectory(org.apache.commons.net.ftp.FTPClient ftpClient,
String sourceDirectoryPath,
String targetDirectoryPath,
String logPrefix)
throws IOException
sourceDirectoryPath - targetDirectoryPath - logPrefix - IOExceptionprotected void uploadFile(org.apache.commons.net.ftp.FTPClient ftpClient,
String sourceFilePath,
String targetFilePath,
String logPrefix)
throws IOException
sourceFilePath - targetFilePath - logPrefix - IOExceptionprotected org.apache.commons.net.ftp.FTPClient getFTPClient(String ftpServer, String username, String password) throws IOException
IOExceptionprivate boolean isCommandFailed(int replyCode)
Copyright © 2020. All rights reserved.