public class BrazeFileUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.util.List<java.lang.String> |
REMOTE_SCHEMES |
Constructor and Description |
---|
BrazeFileUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
deleteFileOrDirectory(java.io.File fileOrDirectory)
Recursively deletes all the files under a directory.
|
static void |
deleteSharedPreferencesFile(android.content.Context context,
java.io.File file)
Deletes the
SharedPreferences file. |
static java.io.File |
downloadFileToPath(java.lang.String downloadDirectoryAbsolutePath,
java.lang.String remoteFileUrl,
java.lang.String outputFilename,
java.lang.String extension) |
static java.lang.String |
getAssetFileStringContents(android.content.res.AssetManager assetManager,
java.lang.String assetPath)
Retrieve the string contents of a file from Android assets
|
static boolean |
isLocalUri(android.net.Uri uri) |
static boolean |
isRemoteUri(android.net.Uri uri) |
public static void deleteFileOrDirectory(java.io.File fileOrDirectory)
fileOrDirectory
- a file or directory to be deleted.public static void deleteSharedPreferencesFile(android.content.Context context, java.io.File file)
SharedPreferences
file. Expects the
filename to end in ".xml".public static boolean isRemoteUri(android.net.Uri uri)
uri
- public static boolean isLocalUri(android.net.Uri uri)
uri
- public static java.io.File downloadFileToPath(java.lang.String downloadDirectoryAbsolutePath, java.lang.String remoteFileUrl, java.lang.String outputFilename, java.lang.String extension)
downloadDirectoryAbsolutePath
- the absolute file path to the download directory. Must begin with "/".remoteFileUrl
- the remote url of the file to be downloadedoutputFilename
- filename of the end result file with no file extensionextension
- file extension (optional). May be null or blankpublic static java.lang.String getAssetFileStringContents(android.content.res.AssetManager assetManager, java.lang.String assetPath)