public interface FileStore
See the following example:
Transactiontransaction = database.getTransaction(new String[]{FileStore.OBJECT_STORE_NAME},Transaction.Mode.readWrite); FileStore store = transaction.getFileStore(); store.openCursor(newFileStoreCursorCallback(){
ObjectStore| Modifier and Type | Field and Description |
|---|---|
static String |
OBJECT_STORE_NAME
The name of the object store used to store the files on Crux Database.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(Blob file,
String fileName)
Insert a new file into the database.
|
void |
add(Blob file,
String fileName,
DatabaseWriteCallback<String> callback)
Insert a new file into the database.
|
void |
clear()
Removes all files from the database FileStore
|
void |
count(DatabaseCountCallback callback)
Check the number of files on the fileStore
|
void |
count(KeyRange<String> keyRange,
DatabaseCountCallback callback)
Check the number of files on the fileStore
|
void |
delete(KeyRange<String> keyRange)
Remove a range of files from the database
|
void |
delete(KeyRange<String> keyRange,
DatabaseDeleteCallback callback)
Remove a range of files from the database
|
void |
delete(String key,
DatabaseDeleteCallback callback)
Remove the file from the database
|
void |
get(String key,
DatabaseRetrieveCallback<Blob> callback)
Retrieve a file from the database.
|
KeyRangeFactory<String> |
getKeyRangeFactory()
Creates a factory for
KeyRange objects used by this store. |
void |
openCursor(FileStoreCursorCallback callback)
Open a
FileCursor object, to allow iteration over the files on this store. |
void |
openCursor(KeyRange<String> keyRange,
Cursor.CursorDirection direction,
FileStoreCursorCallback callback)
Open a
FileCursor object, to allow iteration over the files on this store. |
void |
openCursor(KeyRange<String> keyRange,
FileStoreCursorCallback callback)
Open a
FileCursor object, to allow iteration over the files on this store. |
void |
put(Blob file,
String fileName)
If database already contains a file stored with the given fileName, update the file stored.
|
void |
put(Blob file,
String fileName,
DatabaseWriteCallback<String> callback)
If database already contains a file stored with the given fileName, update the file stored.
|
static final String OBJECT_STORE_NAME
void add(Blob file, String fileName)
file - file to storefileName - file namevoid put(Blob file, String fileName)
file - file to storefileName - file namevoid add(Blob file, String fileName, DatabaseWriteCallback<String> callback)
file - file to storefileName - file namecallback - called when the operation completevoid put(Blob file, String fileName, DatabaseWriteCallback<String> callback)
file - file to storefileName - file namecallback - called when the operation completevoid get(String key, DatabaseRetrieveCallback<Blob> callback)
key - the fileName used to insert the objectcallback - called when the operation completevoid delete(String key, DatabaseDeleteCallback callback)
key - the fileName used to insert the objectcallback - called when the operation completevoid delete(KeyRange<String> keyRange)
keyRange - an object specifying the fileNames range to excludevoid delete(KeyRange<String> keyRange, DatabaseDeleteCallback callback)
keyRange - an object specifying the fileNames range to excludecallback - called when the operation completevoid clear()
void openCursor(FileStoreCursorCallback callback)
FileCursor object, to allow iteration over the files on this store.callback - called when the operation completevoid openCursor(KeyRange<String> keyRange, FileStoreCursorCallback callback)
FileCursor object, to allow iteration over the files on this store.keyRange - an object specifying the fileNames range to appear on iterationcallback - called when the operation completevoid openCursor(KeyRange<String> keyRange, Cursor.CursorDirection direction, FileStoreCursorCallback callback)
FileCursor object, to allow iteration over the files on this store.keyRange - an object specifying the fileNames range to appear on iterationdirection - specifies the cursor iteration directioncallback - called when the operation completevoid count(DatabaseCountCallback callback)
callback - called when the operation completevoid count(KeyRange<String> keyRange, DatabaseCountCallback callback)
keyRange - an object specifying the fileNames range to countcallback - called when the operation completeKeyRangeFactory<String> getKeyRangeFactory()
KeyRange objects used by this store.Copyright © 2015. All rights reserved.