public final class FtpReadCommand extends FtpCommand<ClassicFtpFileSystem> implements org.mule.extension.file.common.api.command.ReadCommand
ClassicFtpCommand which implements the FtpReadCommand| Modifier and Type | Field and Description |
|---|---|
protected org.apache.commons.net.ftp.FTPClient |
client |
| Constructor and Description |
|---|
FtpReadCommand(ClassicFtpFileSystem fileSystem,
org.apache.commons.net.ftp.FTPClient client) |
| 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). |
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 |
org.mule.runtime.extension.api.runtime.operation.Result<InputStream,org.mule.extension.file.common.api.FileAttributes> |
read(org.mule.extension.file.common.api.FileConnectorConfig config,
String filePath,
org.mule.runtime.api.metadata.MediaType mediaType,
boolean lock) |
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 FtpReadCommand(ClassicFtpFileSystem fileSystem, org.apache.commons.net.ftp.FTPClient client)
public org.mule.runtime.extension.api.runtime.operation.Result<InputStream,org.mule.extension.file.common.api.FileAttributes> read(org.mule.extension.file.common.api.FileConnectorConfig config, String filePath, org.mule.runtime.api.metadata.MediaType mediaType, boolean lock)
read in interface org.mule.extension.file.common.api.command.ReadCommandprotected 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.