@@ -459,7 +459,7 @@ public void ls(String path, Promise promise) {
459459 Log .d ("ReactNative" , "ls: path = " + path );
460460 try {
461461 byte [] res = Fs .ls (this .client , this .rootConfig .getCid (), this .rootConfig .getPrivate_ref (), path );
462-
462+
463463 //JSONArray jsonArray = new JSONArray(res);
464464 String s = new String (res , StandardCharsets .UTF_8 );
465465 Log .d ("ReactNative" , "ls: res = " + s );
@@ -487,6 +487,38 @@ public void rm(String path, Promise promise) {
487487 });
488488 }
489489
490+ @ ReactMethod
491+ public void cp (String sourcePath , String targetPath , Promise promise ) {
492+ ThreadUtils .runOnExecutor (() -> {
493+ Log .d ("ReactNative" , "rm: sourcePath = " + sourcePath );
494+ try {
495+ land .fx .wnfslib .Config config = Fs .cp (this .client , this .rootConfig .getCid (), this .rootConfig .getPrivate_ref (), sourcePath , targetPath );
496+ this .rootConfig = config ;
497+ encrypt_and_store_config ();
498+ promise .resolve (config .getCid ());
499+ } catch (Exception e ) {
500+ Log .d ("get" , e .getMessage ());
501+ promise .reject (e );
502+ }
503+ });
504+ }
505+
506+ @ ReactMethod
507+ public void mv (String sourcePath , String targetPath , Promise promise ) {
508+ ThreadUtils .runOnExecutor (() -> {
509+ Log .d ("ReactNative" , "rm: sourcePath = " + sourcePath );
510+ try {
511+ land .fx .wnfslib .Config config = Fs .mv (this .client , this .rootConfig .getCid (), this .rootConfig .getPrivate_ref (), sourcePath , targetPath );
512+ this .rootConfig = config ;
513+ encrypt_and_store_config ();
514+ promise .resolve (config .getCid ());
515+ } catch (Exception e ) {
516+ Log .d ("get" , e .getMessage ());
517+ promise .reject (e );
518+ }
519+ });
520+ }
521+
490522 @ ReactMethod
491523 public void readFile (String fulaTargetFilename , String localFilename , Promise promise ) {
492524 /*
0 commit comments