|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.ontopia.infoset.content.FileContentStore
public class FileContentStore
INTERNAL: A content store implementation based on the file system. It uses a two-level structure where inside the root directory is a set of directories, each of which contains a fixed number of files (N). A key is mapped to a file name (key modulo N) and a directory name (key divided by N). The next free key is stored in a file in the top directory, and keys are allocated in blocks.
Field Summary | |
---|---|
static int |
FILES_PER_DIRECTORY
|
static int |
KEY_BLOCK_SIZE
|
Constructor Summary | |
---|---|
FileContentStore(java.io.File store_root)
|
Method Summary | |
---|---|
int |
add(ContentInputStream data)
INTERNAL: Creates an entry for the specified data value. |
int |
add(java.io.InputStream data,
int length)
INTERNAL: Creates an entry for the specified data value. |
void |
close()
INTERNAL: Closes the content store. |
boolean |
containsKey(int key)
INTERNAL: Returns true if the content store contains an entry with the specified key. |
ContentInputStream |
get(int key)
INTERNAL: Gets the data value associated with the specified key. |
boolean |
remove(int key)
INTERNAL: Removes the entry associated with the key. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int FILES_PER_DIRECTORY
public static final int KEY_BLOCK_SIZE
Constructor Detail |
---|
public FileContentStore(java.io.File store_root) throws ContentStoreException
ContentStoreException
Method Detail |
---|
public boolean containsKey(int key) throws ContentStoreException
ContentStoreIF
containsKey
in interface ContentStoreIF
ContentStoreException
public ContentInputStream get(int key) throws ContentStoreException
ContentStoreIF
get
in interface ContentStoreIF
ContentStoreException
public int add(ContentInputStream data) throws ContentStoreException
ContentStoreIF
add
in interface ContentStoreIF
ContentStoreException
public int add(java.io.InputStream data, int length) throws ContentStoreException
ContentStoreIF
add
in interface ContentStoreIF
ContentStoreException
public boolean remove(int key) throws ContentStoreException
ContentStoreIF
remove
in interface ContentStoreIF
ContentStoreException
public void close() throws ContentStoreException
ContentStoreIF
close
in interface ContentStoreIF
ContentStoreException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |