public class StorageManager
extends java.lang.Object
Constructor and Description |
---|
StorageManager() |
Modifier and Type | Method and Description |
---|---|
static void |
deleteFileFromInternalStorage(Context context,
java.lang.String filename)
Deletes a file from internal storage
|
static JSONObject |
getJsonObjectFromUri(Context context,
Uri uri)
Gets a JSON object from a JSON file located at the given Uri
|
static void |
saveJsonObjectToInternalStorage(java.io.File file,
JSONObject jsonObject)
Saves a JSON object to the device internal storage
|
public static void saveJsonObjectToInternalStorage(java.io.File file, JSONObject jsonObject)
file
- the file where we need to writejsonObject
- the JSON object to be written in the filepublic static JSONObject getJsonObjectFromUri(Context context, Uri uri) throws JSONException, java.io.IOException
context
- the contexturi
- the file UriJSONException
- if the JSON object is not validjava.io.IOException
- if the file cannot be accessedpublic static void deleteFileFromInternalStorage(Context context, java.lang.String filename)
context
- activity contextfilename
- the name of the stored file