|
static String | getFileUrl (String localFileName) |
|
static byte[] | readFile (String inputFileName) throws IOException |
|
static byte[] | readFile (Form form, String inputFileName) throws IOException |
|
static FileInputStream | openFile (String fileName) throws IOException, PermissionException |
|
static FileInputStream | openFile (Form form, String fileName) throws IOException, PermissionException |
|
static FileInputStream | openFile (File file) throws IOException, PermissionException |
|
static FileInputStream | openFile (Form form, File file) throws IOException, PermissionException |
|
static FileInputStream | openFile (URI fileUri) throws IOException, PermissionException |
|
static FileInputStream | openFile (Form form, URI fileUri) throws IOException, PermissionException |
|
static String | downloadUrlToFile (String url, String outputFileName) throws IOException |
|
static String | writeFile (byte[] array, String outputFileName) throws IOException |
|
static String | copyFile (String inputFileName, String outputFileName) throws IOException |
|
static String | writeStreamToFile (InputStream in, String outputFileName) throws IOException |
|
static File | getPictureFile (String extension) throws IOException, FileException |
|
static File | getPictureFile (Form form, String extension) throws IOException, FileException |
|
static File | getRecordingFile (String extension) throws IOException, FileException |
|
static File | getRecordingFile (Form form, String extension) throws IOException, FileException |
|
static File | getDownloadFile (String extension) throws IOException, FileException |
|
static File | getDownloadFile (Form form, String extension) throws IOException, FileException |
|
static File | getExternalFile (String fileName) throws IOException, FileException, SecurityException |
|
static File | getExternalFile (Form form, String fileName) throws IOException, FileException, SecurityException |
|
static void | checkExternalStorageWriteable () throws FileException |
|
Utilities for reading and writing files to the external storage.
- Author
- lizlo.nosp@m.oney.nosp@m.@goog.nosp@m.le.c.nosp@m.om (Liz Looney)
Definition at line 37 of file FileUtil.java.
static FileInputStream com.google.appinventor.components.runtime.util.FileUtil.openFile |
( |
File |
file | ) |
throws IOException, PermissionException |
|
static |
Opens the file identified by the given File object.
If the file is an external file and the app is running on a version of Android at SDK level 23 or higher, then the READ_EXTERNAL_STORAGE permission will be checked. If the app does not have permission to read the external file, a PermissionException will be thrown.
This function is deprecated. Developers should use openFile(Form, File) instead.
- Parameters
-
- Returns
- An open FileInputStream on success
- Exceptions
-
IOException | If the file cannot be opened |
PermissionException | If the app does not have permission to read external files and the pathname looks to be external. |
Definition at line 193 of file FileUtil.java.
static FileInputStream com.google.appinventor.components.runtime.util.FileUtil.openFile |
( |
Form |
form, |
|
|
File |
file |
|
) |
| throws IOException, PermissionException |
|
static |
Opens the file identified by the given File object.
If the file is an external file and the app is running on a version of Android at SDK level 23 or higher, then the READ_EXTERNAL_STORAGE permission will be checked. If the app does not have permission to read the external file, a PermissionException will be thrown.
- Parameters
-
form | the form to use as an Android context |
file | The file to open. |
- Returns
- An open FileInputStream on success
- Exceptions
-
IOException | If the file cannot be opened |
PermissionException | If the app does not have permission to read external files and the pathname looks to be external. |
Definition at line 214 of file FileUtil.java.
static FileInputStream com.google.appinventor.components.runtime.util.FileUtil.openFile |
( |
Form |
form, |
|
|
String |
fileName |
|
) |
| throws IOException, PermissionException |
|
static |
Opens the file at the given file name.
If the file is an external file and the app is running on a version of Android at SDK level 23 or higher, then the READ_EXTERNAL_STORAGE permission will be checked. If the app does not have permission to read the external file, a PermissionException will be thrown.
- Parameters
-
form | the form to use as an Android context |
fileName | The file path to open. |
- Returns
- An open FileInputStream on success
- Exceptions
-
IOException | If the file cannot be opened |
PermissionException | If the app does not have permission to read external files and the pathname looks to be external. |
Definition at line 165 of file FileUtil.java.
static FileInputStream com.google.appinventor.components.runtime.util.FileUtil.openFile |
( |
Form |
form, |
|
|
URI |
fileUri |
|
) |
| throws IOException, PermissionException |
|
static |
Opens the file at the given file URI.
If the file is an external file and the app is running on a version of Android at SDK level 23 or higher, then the READ_EXTERNAL_STORAGE permission will be checked. If the app does not have permission to read the external file, a PermissionException will be thrown.
- Parameters
-
form | the form to use as an Android context |
fileUri | The file URI to open. |
- Returns
- An open FileInputStream on success
- Exceptions
-
IOException | If the file cannot be opened |
PermissionException | If the app does not have permission to read external files and the pathname looks to be external. |
Definition at line 260 of file FileUtil.java.
static FileInputStream com.google.appinventor.components.runtime.util.FileUtil.openFile |
( |
String |
fileName | ) |
throws IOException, PermissionException |
|
static |
Opens the file at the given file name.
If the file is an external file and the app is running on a version of Android at SDK level 23 or higher, then the READ_EXTERNAL_STORAGE permission will be checked. If the app does not have permission to read the external file, a PermissionException will be thrown.
This function is deprecated. Developers should use openFile(Form, String) instead.
- Parameters
-
fileName | The file path to open. |
- Returns
- An open FileInputStream on success
- Exceptions
-
IOException | If the file cannot be opened |
PermissionException | If the app does not have permission to read external files and the pathname looks to be external. |
Definition at line 144 of file FileUtil.java.
static FileInputStream com.google.appinventor.components.runtime.util.FileUtil.openFile |
( |
URI |
fileUri | ) |
throws IOException, PermissionException |
|
static |
Opens the file at the given file URI.
If the file is an external file and the app is running on a version of Android at SDK level 23 or higher, then the READ_EXTERNAL_STORAGE permission will be checked. If the app does not have permission to read the external file, a PermissionException will be thrown.
This function is deprecated. Developers should use openFile(Form, URI) instead.
- Parameters
-
fileUri | The file URI to open. |
- Returns
- An open FileInputStream on success
- Exceptions
-
IOException | If the file cannot be opened |
PermissionException | If the app does not have permission to read external files and the pathname looks to be external. |
Definition at line 239 of file FileUtil.java.