mirror of
https://github.com/status-im/react-native-fs.git
synced 2026-08-31 03:51:11 +00:00
moveFile android
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user