@@ -250,8 +250,8 @@ else if(resolved == null) {
250
250
static Map <String , Object > getSystemfolders (ReactApplicationContext ctx ) {
251
251
Map <String , Object > res = new HashMap <>();
252
252
253
- res .put ("DocumentDir" , ctx . getFilesDir (). getAbsolutePath ( ));
254
- res .put ("CacheDir" , ctx . getCacheDir (). getAbsolutePath ( ));
253
+ res .put ("DocumentDir" , getFilesDirPath ( ctx ));
254
+ res .put ("CacheDir" , getCacheDirPath ( ctx ));
255
255
res .put ("DCIMDir" , getExternalFilesDirPath (ctx , Environment .DIRECTORY_DCIM ));
256
256
res .put ("PictureDir" , getExternalFilesDirPath (ctx , Environment .DIRECTORY_PICTURES ));
257
257
res .put ("MusicDir" , getExternalFilesDirPath (ctx , Environment .DIRECTORY_MUSIC ));
@@ -282,6 +282,18 @@ static String getExternalFilesDirPath(ReactApplicationContext ctx, String type)
282
282
return "" ;
283
283
}
284
284
285
+ static String getFilesDirPath (ReactApplicationContext ctx ) {
286
+ File dir = ctx .getFilesDir ();
287
+ if (dir != null ) return dir .getAbsolutePath ();
288
+ return "" ;
289
+ }
290
+
291
+ static String getCacheDirPath (ReactApplicationContext ctx ) {
292
+ File dir = ctx .getCacheDir ();
293
+ if (dir != null ) return dir .getAbsolutePath ();
294
+ return "" ;
295
+ }
296
+
285
297
static public void getSDCardDir (ReactApplicationContext ctx , Promise promise ) {
286
298
if (Environment .getExternalStorageState ().equals (Environment .MEDIA_MOUNTED )) {
287
299
try {
0 commit comments