|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface FileStore
A Store for files on Crux Database. Use this to work with files on database.
See the following example:
Transactiontransaction = database.getTransaction(new String[]{FileStore.OBJECT_STORE_NAME},Transaction.Mode.readWrite); FileStore store = transaction.getFileStore(); store.openCursor(newFileStoreCursorCallback(){
ObjectStore| Field Summary | |
|---|---|
static String |
OBJECT_STORE_NAME
The name of the object store used to store the files on Crux Database. |
| Method Summary | |
|---|---|
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. |
| Field Detail |
|---|
static final String OBJECT_STORE_NAME
| Method Detail |
|---|
void add(Blob file,
String fileName)
file - file to storefileName - file name
void put(Blob file,
String fileName)
file - file to storefileName - file name
void add(Blob file,
String fileName,
DatabaseWriteCallback<String> callback)
file - file to storefileName - file namecallback - called when the operation complete
void put(Blob file,
String fileName,
DatabaseWriteCallback<String> callback)
file - file to storefileName - file namecallback - called when the operation complete
void get(String key,
DatabaseRetrieveCallback<Blob> callback)
key - the fileName used to insert the objectcallback - called when the operation complete
void 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 exclude
void 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 complete
void 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 complete
void 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 complete
void 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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||