Global.helma.Ssh.get (remoteFile, targetDir)
copies a file from the remote server.

  • Parameter String:
    path to remote file that should be copied to remote server. If the argument is a String Array, all files specified in the Array are copied from the remote server
  • Parameter String:
    path to local destination directory
  • Returns
    Boolean
Sourcecode in /home/hannes/helma/modules/helma/Ssh.js:
241:   this.get = function(remoteFile, targetDir) {
242:           if (!remoteFile || !targetDir) {
243:               error("get", "Insufficient arguments.");
244:           } else if (!this.isConnected()) {
245:               error("get", "Not connected. Please establish a connection first.");
246:           } else {
247:               try {
248:                   var scp = connection.createSCPClient();
249:                   scp.get(remoteFile, targetDir);
250:                  debug("get", "copied '" + remoteFile + "' to '" + targetDir + "'");
251:                  return true;
252:              } catch (e) {
253:                  error("get", e);
254:              }
255:          }
256:          return false;
257:      }