moveFile android

This commit is contained in:
Kyle Corbitt
2016-01-27 16:53:14 +00:00
parent ce2d714c31
commit 0fd5e85955
3 changed files with 19 additions and 5 deletions
@@ -92,6 +92,20 @@ public class RNFSManager extends ReactContextBaseJavaModule {
}
}
@ReactMethod
public void moveFile(String filepath, String destPath, Callback callback) {
try {
File from = new File(filepath);
File to = new File(destPath);
from.renameTo(to);
callback.invoke(null, true, destPath);
} catch (Exception ex) {
ex.printStackTrace();
callback.invoke(makeErrorPayload(ex));
}
}
@ReactMethod
public void readDir(String directory, Callback callback) {
try {