Servoy Methods Details |
---|
connect
void connect( )
Connects the session to the remote serverReturns
void
Supported Clients
SmartClient, WebClient, NGClient
disconnect
void disconnect( )
Disconnects the session from the remote serverReturns
void
Supported Clients
SmartClient, WebClient, NGClient
get
Boolean get( String, String )
Downloads a file, relative from default path, to the specified local path.Parameters
String remotePath Path to the target file
String localPath Path to the local file
Returns
Boolean Boolean
Supported Clients
SmartClient, WebClient, NGClient
Sample
var client = plugins.it2be_cloudstorage.createClient(plugins.it2be_cloudstorage.PROVIDERS.LOCAL, null);
var session = client.createSession();
session.connect();
session.get("/path/to/remote/file.txt", "C:\\path\\to\\local\\file.txt");
session.disconnect();
list
Array<CloudStorageListItem> list( )
Lists the contents of the default pathReturns
Array<CloudStorageListItem> CloudStorageListItem[]
Supported Clients
SmartClient, WebClient, NGClient
Sample
var client = plugins.it2be_cloudstorage.createClient(plugins.it2be_cloudstorage.PROVIDERS.LOCAL, null);
var session = client.createSession();
session.connect();
session.list();
session.disconnect();
list
Array<CloudStorageListItem> list( String )
Lists the contents of a specific folder, relative from the default path.Parameters
String path Path to the target directory
Returns
Array<CloudStorageListItem> CloudStorageListItem[]
Supported Clients
SmartClient, WebClient, NGClient
Sample
var client = plugins.it2be_cloudstorage.createClient(plugins.it2be_cloudstorage.PROVIDERS.LOCAL, null);
var session = client.createSession();
session.connect();
session.list("/path/to/remote/directory");
session.disconnect();
mkdir
Boolean mkdir( String )
Creates a directory on the remote server at the specified path. Assumes parent directory exists.Parameters
String remotePath Path to the target directory
Returns
Boolean Boolean
Supported Clients
SmartClient, WebClient, NGClient
Sample
var client = plugins.it2be_cloudstorage.createClient(plugins.it2be_cloudstorage.PROVIDERS.LOCAL, null);
var session = client.createSession();
session.connect();
session.mkdir("/path/to/remote/directory");
session.disconnect();
mkdirs
Boolean mkdirs( String )
Creates the directory or directories on the remote server at the specified path.Parameters
String remotePath Path to the target directory
Returns
Boolean Boolean
Supported Clients
SmartClient, WebClient, NGClient
Sample
var client = plugins.it2be_cloudstorage.createClient(plugins.it2be_cloudstorage.PROVIDERS.LOCAL, null);
var session = client.createSession();
session.connect();
session.mkdirs("/path/to/remote/directory");
session.disconnect();
mv
Boolean mv( String, String )
Moves the target file from one path to another on the remote server.Parameters
String sourcePath Path to the file's current location
String destinationPath Path to the file's new location
Returns
Boolean Boolean
Supported Clients
SmartClient, WebClient, NGClient
Sample
var client = plugins.it2be_cloudstorage.createClient(plugins.it2be_cloudstorage.PROVIDERS.LOCAL, null);
var session = client.createSession();
session.connect();
session.mv("/path/to/source/file.txt", "/path/to/destination/file.txt");
session.disconnect();
put
Boolean put( String, String )
Uploads the target local file to the remote server at the specified path.Parameters
String localPath Path to the file's location on the local machine
String remotePath Destination path on the server
Returns
Boolean Boolean
Supported Clients
SmartClient, WebClient, NGClient
Sample
var client = plugins.it2be_cloudstorage.createClient(plugins.it2be_cloudstorage.PROVIDERS.LOCAL, null);
var session = client.createSession();
session.connect();
session.put("C:\\path\\to\\upload\\file.txt", "/path/to/file.txt");
session.disconnect();
rm
Boolean rm( String )
Deletes the target file from the remote server.Parameters
String remotePath Path to file on the remote server
Returns
Boolean Boolean
Supported Clients
SmartClient, WebClient, NGClient
Sample
var client = plugins.it2be_cloudstorage.createClient(plugins.it2be_cloudstorage.PROVIDERS.LOCAL, null);
var session = client.createSession();
session.connect();
session.rm("/path/to/file.txt");
session.disconnect();