Package com.inet.ftp.taskplanner
Class FtpResultActionBuilder
java.lang.Object
com.inet.ftp.taskplanner.FtpResultActionBuilder
Use this to easily create
definitions
for a FtpResultAction
. This action saves
the results in a directory on the FTP Server.
Example usage:
TaskDefinition task = new TaskDefinition( "mytask" ); //Save generated files to a FTP server ResultActionDefinition definition = new FtpResultActionBuilder().setServerURL( "127.0.0.1" ).setServerPort( 21 ).setUserLogin( "user", "pwd" ).withDateAppending( true ).create(); task.addResulAction( definition ); // .. add jobs and triggers ... TaskPlanner.getInstance().addTask( task );
- Since:
- taskplanner 3.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.inet.taskplanner.server.api.action.ResultActionDefinition
create()
Creates the resultingResultActionDefinition
static FtpResultActionBuilder
Creating a new FTP connection.Sets the login for an anonymous user.setFileNameFormat
(String fileNameFormat) Defines the format of the file name.setServerPath
(String serverPath) Sets the path on the FTP server where to save the file.setServerPort
(int serverPort) Sets the connection port to the FTP server.setServerProtocol
(String securityType) Sets the type of security for server connetion.setServerURL
(String serverURL) Sets the URL to connect to the FTP server.setUserLogin
(String username, String password) Sets the username and password to authenticate an user for the FTP server.
-
Constructor Details
-
FtpResultActionBuilder
public FtpResultActionBuilder()
-
-
Method Details
-
createFTPConnection
Creating a new FTP connection.- Returns:
- the ftp connection builder
- Since:
- taskplanner 3.0
-
setServerURL
Sets the URL to connect to the FTP server.- Parameters:
serverURL
- the server URL- Returns:
- the ftp connection builder
- Since:
- taskplanner 3.0
-
setUserLogin
Sets the username and password to authenticate an user for the FTP server.- Parameters:
username
- the username to loginpassword
- the password to login- Returns:
- the ftp connection builder
- Since:
- taskplanner 3.0
-
setAnonymousLogin
Sets the login for an anonymous user. The user is "anonymous" and the password is empty.- Returns:
- the ftp connection builder
- Since:
- taskplanner 3.0
-
setServerPath
Sets the path on the FTP server where to save the file. If the path not exists, it will be created if the user has the permission to do this.- Parameters:
serverPath
- the server path to save the file- Returns:
- the ftp connection builder
- Since:
- taskplanner 3.0
-
setServerPort
Sets the connection port to the FTP server.- Parameters:
serverPort
- the FTP server port- Returns:
- the ftp connection builder
- Since:
- taskplanner 3.0
-
setServerProtocol
Sets the type of security for server connetion. It can be FTPS, FTPES, SFTP.- Parameters:
securityType
- the types connection security- Returns:
- the ftp connection builder
- Since:
- taskplanner 3.0
-
setFileNameFormat
Defines the format of the file name. Allows the usage of the placeholders [filename] [date] and [time]- Parameters:
fileNameFormat
- the format of the resulting file name- Returns:
- the ftp connection builder
- Since:
- taskplanner 3.0
-
create
public com.inet.taskplanner.server.api.action.ResultActionDefinition create()Creates the resultingResultActionDefinition
- Returns:
- the result action definition
- Since:
- taskplanner 3.0
-