Package com.inet.taskplanner.ftp
Class FtpResultActionBuilder
- java.lang.Object
-
- com.inet.taskplanner.ftp.FtpResultActionBuilder
-
public class FtpResultActionBuilder extends java.lang.ObjectUse this to easily createdefinitionsfor aFtpResultAction. 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 Constructor Description FtpResultActionBuilder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.inet.taskplanner.server.api.action.ResultActionDefinitioncreate()Creates the resultingResultActionDefinitionstatic FtpResultActionBuildercreateFTPConnection()Creating a new FTP connection.FtpResultActionBuildersetAnonymousLogin()Sets the login for an anonymous user.FtpResultActionBuildersetFileNameFormat(java.lang.String fileNameFormat)Defines the format of the file name.FtpResultActionBuildersetServerPath(java.lang.String serverPath)Sets the path on the FTP server where to save the file.FtpResultActionBuildersetServerPort(int serverPort)Sets the connection port to the FTP server.FtpResultActionBuildersetServerProtocol(java.lang.String securityType)Sets the type of security for server connetion.FtpResultActionBuildersetServerURL(java.lang.String serverURL)Sets the URL to connect to the FTP server.FtpResultActionBuildersetUserLogin(java.lang.String username, java.lang.String password)Sets the username and password to authenticate an user for the FTP server.
-
-
-
Method Detail
-
createFTPConnection
public static FtpResultActionBuilder createFTPConnection()
Creating a new FTP connection.- Returns:
- the ftp connection builder
- Since:
- taskplanner 3.0
-
setServerURL
public FtpResultActionBuilder setServerURL(java.lang.String serverURL)
Sets the URL to connect to the FTP server.- Parameters:
serverURL- the server URL- Returns:
- the ftp connection builder
- Since:
- taskplanner 3.0
-
setUserLogin
public FtpResultActionBuilder setUserLogin(java.lang.String username, java.lang.String password)
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
public FtpResultActionBuilder 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
public FtpResultActionBuilder setServerPath(java.lang.String serverPath)
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
public FtpResultActionBuilder setServerPort(int serverPort)
Sets the connection port to the FTP server.- Parameters:
serverPort- the FTP server port- Returns:
- the ftp connection builder
- Since:
- taskplanner 3.0
-
setServerProtocol
public FtpResultActionBuilder setServerProtocol(java.lang.String securityType)
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
public FtpResultActionBuilder setFileNameFormat(java.lang.String fileNameFormat)
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
-
-