|
@@ -189,17 +189,6 @@ public class RNFetchBlobFS {
|
189
|
189
|
static public Map<String, Object> getSystemfolders(ReactApplicationContext ctx) {
|
190
|
190
|
Map<String, Object> res = new HashMap<>();
|
191
|
191
|
|
192
|
|
- PackageManager m = ctx.getPackageManager();
|
193
|
|
- String s = ctx.getPackageName();
|
194
|
|
- PackageInfo p = null;
|
195
|
|
-
|
196
|
|
- try {
|
197
|
|
- p = m.getPackageInfo(s, 0);
|
198
|
|
- s = p.applicationInfo.dataDir;
|
199
|
|
- res.put("MainBundleDir", s);
|
200
|
|
- } catch (PackageManager.NameNotFoundException e) {
|
201
|
|
- e.printStackTrace();
|
202
|
|
- }
|
203
|
192
|
res.put("DocumentDir", ctx.getFilesDir().getAbsolutePath());
|
204
|
193
|
res.put("CacheDir", ctx.getCacheDir().getAbsolutePath());
|
205
|
194
|
res.put("DCIMDir", Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM).getAbsolutePath());
|
|
@@ -208,7 +197,8 @@ public class RNFetchBlobFS {
|
208
|
197
|
res.put("DownloadDir", Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).getAbsolutePath());
|
209
|
198
|
res.put("MovieDir", Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MOVIES).getAbsolutePath());
|
210
|
199
|
res.put("RingtoneDir", Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_RINGTONES).getAbsolutePath());
|
211
|
|
- res.put("SDCard", Environment.getExternalStorageDirectory().getAbsolutePath());
|
|
200
|
+// res.put("SDCard", Environment.getExternalStorageDirectory().getAbsolutePath());
|
|
201
|
+ res.put("MainBundleDir", ctx.getApplicationInfo().dataDir);
|
212
|
202
|
return res;
|
213
|
203
|
}
|
214
|
204
|
|
|
@@ -703,7 +693,7 @@ public class RNFetchBlobFS {
|
703
|
693
|
}
|
704
|
694
|
else {
|
705
|
695
|
if (!created) {
|
706
|
|
- callback.invoke("create file error: failed to create file at path `" + path + "` for its parent path may not exists");
|
|
696
|
+ callback.invoke("create file error: failed to create file at path `" + path + "` for its parent path may not exists, or the file already exists. If you intended to overwrite the existing file use fs.writeFile instead.");
|
707
|
697
|
return;
|
708
|
698
|
}
|
709
|
699
|
OutputStream ostream = new FileOutputStream(dest);
|