Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
io.flutter.util.PathUtils Class Reference

Static Public Member Functions

static String getFilesDir (@NonNull Context applicationContext)
 
static String getDataDirectory (@NonNull Context applicationContext)
 
static String getCacheDirectory (@NonNull Context applicationContext)
 

Detailed Description

Definition at line 14 of file PathUtils.java.

Member Function Documentation

◆ getCacheDirectory()

static String io.flutter.util.PathUtils.getCacheDirectory ( @NonNull Context  applicationContext)
inlinestatic

Definition at line 35 of file PathUtils.java.

35 {
36 File cacheDir;
37 cacheDir = applicationContext.getCodeCacheDir();
38 if (cacheDir == null) {
39 cacheDir = applicationContext.getCacheDir();
40 }
41 if (cacheDir == null) {
42 // This can happen if the disk is full. This code path is used to set up dart:io's
43 // `Directory.systemTemp`. It's unknown if the application will ever try to
44 // use that or not, so do not throw here. In this case, this directory does
45 // not exist because the disk is full, and the application will later get an
46 // exception when it tries to actually write.
47 cacheDir = new File(getDataDirPath(applicationContext), "cache");
48 }
49 return cacheDir.getPath();
50 }

◆ getDataDirectory()

static String io.flutter.util.PathUtils.getDataDirectory ( @NonNull Context  applicationContext)
inlinestatic

Definition at line 25 of file PathUtils.java.

25 {
26 final String name = "flutter";
27 File flutterDir = applicationContext.getDir(name, Context.MODE_PRIVATE);
28 if (flutterDir == null) {
29 flutterDir = new File(getDataDirPath(applicationContext), "app_" + name);
30 }
31 return flutterDir.getPath();
32 }
const char * name
Definition fuchsia.cc:50

◆ getFilesDir()

static String io.flutter.util.PathUtils.getFilesDir ( @NonNull Context  applicationContext)
inlinestatic

Definition at line 16 of file PathUtils.java.

16 {
17 File filesDir = applicationContext.getFilesDir();
18 if (filesDir == null) {
19 filesDir = new File(getDataDirPath(applicationContext), "files");
20 }
21 return filesDir.getPath();
22 }

The documentation for this class was generated from the following file: