public class FTPUtils extends Object
Modifier and Type | Class and Description |
---|---|
static class |
FTPUtils.FTPCommandMonitor |
static class |
FTPUtils.FTPConfiguration |
Modifier and Type | Field and Description |
---|---|
static String |
ACTIVE_LOCAL_CONNECTION_MODE |
static String |
ASCII_TRANSFER_MODE |
static String |
BINARY_TRANSFER_MODE |
static String |
CONNECTION_MODE_KEY |
private static org.apache.commons.logging.Log |
logger |
static String |
NETWORK_DATA_TIMEOUT_KEY |
static String |
NETWORK_SOCKET_TIMEOUT_KEY |
static String |
PASSIVE_LOCAL_CONNECTION_MODE |
static String |
REMOTE_HOST_KEY |
static String |
REMOTE_PASSWORD_KEY |
static String |
REMOTE_PORT_KEY |
static String |
REMOTE_USER_KEY |
static String |
TRANSFER_MODE_KEY |
Constructor and Description |
---|
FTPUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
changeWorkingDirectory(org.apache.commons.net.ftp.FTPClient client,
String dirPath,
boolean createDirs,
Processor processor)
Handles the logic required to change to the given directory RELATIVE TO THE CURRENT DIRECTORY which can include creating new directories needed.
|
static org.apache.commons.net.ftp.FTPClient |
connect(FTPUtils.FTPConfiguration conf,
org.apache.commons.net.ProtocolCommandListener monitor)
Creates a new FTPClient connected to an FTP server.
|
private static final org.apache.commons.logging.Log logger
public static final String CONNECTION_MODE_KEY
public static final String ACTIVE_LOCAL_CONNECTION_MODE
public static final String PASSIVE_LOCAL_CONNECTION_MODE
public static final String TRANSFER_MODE_KEY
public static final String BINARY_TRANSFER_MODE
public static final String ASCII_TRANSFER_MODE
public static final String REMOTE_HOST_KEY
public static final String REMOTE_USER_KEY
public static final String REMOTE_PASSWORD_KEY
public static final String REMOTE_PORT_KEY
public static final String NETWORK_DATA_TIMEOUT_KEY
public static final String NETWORK_SOCKET_TIMEOUT_KEY
public static org.apache.commons.net.ftp.FTPClient connect(FTPUtils.FTPConfiguration conf, org.apache.commons.net.ProtocolCommandListener monitor) throws IOException
conf
- confmonitor
- if provided will be used to monitor FTP commands processed but may be nullNullPointerException
- if either argument is nullIllegalArgumentException
- if a required property is missingNumberFormatException
- if any argument that must be an int cannot be converted to intIOException
- if some problem occurs connecting to FTP serverpublic static void changeWorkingDirectory(org.apache.commons.net.ftp.FTPClient client, String dirPath, boolean createDirs, Processor processor) throws IOException
client
- - the ftp client with an already active connectiondirPath
- - the path to change or create directories tocreateDirs
- - if true will attempt to create any missing directoriesprocessor
- - used solely for targeting logging output.IOException
- if any access problem occursCopyright © 2020 Apache NiFi Project. All rights reserved.