org.sapia.filestorm
Class StoreFactory

java.lang.Object
  extended by org.sapia.filestorm.StoreFactory

public class StoreFactory
extends Object

This class provides various factory methods used to instantiate Store instances.

Author:
yduchesne

Constructor Summary
StoreFactory()
           
 
Method Summary
static Store newCachingFileStore(File baseDir, Store delegate, int bufsize, long timeout)
          Creates an instance of the CachingFileStore class, with the given base directory.
static Store newFileStore(File baseDir, int bufsize)
          Creates an instance of the FileStore class, with the given base directory.
static Store newStoreClient(String url, int bufsize)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StoreFactory

public StoreFactory()
Method Detail

newFileStore

public static Store newFileStore(File baseDir,
                                 int bufsize)
                          throws IOException
Creates an instance of the FileStore class, with the given base directory. If the directory does not yet exist, it is created.

Parameters:
baseDir - the base directory of the file store that will be returned.
bufsize - the size of the buffer that is used to read/write file data.
Returns:
a Store
Throws:
IOException - if a problem occurred when creating the instance.
See Also:
FileStore.FileStore(File, int)

newCachingFileStore

public static Store newCachingFileStore(File baseDir,
                                        Store delegate,
                                        int bufsize,
                                        long timeout)
                                 throws IOException
Creates an instance of the CachingFileStore class, with the given base directory. If the directory does not yet exist, it is created.

Parameters:
baseDir - the base directory of the file store that will be returned.
bufsize - the size of the buffer that is used to read/write file data.
timeout - the maximum amount of time (int millis) that a given file is kept in cache until it is invalidated.
delegate - the delegate Store (that is hit when a file has been timed out or is not yet in cache).
Returns:
a Store
Throws:
IOException - if a problem occurred when creating the instance.
See Also:
CachingFileStore.CachingFileStore(File, Store, long, int)

newStoreClient

public static Store newStoreClient(String url,
                                   int bufsize)
                            throws IOException
Parameters:
url - the URL of the servlet to connect to.
bufsize - the size of the buffer that is used to read/write file data.
Returns:
a Store.
Throws:
IOException
See Also:
StoreClient.StoreClient(String, int)


Copyright © 2007 Sapia Open Community, Inc. All Rights Reserved.