public interface IO
Modifier and Type | Method and Description |
---|---|
Task<File> |
downloadFileAsync(String srcUrl,
String dest)
Downloads a file from a URL and stores it locally on the device.
|
File |
findDownloadedFile(String filename)
Finds a downloaded file matching the name.
|
InputStream |
localRetrieve(String key)
Retrieves data saved locally to the device
|
void |
localSave(String key,
byte[] data)
Save the data to the local device
|
void |
logWarn(String tag,
String message)
Outputs a warn level message to the logger
|
void |
logWarn(String tag,
String message,
Throwable tr)
Outputs a warn level message to the logger with an exception or error associated with the message
|
void localSave(String key, byte[] data) throws IOException
key
- Key value identifying the datadata
- Data to saveIOException
- If I/O error occursInputStream localRetrieve(String key) throws IOException
key
- Key value identifying the dataIOException
- If I/O error occursTask<File> downloadFileAsync(String srcUrl, String dest)
findDownloadedFile(String)
.srcUrl
- URL to retrieve the file fromdest
- Where to store the downloaded fileFile findDownloadedFile(String filename)
File.exists()
filename
- File to search forvoid logWarn(String tag, String message)
tag
- Value identifying the messagemessage
- Message to log