Class FTPTransfer
java.lang.Object
org.apache.nifi.processors.standard.util.FTPTransfer
- All Implemented Interfaces:
Closeable,AutoCloseable,FileTransfer
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.apache.nifi.components.PropertyDescriptorprivate org.apache.commons.net.ftp.FTPClientprivate booleanstatic final org.apache.nifi.components.PropertyDescriptorstatic final Stringstatic final Stringprivate final org.apache.nifi.processor.ProcessContextprivate static final FTPClientProviderstatic final Stringprivate Stringprivate final org.apache.nifi.logging.ComponentLogprivate static final Patternprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringstatic final org.apache.nifi.components.PropertyDescriptorstatic final org.apache.nifi.components.PropertyDescriptorprivate static final ProxySpec[]private Stringprivate Stringprivate Stringprivate Stringprivate static final intstatic final org.apache.nifi.components.PropertyDescriptorstatic final Stringstatic final Stringstatic final org.apache.nifi.components.PropertyDescriptorFields inherited from interface org.apache.nifi.processor.util.file.transfer.FileTransfer
BATCH_SIZE, CONFLICT_RESOLUTION, CONFLICT_RESOLUTION_ALLOWABLE_VALUES, CONFLICT_RESOLUTION_FAIL, CONFLICT_RESOLUTION_FAIL_ALLOWABLE, CONFLICT_RESOLUTION_IGNORE, CONFLICT_RESOLUTION_IGNORE_ALLOWABLE, CONFLICT_RESOLUTION_NONE, CONFLICT_RESOLUTION_NONE_ALLOWABLE, CONFLICT_RESOLUTION_REJECT, CONFLICT_RESOLUTION_REJECT_ALLOWABLE, CONFLICT_RESOLUTION_RENAME, CONFLICT_RESOLUTION_RENAME_ALLOWABLE, CONFLICT_RESOLUTION_REPLACE, CONFLICT_RESOLUTION_REPLACE_ALLOWABLE, CONNECTION_TIMEOUT, CREATE_DIRECTORY, DATA_TIMEOUT, DELETE_ORIGINAL, DOT_RENAME, FILE_FILTER_REGEX, FILE_MODIFY_DATE_ATTR_FORMAT, FOLLOW_SYMLINK, HOSTNAME, IGNORE_DOTTED_FILES, LAST_MODIFIED_TIME, MAX_SELECTS, PASSWORD, PATH_FILTER_REGEX, PERMISSIONS, POLLING_INTERVAL, RECURSIVE_SEARCH, REJECT_ZERO_BYTE, REMOTE_GROUP, REMOTE_OWNER, REMOTE_PATH, REMOTE_POLL_BATCH_SIZE, TEMP_FILENAME, USE_COMPRESSION, USE_NATURAL_ORDERING, USERNAME -
Constructor Summary
ConstructorsConstructorDescriptionFTPTransfer(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.logging.ComponentLog logger) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected org.apache.commons.net.ftp.FTPClientcreateClient(org.apache.nifi.context.PropertyContext context, Map<String, String> attributes) voiddeleteDirectory(org.apache.nifi.flowfile.FlowFile flowFile, String remoteDirectoryName) voiddeleteFile(org.apache.nifi.flowfile.FlowFile flowFile, String path, String remoteFileName) voidensureDirectoryExists(org.apache.nifi.flowfile.FlowFile flowFile, File directoryName) private org.apache.commons.net.ftp.FTPClientgetClient(org.apache.nifi.flowfile.FlowFile flowFile) getHomeDirectory(org.apache.nifi.flowfile.FlowFile flowFile) getListing(boolean applyFilters) getListing(String path, int depth, int maxResults, boolean applyFilters) org.apache.nifi.flowfile.FlowFilegetRemoteFile(String remoteFileName, org.apache.nifi.flowfile.FlowFile origFlowFile, org.apache.nifi.processor.ProcessSession session) getRemoteFileInfo(org.apache.nifi.flowfile.FlowFile flowFile, String path, String remoteFileName) booleanisClosed()static voidprivate FileInfonewFileInfo(org.apache.commons.net.ftp.FTPFile file, String path) protected intnumberPermissions(String perms) put(org.apache.nifi.flowfile.FlowFile flowFile, String path, String filename, InputStream content) voidprivate booleanvoidsendCommands(List<String> commands, org.apache.nifi.flowfile.FlowFile flowFile) private Stringprivate booleansetWorkingDirectory(String path) static voidvalidateProxySpec(org.apache.nifi.components.ValidationContext context, Collection<org.apache.nifi.components.ValidationResult> results) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.nifi.processor.util.file.transfer.FileTransfer
getAbsolutePath
-
Field Details
-
CONNECTION_MODE_ACTIVE
- See Also:
-
CONNECTION_MODE_PASSIVE
- See Also:
-
TRANSFER_MODE_ASCII
- See Also:
-
TRANSFER_MODE_BINARY
- See Also:
-
FTP_TIMEVAL_FORMAT
- See Also:
-
OBSOLETE_PROXY_TYPE
- See Also:
-
OBSOLETE_PROXY_HOST
- See Also:
-
OBSOLETE_PROXY_PORT
- See Also:
-
OBSOLETE_PROXY_USERNAME
- See Also:
-
OBSOLETE_PROXY_PASSWORD
- See Also:
-
CONNECTION_MODE
public static final org.apache.nifi.components.PropertyDescriptor CONNECTION_MODE -
TRANSFER_MODE
public static final org.apache.nifi.components.PropertyDescriptor TRANSFER_MODE -
PORT
public static final org.apache.nifi.components.PropertyDescriptor PORT -
BUFFER_SIZE
public static final org.apache.nifi.components.PropertyDescriptor BUFFER_SIZE -
UTF8_ENCODING
public static final org.apache.nifi.components.PropertyDescriptor UTF8_ENCODING -
REPLY_CODE_FILE_UNAVAILABLE
private static final int REPLY_CODE_FILE_UNAVAILABLE- See Also:
-
NOT_FOUND_MESSAGE_PATTERN
-
FTP_CLIENT_PROVIDER
-
PROXY_SPECS
-
PROXY_CONFIGURATION_SERVICE
public static final org.apache.nifi.components.PropertyDescriptor PROXY_CONFIGURATION_SERVICE -
logger
private final org.apache.nifi.logging.ComponentLog logger -
ctx
private final org.apache.nifi.processor.ProcessContext ctx -
closed
private boolean closed -
client
private org.apache.commons.net.ftp.FTPClient client -
homeDirectory
-
remoteHostName
-
remotePort
-
remoteUsername
-
remotePassword
-
-
Constructor Details
-
FTPTransfer
public FTPTransfer(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.logging.ComponentLog logger)
-
-
Method Details
-
validateProxySpec
public static void validateProxySpec(org.apache.nifi.components.ValidationContext context, Collection<org.apache.nifi.components.ValidationResult> results) -
migrateProxyProperties
-
getProtocolName
- Specified by:
getProtocolNamein interfaceFileTransfer
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
getHomeDirectory
- Specified by:
getHomeDirectoryin interfaceFileTransfer- Throws:
IOException
-
getListing
- Specified by:
getListingin interfaceFileTransfer- Throws:
IOException
-
getListing
private List<FileInfo> getListing(String path, int depth, int maxResults, boolean applyFilters) throws IOException - Throws:
IOException
-
newFileInfo
-
getRemoteFile
public org.apache.nifi.flowfile.FlowFile getRemoteFile(String remoteFileName, org.apache.nifi.flowfile.FlowFile origFlowFile, org.apache.nifi.processor.ProcessSession session) throws org.apache.nifi.processor.exception.ProcessException, IOException - Specified by:
getRemoteFilein interfaceFileTransfer- Throws:
org.apache.nifi.processor.exception.ProcessExceptionIOException
-
getRemoteFileInfo
public FileInfo getRemoteFileInfo(org.apache.nifi.flowfile.FlowFile flowFile, String path, String remoteFileName) throws IOException - Specified by:
getRemoteFileInfoin interfaceFileTransfer- Throws:
IOException
-
ensureDirectoryExists
public void ensureDirectoryExists(org.apache.nifi.flowfile.FlowFile flowFile, File directoryName) throws IOException - Specified by:
ensureDirectoryExistsin interfaceFileTransfer- Throws:
IOException
-
setAndGetWorkingDirectory
- Throws:
IOException
-
setWorkingDirectory
- Throws:
IOException
-
resetWorkingDirectory
- Throws:
IOException
-
put
public String put(org.apache.nifi.flowfile.FlowFile flowFile, String path, String filename, InputStream content) throws IOException - Specified by:
putin interfaceFileTransfer- Throws:
IOException
-
rename
public void rename(org.apache.nifi.flowfile.FlowFile flowFile, String source, String target) throws IOException - Specified by:
renamein interfaceFileTransfer- Throws:
IOException
-
deleteFile
public void deleteFile(org.apache.nifi.flowfile.FlowFile flowFile, String path, String remoteFileName) throws IOException - Specified by:
deleteFilein interfaceFileTransfer- Throws:
IOException
-
deleteDirectory
public void deleteDirectory(org.apache.nifi.flowfile.FlowFile flowFile, String remoteDirectoryName) throws IOException - Specified by:
deleteDirectoryin interfaceFileTransfer- Throws:
IOException
-
isClosed
public boolean isClosed()- Specified by:
isClosedin interfaceFileTransfer
-
sendCommands
public void sendCommands(List<String> commands, org.apache.nifi.flowfile.FlowFile flowFile) throws IOException - Throws:
IOException
-
createClient
-
getClient
private org.apache.commons.net.ftp.FTPClient getClient(org.apache.nifi.flowfile.FlowFile flowFile) throws IOException - Throws:
IOException
-
numberPermissions
-