publish
plugins.it2be_ftp.JFTPclient info


Servoy Properties Summary
Boolean enterLocalActiveMode
String host
Boolean isConnected
String password
Number port
Number timeout
String userName


Servoy Methods Summary
Boolean cd( String )
Boolean connect( Boolean )
Boolean connect( )
Boolean disconnect( )
void get( String, String )
String getStatus( )
String getWorkingPath( )
Array<Object> list( String )
Array<Object> list( )
Boolean mkdir( String )
Boolean mkdirs( String )
Boolean mv( String, String )
void put( String, String )
Boolean rm( String )
void setReplyInformationMethod( Function )


Servoy Properties Details


enterLocalActiveMode
Boolean  enterLocalActiveMode
Get/Set the mode of the connection to active or passive (default).
Returns
Boolean  boolean

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Create a client for the JFTP connection
var vClient = plugins.it2be_ftp.createJFTPclient("host", "username", "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 list (array) of JFTPFiles
var vList = vClient.list();

// Loop through the JFTPFiles
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 JFTPFile
application.output(vFile.name + " - " + vFile.size + " - " + vFile.timeStamp);

// When the JFTPFile 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);
}
}


host
String  host
Get/Set the name of the host.
Returns
String  host String

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Create a client for the JFTP connection
var vClient = plugins.it2be_ftp.createJFTPclient("host", "username", "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 list (array) of JFTPFiles
var vList = vClient.list();

// Loop through the JFTPFiles
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 JFTPFile
application.output(vFile.name + " - " + vFile.size + " - " + vFile.timeStamp);

// When the JFTPFile 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);
}
}


isConnected
Boolean  isConnected
Check that there is a connection.
Returns
Boolean  result boolean

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Create a client for the JFTP connection
var vClient = plugins.it2be_ftp.createJFTPclient("host", "username", "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 list (array) of JFTPFiles
var vList = vClient.list();

// Loop through the JFTPFiles
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 JFTPFile
application.output(vFile.name + " - " + vFile.size + " - " + vFile.timeStamp);

// When the JFTPFile 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);
}
}


password
String  password
Get/Set the password.
Returns
String  password String

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Create a client for the JFTP connection
var vClient = plugins.it2be_ftp.createJFTPclient("host", "username", "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 list (array) of JFTPFiles
var vList = vClient.list();

// Loop through the JFTPFiles
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 JFTPFile
application.output(vFile.name + " - " + vFile.size + " - " + vFile.timeStamp);

// When the JFTPFile 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);
}
}


port
Number  port
Get/Set the port.
Returns
Number  int

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Create a client for the JFTP connection
var vClient = plugins.it2be_ftp.createJFTPclient("host", "username", "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 list (array) of JFTPFiles
var vList = vClient.list();

// Loop through the JFTPFiles
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 JFTPFile
application.output(vFile.name + " - " + vFile.size + " - " + vFile.timeStamp);

// When the JFTPFile 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);
}
}


timeout
Number  timeout
Get/Set the timeout (in milliseconds, -1 is default).
Returns
Number  timeout int

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Create a client for the JFTP connection
var vClient = plugins.it2be_ftp.createJFTPclient("host", "username", "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 list (array) of JFTPFiles
var vList = vClient.list();

// Loop through the JFTPFiles
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 JFTPFile
application.output(vFile.name + " - " + vFile.size + " - " + vFile.timeStamp);

// When the JFTPFile 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);
}
}


userName
String  userName
Get/Set the username.
Returns
String  username String

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Create a client for the JFTP connection
var vClient = plugins.it2be_ftp.createJFTPclient("host", "username", "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 list (array) of JFTPFiles
var vList = vClient.list();

// Loop through the JFTPFiles
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 JFTPFile
application.output(vFile.name + " - " + vFile.size + " - " + vFile.timeStamp);

// When the JFTPFile 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);
}
}

Servoy Methods Details


cd
Boolean  cd( String )
Change to another directory.
Parameters
String  path  the path

Returns
Boolean  result boolean

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Create a client for the JFTP connection
var vClient = plugins.it2be_ftp.createJFTPclient("host", "username", "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 list (array) of JFTPFiles
var vList = vClient.list();

// Loop through the JFTPFiles
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 JFTPFile
application.output(vFile.name + " - " + vFile.size + " - " + vFile.timeStamp);

// When the JFTPFile 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);
}
}


connect
Boolean  connect( Boolean )
'Build' the connection (Don't forget to disconnect), optionally set the active mode to true (default is passive).
Parameters
Boolean  localActiveMode  the local active mode

Returns
Boolean  result boolean

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Create a client for the JFTP connection
var vClient = plugins.it2be_ftp.createJFTPclient("host", "username", "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 list (array) of JFTPFiles
var vList = vClient.list();

// Loop through the JFTPFiles
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 JFTPFile
application.output(vFile.name + " - " + vFile.size + " - " + vFile.timeStamp);

// When the JFTPFile 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);
}
}


