MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / rename

Method rename

src/plugins/sftp/src/com/foxdebug/sftp/Sftp.java:660–682  ·  view source on GitHub ↗
(JSONArray args, CallbackContext callback)

Source from the content-addressed store, hash-verified

658 }
659
660 public void rename(JSONArray args, CallbackContext callback) {
661 cordova
662 .getThreadPool()
663 .execute(
664 new Runnable() {
665 public void run() {
666 try {
667 String oldpath = args.optString(0);
668 String newpath = args.optString(1);
669
670 if (ssh != null && sftp != null) {
671 sftp.rename(oldpath, newpath);
672 callback.success();
673 return;
674 }
675 callback.error("Not connected");
676 } catch (SftpStatusException | SshException e) {
677 callback.error(errMessage(e));
678 }
679 }
680 }
681 );
682 }
683
684 public void pwd(JSONArray args, CallbackContext callback) {
685 cordova

Callers

nothing calls this directly

Calls 1

executeMethod · 0.45

Tested by

no test coverage detected