publish
plugins.it2be_ftp info


Servoy Properties Summary
String build
Date buildDate
String component
Number version


Servoy Methods Summary
FTPSclient createFTPSclient( String, String, String, Boolean )
FTPSclient createFTPSclient( String, String, String )
JFTPclient createJFTPclient( String )
JFTPclient createJFTPclient( String, String, String )
JFTPclient createJFTPclient( String, String, String, Boolean )
SFTPsettings createPasswordSettings( String, String, String )
SFTPsettings createPublicKeySettings( String, String, String )
SFTPclient createSFTPclient( SFTPsettings )


Servoy Properties Details


build
String  build
Returns the current version (major, minor, build)
Returns
String  build String

Supported Clients
SmartClient, WebClient, NGClient


buildDate
Date  buildDate
Returns date release date
Returns
Date  date Date

Supported Clients
SmartClient, WebClient, NGClient


component
String  component
Returns the component name
Returns
String  name String

Supported Clients
SmartClient, WebClient, NGClient


version
Number  version
Returns the current version (major, minor)
Returns
Number  version Double

Supported Clients
SmartClient, WebClient, NGClient

Servoy Methods Details


createFTPSclient
FTPSclient  createFTPSclient( String, String, String, Boolean )
Create a connected SSL or TSL FTPSclient instance (NOTE: remember to disconnect).
Parameters
String  host  the host
String  username  the username
String  password  the password
Boolean  localActiveMode  the local active mode

Returns
FTPSclient  FTPSclient

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Create a client for the FTPS connection
var vClient = plugins.it2be_ftp.createFTPSclient("host", "user", "password");

// 'Build' the connection and when the connection returns true
// start executing the rest of the code
if (vClient.connect()) {

// Check the status of the connection
application.output(vClient.getStatus());

// Create a vList (array) of FTPSFiles
var vList = vClient.list();

if (vList != null) {
// Loop through the FTPSFiles
for (var vIndex = 0 ; vIndex < vList.length ; vIndex++) {
// Retrieve the file at the selected index
var vFile = vList[vIndex];

// Output the name, size and timestamp of the FTPSFile
globals.ftp += vFile.name + " - " + vFile.size + " - " + vFile.timeStamp + "\n";

// When the FTPSFile is of file type retrieve the data for it
// Here you could create a method to loop through the folder if
// the file type is a folder
if (vFile.isFile) {
vClient.get(vFile.name, "path/" + vFile.name);
}
}
}

// Disconnect the client
application.output(vClient.disconnect());
}


createFTPSclient
FTPSclient  createFTPSclient( String, String, String )
Create a connected SSL or TSL FTPSclient instance (NOTE: remember to disconnect).
Parameters
String  host  the host
String  username  the username
String  password  the password

Returns
FTPSclient  client FTPSclient

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Create a client for the FTPS connection
var vClient = plugins.it2be_ftp.createFTPSclient("host", "user", "password");

// 'Build' the connection and when the connection returns true
// start executing the rest of the code
if (vClient.connect()) {

// Check the status of the connection
application.output(vClient.getStatus());

// Create a vList (array) of FTPSFiles
var vList = vClient.list();

if (vList != null) {
// Loop through the FTPSFiles
for (var vIndex = 0 ; vIndex < vList.length ; vIndex++) {
// Retrieve the file at the selected index
var vFile = vList[vIndex];

// Output the name, size and timestamp of the FTPSFile
globals.ftp += vFile.name + " - " + vFile.size + " - " + vFile.timeStamp + "\n";

// When the FTPSFile is of file type retrieve the data for it
// Here you could create a method to loop through the folder if
// the file type is a folder
if (vFile.isFile) {
vClient.get(vFile.name, "path/" + vFile.name);
}
}
}

// Disconnect the client
application.output(vClient.disconnect());
}


createJFTPclient
JFTPclient  createJFTPclient( String )
Create a connected normal JFTPclient instance (NOTE: remember to disconnect).
Parameters
String  host  the host

Returns
JFTPclient  client JFTPclient

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Create a client for the FTPS connection
var vClient = plugins.it2be_ftp.createFTPSclient("host", "user", "password");

// 'Build' the connection and when the connection returns true
// start executing the rest of the code
if (vClient.connect()) {

// Check the status of the connection
application.output(vClient.getStatus());

// Create a vList (array) of FTPSFiles
var vList = vClient.list();

if (vList != null) {
// Loop through the FTPSFiles
for (var vIndex = 0 ; vIndex < vList.length ; vIndex++) {
// Retrieve the file at the selected index
var vFile = vList[vIndex];

// Output the name, size and timestamp of the FTPSFile
globals.ftp += vFile.name + " - " + vFile.size + " - " + vFile.timeStamp + "\n";

// When the FTPSFile is of file type retrieve the data for it
// Here you could create a method to loop through the folder if
// the file type is a folder
if (vFile.isFile) {
vClient.get(vFile.name, "path/" + vFile.name);
}
}
}

// Disconnect the client
application.output(vClient.disconnect());
}


createJFTPclient
JFTPclient  createJFTPclient( String, String, String )
Create a connected normal JFTPclient instance (NOTE: remember to disconnect).
Parameters
String  host  the host
String  username  the username
String  password  the password

Returns
JFTPclient  client JFTPclient

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Create a client for the FTPS connection
var vClient = plugins.it2be_ftp.createFTPSclient("host", "user", "password");

// 'Build' the connection and when the connection returns true
// start executing the rest of the code
if (vClient.connect()) {

// Check the status of the connection
application.output(vClient.getStatus());

// Create a vList (array) of FTPSFiles
var vList = vClient.list();

if (vList != null) {
// Loop through the FTPSFiles
for (var vIndex = 0 ; vIndex < vList.length ; vIndex++) {
// Retrieve the file at the selected index
var vFile = vList[vIndex];

// Output the name, size and timestamp of the FTPSFile
globals.ftp += vFile.name + " - " + vFile.size + " - " + vFile.timeStamp + "\n";

// When the FTPSFile is of file type retrieve the data for it
// Here you could create a method to loop through the folder if
// the file type is a folder
if (vFile.isFile) {
vClient.get(vFile.name, "path/" + vFile.name);
}
}
}

// Disconnect the client
application.output(vClient.disconnect());
}


createJFTPclient
JFTPclient  createJFTPclient( String, String, String, Boolean )
Create a connected normal JFTPclient instance (NOTE: remember to disconnect).
Parameters
String  host  the host
String  username  the username
String  password  the password
Boolean  localActiveMode  the local active mode

Returns
JFTPclient  client JFTPclient

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Create a client for the FTPS connection
var vClient = plugins.it2be_ftp.createFTPSclient("host", "user", "password");

// 'Build' the connection and when the connection returns true
// start executing the rest of the code
if (vClient.connect()) {

// Check the status of the connection
application.output(vClient.getStatus());

// Create a vList (array) of FTPSFiles
var vList = vClient.list();

if (vList != null) {
// Loop through the FTPSFiles
for (var vIndex = 0 ; vIndex < vList.length ; vIndex++) {
// Retrieve the file at the selected index
var vFile = vList[vIndex];

// Output the name, size and timestamp of the FTPSFile
globals.ftp += vFile.name + " - " + vFile.size + " - " + vFile.timeStamp + "\n";

// When the FTPSFile is of file type retrieve the data for it
// Here you could create a method to loop through the folder if
// the file type is a folder
if (vFile.isFile) {
vClient.get(vFile.name, "path/" + vFile.name);
}
}
}

// Disconnect the client
application.output(vClient.disconnect());
}


createPasswordSettings
SFTPsettings  createPasswordSettings( String, String, String )
Create a settings object that describes how to connect using password authentication.
Parameters
String  host  the host
String  username  the username
String  password  the password

Returns
SFTPsettings  settings SFTPsettings

Supported Clients
SmartClient, WebClient, NGClient


createPublicKeySettings
SFTPsettings  createPublicKeySettings( String, String, String )
Create a settings object that describes how to connect using public key authentication.
Parameters
String  host  the host
String  username  the username
String  publicKey  the public key

Returns
SFTPsettings  settings SFTPsettings

Supported Clients
SmartClient, WebClient, NGClient


createSFTPclient
SFTPclient  createSFTPclient( SFTPsettings )
Create a connected secure SFTPclient instance (NOTE: remember to disconnect).
Parameters
SFTPsettings  settings  the settings

Returns
SFTPclient  client SFTPclient

Supported Clients
SmartClient, WebClient, NGClient

Sample
// set the settings needed to log into the server
// alternative is the use of a keystore instead of a password
var vSettings = plugins.it2be_ftp.createPasswordSettings("host", "user", "password");

// Create a client for the SFTP connection
var vClient = plugins.it2be_ftp.createSFTPclient(vSettings);

// 'Build' the connection and when the connection returns true
// start executing the rest of the code
if (vClient.connect()) {
// Check the status of the connection
application.output(vClient.getStatus());

// Create a list (array) of SFTPFiles
var vList = vClient.list();

// Loop through the SFTPFiles
for (var vIndex = 0 ; vIndex < vList.length ; vIndex++) {
// Retrieve the file at the selected index
var vFile = vList[vIndex];

// Output the name, size and timestamp of the SFTPFile
application.output(vFile.name + " - " + vFile.size + " - " + vFile.timeStamp);

// When the SFTPFile is of file type retrieve the data for it
// Here you could create a method to loop through the folder if
// the file type is a folder
if (vFile.isFile) {
vClient.get(vFile.name, "path/" + vFile.name);
}
}

// Disconnect the client
application.output(vClient.disconnect());
}