public abstract class LocalStorage
extends com.infinitekind.tiksync.SyncRecord
implements com.infinitekind.tiksync.SyncStorage
| Modifier and Type | Field and Description |
|---|---|
protected com.infinitekind.tiksync.SyncRecord |
authenticationCache |
| Constructor and Description |
|---|
LocalStorage() |
| Modifier and Type | Method and Description |
|---|---|
void |
cacheAuthentication(java.lang.String key,
java.lang.String authVal)
Used by OnlineService to cache authentication
|
void |
clearAuthenticationCache(java.lang.String prefix)
Remove any stored passwords for the given service whose key begins with the given prefix
|
abstract boolean |
delete(java.lang.String filename)
Deletes a local data file or folder.
|
abstract boolean |
exists(java.lang.String filename)
Returns true iff a file exists at the given path in the safe storage.
|
java.lang.String |
getCachedAuthentication(java.lang.String key)
Used by local modules to retrieve cached authentication and other secure information
|
abstract boolean |
isFolder(java.lang.String filename)
Returns true iff a file at the given path exists and is a folder.
|
static java.lang.String |
joinPath(java.lang.String folder,
java.lang.String file) |
abstract java.lang.String[] |
listFiles(java.lang.String folderPath)
Returns a list of files under the given folder path.
|
abstract java.lang.String[] |
listSubfolders(java.lang.String folderPath)
Returns a list of folders under the given folder path.
|
abstract void |
moveFile(java.lang.String fromFile,
java.lang.String toFileOrFolder)
Move or rename the given fromFile to the given file or folder.
|
abstract java.io.InputStream |
openFileForReading(java.lang.String filename)
Reads from a local data file, decrypting as it goes.
|
abstract java.io.OutputStream |
openFileForWriting(java.lang.String filename)
Returns a stream for writing to a local data file, encrypting as it goes.
|
abstract long |
readFromFile(java.lang.String filename,
java.io.OutputStream sinkStream)
Reads from a local data file, decrypting as it goes.
|
abstract boolean |
save()
Saves the key-value data to local storage
|
abstract long |
writeToFile(java.lang.String filename,
java.io.InputStream dataToWrite)
Writes to a local data file, encrypting as it goes.
|
abstract void |
writeToFileAtomically(byte[] bytesToWrite,
java.lang.String destinationFilename)
Encrypts and writes to a local data file atomically.
|
add, clone, createFrom, createFrom, getBoolean, getDouble, getInt, getIntArray, getLabel, getLong, getStr, getString, getStringList, getSublist, getSubset, printHumanReadableContents, put, put, put, put, put, put, put, put, put, put, readSet, readSet, removeSubset, setLabel, toString, unescapeAndDecodeUTF8, writeSet, writeToStringclear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuespublic abstract boolean save()
public abstract boolean exists(java.lang.String filename)
throws java.lang.Exception
exists in interface com.infinitekind.tiksync.SyncStoragejava.lang.Exceptionpublic abstract boolean isFolder(java.lang.String filename)
throws java.lang.Exception
isFolder in interface com.infinitekind.tiksync.SyncStoragejava.lang.Exceptionpublic abstract java.lang.String[] listFiles(java.lang.String folderPath)
listFiles in interface com.infinitekind.tiksync.SyncStoragepublic abstract java.lang.String[] listSubfolders(java.lang.String folderPath)
listSubfolders in interface com.infinitekind.tiksync.SyncStoragepublic abstract java.io.InputStream openFileForReading(java.lang.String filename)
throws java.lang.Exception
openFileForReading in interface com.infinitekind.tiksync.SyncStoragejava.lang.Exceptionpublic abstract java.io.OutputStream openFileForWriting(java.lang.String filename)
throws java.lang.Exception
openFileForWriting in interface com.infinitekind.tiksync.SyncStoragejava.lang.Exceptionpublic abstract long writeToFile(java.lang.String filename,
java.io.InputStream dataToWrite)
throws java.lang.Exception
writeToFile in interface com.infinitekind.tiksync.SyncStoragejava.lang.Exceptionpublic abstract long readFromFile(java.lang.String filename,
java.io.OutputStream sinkStream)
throws java.lang.Exception
readFromFile in interface com.infinitekind.tiksync.SyncStoragejava.lang.Exceptionpublic abstract boolean delete(java.lang.String filename)
throws java.lang.Exception
delete in interface com.infinitekind.tiksync.SyncStoragejava.lang.Exceptionpublic abstract void moveFile(java.lang.String fromFile,
java.lang.String toFileOrFolder)
throws java.lang.Exception
moveFile in interface com.infinitekind.tiksync.SyncStoragejava.lang.Exceptionpublic abstract void writeToFileAtomically(byte[] bytesToWrite,
java.lang.String destinationFilename)
throws java.lang.Exception
writeToFileAtomically in interface com.infinitekind.tiksync.SyncStoragejava.lang.Exceptionpublic void cacheAuthentication(java.lang.String key,
java.lang.String authVal)
public java.lang.String getCachedAuthentication(java.lang.String key)
public void clearAuthenticationCache(java.lang.String prefix)
public static java.lang.String joinPath(java.lang.String folder,
java.lang.String file)