public final class FtpCopyCommand extends FtpCommand<ClassicFtpFileSystem> implements org.mule.extension.file.common.api.command.CopyCommand
ClassicFtpCommand which implements the CopyCommand contract| Modifier and Type | Field and Description |
|---|---|
protected org.apache.commons.net.ftp.FTPClient |
client |
| Constructor and Description |
|---|
FtpCopyCommand(ClassicFtpFileSystem fileSystem,
org.apache.commons.net.ftp.FTPClient client) |
| Modifier and Type | Method and Description |
|---|---|
void |
copy(org.mule.extension.file.common.api.FileConnectorConfig config,
String sourcePath,
String targetPath,
boolean overwrite,
boolean createParentDirectories) |
protected void |
doMkDirs(Path directoryPath)
Creates the directory pointed by
directoryPath also creating any missing parent directories |
protected void |
doRename(String filePath,
String newName)
Template method which works in tandem with
FtpCommand.rename(String, String, boolean). |
RuntimeException |
exception(String message)
Same as the super method but adding the FTP rely code
|
RuntimeException |
exception(String message,
Exception cause)
Same as the super method but adding the FTP rely code
|
protected String |
getCurrentWorkingDirectory() |
protected FtpFileAttributes |
getFile(String filePath,
boolean requireExistence) |
protected void |
makeDirectory(String directoryName)
Creates the directory of the given
directoryName in the current working directory |
protected boolean |
tryChangeWorkingDirectory(String path)
Attempts to change the current working directory of the FTP
client. |
changeWorkingDirectory, changeWorkingDirectory, copy, createDirectory, exists, getBasePath, getExistingFile, getFile, renamepublic FtpCopyCommand(ClassicFtpFileSystem fileSystem, org.apache.commons.net.ftp.FTPClient client)
public void copy(org.mule.extension.file.common.api.FileConnectorConfig config,
String sourcePath,
String targetPath,
boolean overwrite,
boolean createParentDirectories)
copy in interface org.mule.extension.file.common.api.command.CopyCommandprotected FtpFileAttributes getFile(String filePath, boolean requireExistence)
getFile in class FtpCommand<ClassicFtpFileSystem>protected void doMkDirs(Path directoryPath)
directoryPath also creating any missing parent directoriesdoMkDirs in class org.mule.extension.file.common.api.command.FileCommand<ClassicFtpFileSystem>directoryPath - the Path to the directory you want to createprotected boolean tryChangeWorkingDirectory(String path)
client. If it was not possible (for example, because it
doesn't exists), it returns falsetryChangeWorkingDirectory in class FtpCommand<ClassicFtpFileSystem>path - the path to which you wish to movetrue if the CWD was changed. false otherwiseprotected void makeDirectory(String directoryName)
directoryName in the current working directorydirectoryName - the name of the directory you want to createprotected String getCurrentWorkingDirectory()
getCurrentWorkingDirectory in class FtpCommand<ClassicFtpFileSystem>client's working directoryprotected void doRename(String filePath, String newName) throws Exception
FtpCommand.rename(String, String, boolean).
Implementations are to perform the actual renaming logic here
doRename in class FtpCommand<ClassicFtpFileSystem>filePath - the path of the file to be renamednewName - the new nameException - if anything goes wrongpublic RuntimeException exception(String message)
exception in class org.mule.extension.file.common.api.command.FileCommand<ClassicFtpFileSystem>public RuntimeException exception(String message, Exception cause)
exception in class org.mule.extension.file.common.api.command.FileCommand<ClassicFtpFileSystem>Copyright © 2003–2017 MuleSoft, Inc.. All rights reserved.