public abstract class SftpCommand extends FtpCommand<SftpFileSystem>
FtpCommand implementations that target a SFTP server| Modifier and Type | Field and Description |
|---|---|
protected SftpClient |
client |
| Constructor and Description |
|---|
SftpCommand(SftpFileSystem fileSystem,
SftpClient client)
Creates a new instance
|
| Modifier and Type | Method and Description |
|---|---|
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). |
protected String |
getCurrentWorkingDirectory() |
protected FtpFileAttributes |
getFile(String filePath,
boolean requireExistence) |
protected boolean |
tryChangeWorkingDirectory(String path)
Attempts to change the current working directory.
|
changeWorkingDirectory, changeWorkingDirectory, copy, createDirectory, exists, getBasePath, getExistingFile, getFile, renameprotected SftpClient client
public SftpCommand(SftpFileSystem fileSystem, SftpClient client)
fileSystem - a SftpFileSystem used as the connection objectclient - a SftpClientprotected FtpFileAttributes getFile(String filePath, boolean requireExistence)
getFile in class FtpCommand<SftpFileSystem>protected void doMkDirs(Path directoryPath)
directoryPath also creating any missing parent directoriesdoMkDirs in class org.mule.extension.file.common.api.command.FileCommand<SftpFileSystem>directoryPath - the Path to the directory you want to createprotected boolean tryChangeWorkingDirectory(String path)
falsetryChangeWorkingDirectory in class FtpCommand<SftpFileSystem>path - the path to which you wish to movetrue if the CWD was changed. false otherwiseprotected 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<SftpFileSystem>filePath - the path of the file to be renamednewName - the new nameException - if anything goes wrongprotected String getCurrentWorkingDirectory()
getCurrentWorkingDirectory in class FtpCommand<SftpFileSystem>Copyright © 2003–2017 MuleSoft, Inc.. All rights reserved.