public class FileSource
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
FileSource.ResourceTransformCallback
This callback allows implementors to transform URLs before they are requested
from the internet.
|
| Modifier and Type | Method and Description |
|---|---|
void |
activate() |
void |
deactivate() |
protected void |
finalize() |
java.lang.String |
getAccessToken() |
static java.lang.String |
getCachePath(android.content.Context context)
Get the cache path for a context.
|
static FileSource |
getInstance(android.content.Context context)
Get the single instance of FileSource.
|
static boolean |
isExternalStorageReadable()
Checks if external storage is available to at least read.
|
void |
setAccessToken(java.lang.String accessToken) |
void |
setApiBaseUrl(java.lang.String baseUrl) |
void |
setResourceTransform(FileSource.ResourceTransformCallback callback)
Sets a callback for transforming URLs requested from the internet
|
public static FileSource getInstance(android.content.Context context)
context - the context to derive the cache path frompublic static java.lang.String getCachePath(android.content.Context context)
context - the context to derive the cache path frompublic static boolean isExternalStorageReadable()
Code from https://developer.android.com/guide/topics/data/data-storage.html#filesExternal
public void activate()
public void deactivate()
public void setAccessToken(@NonNull
java.lang.String accessToken)
public java.lang.String getAccessToken()
public void setApiBaseUrl(java.lang.String baseUrl)
public void setResourceTransform(FileSource.ResourceTransformCallback callback)
The callback will be executed on the main thread once for every requested URL.
callback - the callback to be invoked or null to resetprotected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwable