public class

FtpLiteConnector

extends Object
java.lang.Object
   ↳ com.mule.modules.ftplite.FtpLiteConnector
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

FTP Light connector. It takes credentials in all calls. Opens and closes a connection on each call to the server. If you need a persistent connection to an FTP server, you would be better served by using the FTP transport in Mule.

Summary

Constants
String DEFAULT_FOLDER_PATH The default folder name
String DEFAULT_PASSIVE_MODE_ENABLED The default value for the passive property in all connector operations
String STANDARD_FTP_PORT The default value for the port property in all connector operations
Public Constructors
FtpLiteConnector()
Public Methods
FTPFile getFile(String hostName, String userName, String password, String port, String filePath, String passive)
Get a single file's information.
InputStream getFileContent(String hostName, String userName, String password, String port, String filePath, String passive)
Get a single file's content as a stream
FTPFile[] getFolder(String hostName, String userName, String password, String port, String path, String passive)
Get all folder and files in a Path, it defaults to "/" when path is null
FTPFile uploadStream(String hostName, String userName, String password, String port, String filePath, String fileName, InputStream content, String passive)
Get a single file's content as a stream
[Expand]
Inherited Methods
From class java.lang.Object

Constants

private static final String DEFAULT_FOLDER_PATH

The default folder name

Constant Value: "/"

private static final String DEFAULT_PASSIVE_MODE_ENABLED

The default value for the passive property in all connector operations

Constant Value: "true"

private static final String STANDARD_FTP_PORT

The default value for the port property in all connector operations

Constant Value: "21"

Public Constructors

public FtpLiteConnector ()

Public Methods

public FTPFile getFile (String hostName, String userName, String password, String port, String filePath, String passive)

Get a single file's information. filePath must be the full file's path

Parameters
hostName The FTP host's name to connect to
userName The user name to use to login
password The password to use to login
port The port the FTP service is listening on
filePath The path to the folder to list
passive Use passive mode on the connection
Returns
  • an FTPFile entry with the file's information
Throws
FtpLiteException when there is IO error in the FTP connection

public InputStream getFileContent (String hostName, String userName, String password, String port, String filePath, String passive)

Get a single file's content as a stream

Parameters
hostName The FTP host's name to connect to
userName The user name to use to login
password The password to use to login
port The port the FTP service is listening on
filePath The path to the folder to list
passive Use passive mode on the connection
Returns
  • an FTPFile entry with the file's information
Throws
FtpLiteException when there is an error in the FTP connection

public FTPFile[] getFolder (String hostName, String userName, String password, String port, String path, String passive)

Get all folder and files in a Path, it defaults to "/" when path is null

Parameters
hostName The FTP host's name to connect to
userName The user name to use to login
password The password to use to login
port The port the FTP service is listening on
path The path to the folder to list
passive Use passive mode on the connection
Returns
  • an array of FTPFile's in the path specified
Throws
FtpLiteException when there is an error in the FTP connection

public FTPFile uploadStream (String hostName, String userName, String password, String port, String filePath, String fileName, InputStream content, String passive)

Get a single file's content as a stream

Parameters
hostName The FTP host's name to connect to
userName The user name to use to login
password The password to use to login
port The port the FTP service is listening on
filePath The path to the folder to store the file in
fileName The name of the file to store
content An InputStream with the content to store in the file
passive Use passive mode on the connection
Returns
  • an FTPFile entry with the file's information
Throws
FtpLiteException when there is an error in the FTP connection