org.lobobrowser.io
Interface ManagedStore


public interface ManagedStore

Represents client-side storage with quota restrictions. A clientlet engine will typically provide an instance of this interface per host. A manged store manages instances of ManagedFile. The path to a managed file is a Unix-style path, using forward slashes, with '/' representing the root directory of the managed store. So each managed store is similar to a small file system accessible only by a particular domain.

See Also:
ManagedFile, ClientletContext.getManagedStore()

Method Summary
 ManagedFile getManagedFile(ManagedFile parent, java.lang.String relativePath)
          Gets a ManagedFile relative to a given parent.
 ManagedFile getManagedFile(java.lang.String path)
          Gets a ManagedFile instance for the given managed path.
 long getQuota()
          Gets the managed store quota.
 ManagedFile getRootManagedDirectory()
          Gets the top-level directory of the managed store.
 long getSize()
          Gets an approximation of the number of bytes currently used up in the managed store.
 java.lang.Object retrieveObject(java.lang.String path)
          Deprecated. Use retrieveObject(String, ClassLoader).
 java.lang.Object retrieveObject(java.lang.String path, java.lang.ClassLoader classLoader)
          Retrieves a serializable object.
 void saveObject(java.lang.String path, java.io.Serializable object)
          Saves a serializable object at the given managed file path.
 

Method Detail

getManagedFile

ManagedFile getManagedFile(java.lang.String path)
                           throws java.io.IOException
Gets a ManagedFile instance for the given managed path. Directories in the path are separated by "/".

Throws:
java.io.IOException

getManagedFile

ManagedFile getManagedFile(ManagedFile parent,
                           java.lang.String relativePath)
                           throws java.io.IOException
Gets a ManagedFile relative to a given parent. Directories in the relative path are separated by "/".

Throws:
java.io.IOException

getRootManagedDirectory

ManagedFile getRootManagedDirectory()
                                    throws java.io.IOException
Gets the top-level directory of the managed store.

Throws:
java.io.IOException

getQuota

long getQuota()
Gets the managed store quota.


getSize

long getSize()
             throws java.io.IOException
Gets an approximation of the number of bytes currently used up in the managed store.

Throws:
java.io.IOException

saveObject

void saveObject(java.lang.String path,
                java.io.Serializable object)
                throws java.io.IOException
Saves a serializable object at the given managed file path.

Throws:
java.io.IOException

retrieveObject

java.lang.Object retrieveObject(java.lang.String path,
                                java.lang.ClassLoader classLoader)
                                throws java.io.IOException,
                                       java.lang.ClassNotFoundException
Retrieves a serializable object. If the file identified by path does not exist, this method returns null.

Parameters:
path - Managed path to the object file.
classLoader - A class loader that can load the expected object type.
Returns:
An object unserialized from managed file data.
Throws:
java.io.IOException
java.lang.ClassNotFoundException

retrieveObject

java.lang.Object retrieveObject(java.lang.String path)
                                throws java.io.IOException,
                                       java.lang.ClassNotFoundException
Deprecated. Use retrieveObject(String, ClassLoader).

Throws:
java.io.IOException
java.lang.ClassNotFoundException


SourceForge.net LogoCopyright © 2005, 2006, 2007 The Lobo Project. All Rights Reserved.
[Lobo Home]