org.ops4j.store
Class StoreFactory

java.lang.Object
  extended by org.ops4j.store.StoreFactory

public class StoreFactory
extends Object

Factory to create one or the other type of stores. Mostly deals with the fact if you really need your own store or can live with a shared instance. (better)

Author:
Toni Menzel

Constructor Summary
StoreFactory()
           
 
Method Summary
static Store<InputStream> anonymousStore()
          If the store must be unique, here is it.
static Store<InputStream> defaultStore()
          Get a default store instance.
static Store<InputStream> sharedLocalStore()
          Get a fixed folder on disk as store.
 
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

defaultStore

public static Store<InputStream> defaultStore()
Get a default store instance. If you don't know, and just need the store an input stream, use this one.

Returns:
sharedLocalStore()

sharedLocalStore

public static Store<InputStream> sharedLocalStore()
Get a fixed folder on disk as store. This way caches also survive multiple vm re-starts. Also saves disk space by just storing unique items once. Relevant folder will be: new File( System.getProperty( "java.io.tmpdir" ) + "/tb" }

Returns:
a store instance pointing to a local folder on disk.

anonymousStore

public static Store<InputStream> anonymousStore()
                                         throws IOException
If the store must be unique, here is it.

Returns:
unique storage
Throws:
IOException - in case no temp folder has been found.


Copyright © 2006-2013 OPS4J - Open Participation Software for Java. All Rights Reserved.