connect
Boolean  connect( )
'Build' the connection (Don't forget to disconnect), optionally set the active mode to true (default is passive).
Returns
Boolean  result boolean

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Create a client for the JFTP connection
var vClient = plugins.it2be_ftp.createJFTPclient("host", "username", "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 list (array) of JFTPFiles
var vList = vClient.list();

// Loop through the JFTPFiles
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 JFTPFile
application.output(vFile.name + " - " + vFile.size + " - " + vFile.timeStamp);

// When the JFTPFile 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
Boolean  disconnect( )
Disconnect from the connection.
Returns
Boolean  result boolean

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Create a client for the JFTP connection
var vClient = plugins.it2be_ftp.createJFTPclient("host", "username", "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 list (array) of JFTPFiles
var vList = vClient.list();

// Loop through the JFTPFiles
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 JFTPFile
application.output(vFile.name + " - " + vFile.size + " - " + vFile.timeStamp);

// When the JFTPFile 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);
}
}


get
void  get( String, String )
Get a file.
Parameters
String  remotePath  the remote path
String  localPath  the local path

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Get a file.
// retrieve a document from the server and write it under the designated name
// the first entry is the remote file
// the second entry is the local (new) file name
ftpClient.get("remoteFile", "localFile");


getStatus
String  getStatus( )
Get the status of the connection.
Returns
String  status String

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Create a client for the JFTP connection
var vClient = plugins.it2be_ftp.createJFTPclient("host", "username", "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 list (array) of JFTPFiles
var vList = vClient.list();

// Loop through the JFTPFiles
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 JFTPFile
application.output(vFile.name + " - " + vFile.size + " - " + vFile.timeStamp);

// When the JFTPFile 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);
}
}


getWorkingPath
String  getWorkingPath( )
Returns the absolute path name of the current remote working directory.
Returns
String  path String

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Create a client for the JFTP connection
var vClient = plugins.it2be_ftp.createJFTPclient("host", "username", "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 list (array) of JFTPFiles
var vList = vClient.list();

// Loop through the JFTPFiles
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 JFTPFile
application.output(vFile.name + " - " + vFile.size + " - " + vFile.timeStamp);

// When the JFTPFile 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);
}
}


list
Array<Object>  list( String )
Get a list (array) of JFTPFiles.
Parameters
String  path  the path

Returns
Array<Object>  files Object[]

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Create a client for the JFTP connection
var vClient = plugins.it2be_ftp.createJFTPclient("host", "username", "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 list (array) of JFTPFiles
var vList = vClient.list();

// Loop through the JFTPFiles
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 JFTPFile
application.output(vFile.name + " - " + vFile.size + " - " + vFile.timeStamp);

// When the JFTPFile 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);
}
}


list
Array<Object>  list( )
Get a list (array) of JFTPFiles.
Returns
Array<Object>  files Object[]

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Create a client for the JFTP connection
var vClient = plugins.it2be_ftp.createJFTPclient("host", "username", "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 list (array) of JFTPFiles
var vList = vClient.list();

// Loop through the JFTPFiles
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 JFTPFile
application.output(vFile.name + " - " + vFile.size + " - " + vFile.timeStamp);

// When the JFTPFile 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);
}
}


mkdir
Boolean  mkdir( String )
Creates a directory.
Parameters
String  directory  the directory

Returns
Boolean  result boolean

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Create a client for the JFTP connection
var vClient = plugins.it2be_ftp.createJFTPclient("host", "username", "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 list (array) of JFTPFiles
var vList = vClient.list();

// Loop through the JFTPFiles
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 JFTPFile
application.output(vFile.name + " - " + vFile.size + " - " + vFile.timeStamp);

// When the JFTPFile 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);
}
}


mkdirs
Boolean  mkdirs( String )
Create a path.
Parameters
String  path  the path

Returns
Boolean  result boolean

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Create a client for the JFTP connection
var vClient = plugins.it2be_ftp.createJFTPclient("host", "username", "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 list (array) of JFTPFiles
var vList = vClient.list();

// Loop through the JFTPFiles
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 JFTPFile
application.output(vFile.name + " - " + vFile.size + " - " + vFile.timeStamp);

// When the JFTPFile 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);
}
}


mv
Boolean  mv( String, String )
Rename a file on the remote computer.
Parameters
String  oldName  the old name
String  newName  the new name

Returns
Boolean  result boolean

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Create a client for the JFTP connection
var vClient = plugins.it2be_ftp.createJFTPclient("host", "username", "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 list (array) of JFTPFiles
var vList = vClient.list();

// Loop through the JFTPFiles
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 JFTPFile
application.output(vFile.name + " - " + vFile.size + " - " + vFile.timeStamp);

// When the JFTPFile 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);
}
}


put
void  put( String, String )
Put a file.
Parameters
String  localPath  the local path
String  remotePath  the remote path

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Put a file.
// send a document to the server and write it under the designated name
// the first entry is the local file
// the second entry is the remote (new) file name
ftpClient.put("localFile", "remoteFile");


rm
Boolean  rm( String )
Delete a file.
Parameters
String  fileName  the filename

Returns
Boolean  result boolean

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Create a client for the JFTP connection
var vClient = plugins.it2be_ftp.createJFTPclient("host", "username", "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 list (array) of JFTPFiles
var vList = vClient.list();

// Loop through the JFTPFiles
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 JFTPFile
application.output(vFile.name + " - " + vFile.size + " - " + vFile.timeStamp);

// When the JFTPFile 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);
}
}


setReplyInformationMethod
void  setReplyInformationMethod( Function )
When you work with the server replies this method will receive an array of reply strings .
Parameters
Function  callback  the callback method

Returns
void  

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Create a client for the JFTP connection
var vClient = plugins.it2be_ftp.createJFTPclient("host", "username", "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 list (array) of JFTPFiles
var vList = vClient.list();

// Loop through the JFTPFiles
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 JFTPFile
application.output(vFile.name + " - " + vFile.size + " - " + vFile.timeStamp);

// When the JFTPFile 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);
}
}