mirror of
https://gitee.com/shuto/cordova-plugin-dbcopy.git
synced 2026-04-13 00:00:13 +08:00
Fix Path Issue for CopyDbToStorage Function
This commit is contained in:
@@ -158,16 +158,17 @@ public class sqlDB extends CordovaPlugin {
|
||||
|
||||
private void copyDbToStorage(String dbname, String dest, final CallbackContext callbackContext){
|
||||
File source = cordova.getActivity().getDatabasePath(dbname);
|
||||
File destination;
|
||||
File destFolder;
|
||||
File destination;
|
||||
if(dest.indexOf("file://") != -1){
|
||||
destination = new File(dest.replace("file://",""));
|
||||
destination = new File(dest.replace("file://","") + dbname);
|
||||
} else {
|
||||
destination = new File(dest);
|
||||
destination = new File(dest + dbname);
|
||||
}
|
||||
if(!destination.exists()){
|
||||
destination.mkdirs();
|
||||
if(!destFolder.exists()){
|
||||
destFolder.mkdirs();
|
||||
}
|
||||
|
||||
|
||||
if(source.exists()) {
|
||||
this.newCopyDB(source,destination,callbackContext);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user