publish
plugins.it2be_ftp.FTPSfile info


Servoy Properties Summary
Boolean isDirectory
Boolean isFile
Boolean isSymbolicLink
Boolean isUnknown
String name
Number size
Date timeStamp
String type


Servoy Properties Details


isDirectory
Boolean  isDirectory
Returns true when the FTPSFile is a directory.
Returns
Boolean  result boolean

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Create a client for the FTPS connection
var vClient = plugins.it2be_ftp.createFTPSClient("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 FTPSFiles
var vList = vClient.list();

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

// 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());
}


isFile
Boolean  isFile
Returns true when it is a file.
Returns
Boolean  result boolean

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Create a client for the FTPS connection
var vClient = plugins.it2be_ftp.createFTPSClient("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 FTPSFiles
var vList = vClient.list();

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

// 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());
}


isUnknown
Boolean  isUnknown
Returns true when the file is of type directory.
Returns
Boolean  result boolean

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Create a client for the FTPS connection
var vClient = plugins.it2be_ftp.createFTPSClient("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 FTPSFiles
var vList = vClient.list();

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

// 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());
}


name
String  name
Get the name of the file.
Returns
String  name String

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Create a client for the FTPS connection
var vClient = plugins.it2be_ftp.createFTPSClient("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 FTPSFiles
var vList = vClient.list();

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

// 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());
}


size
Number  size
Get the size of the file.
Returns
Number  size long

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Create a client for the FTPS connection
var vClient = plugins.it2be_ftp.createFTPSClient("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 FTPSFiles
var vList = vClient.list();

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

// 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());
}


timeStamp
Date  timeStamp
Get the timestamp of the file.
Returns
Date  timestamp Date

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Create a client for the FTPS connection
var vClient = plugins.it2be_ftp.createFTPSClient("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 FTPSFiles
var vList = vClient.list();

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

// 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());
}


type
String  type
Get the filetype of the file.
Returns
String  type String

Supported Clients
SmartClient, WebClient, NGClient

Sample
// Create a client for the FTPS connection
var vClient = plugins.it2be_ftp.createFTPSClient("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 FTPSFiles
var vList = vClient.list();

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

// 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());
}