|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgov.nih.nci.cagrid.introduce.servicetools.FilePersistenceHelper
public class FilePersistenceHelper
This helper contains common functions for managing persistent information stored as files.
| Field Summary | |
|---|---|
protected java.lang.Class |
beanClass
|
protected java.lang.String |
fileSuffix
|
protected java.io.File |
storageDir
|
| Constructor Summary | |
|---|---|
FilePersistenceHelper(java.lang.Class beanClass,
java.io.File storageDir,
java.lang.String suffix)
Creates FilePersistenceHelper with specific storage directory and file suffix. |
|
FilePersistenceHelper(java.lang.Class beanClass,
ServiceConfiguration configuration,
java.lang.String suffix)
Creates FilePersistenceHelper with default storage directory based on the beanClass name and specified suffix. |
|
FilePersistenceHelper(java.lang.Class beanClass,
java.lang.String storageDir,
java.lang.String suffix)
Creates FilePersistenceHelper with specific storage directory and file suffix. |
|
| Method Summary | |
|---|---|
static void |
createStorageDirectory(java.io.File dir)
Ensures the directory specified exists, is readable and writeable. |
java.lang.Class |
getBeanClass()
|
static java.io.File |
getDefaultStorageDirectory(java.io.File baseDir,
java.lang.Class beanClass)
|
java.lang.String |
getFileSuffix()
|
java.io.File |
getKeyAsFile(java.lang.Class clazz,
java.lang.Object key)
Create a file object based on the key supplied in parameter. |
java.io.File |
getStorageDirectory()
|
java.util.List |
list()
This function returns the keys of the objects that have been stored. |
void |
remove(java.lang.Class clazz,
java.lang.Object key)
|
void |
removeAll()
Removes all stored objects from file system. |
protected void |
setStorageDirectory(java.io.File dir)
|
protected void |
setStorageDirectory(java.lang.String strDir)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.Class beanClass
protected java.io.File storageDir
protected java.lang.String fileSuffix
| Constructor Detail |
|---|
public FilePersistenceHelper(java.lang.Class beanClass,
ServiceConfiguration configuration,
java.lang.String suffix)
throws java.io.IOException
java.io.IOException
public FilePersistenceHelper(java.lang.Class beanClass,
java.lang.String storageDir,
java.lang.String suffix)
throws java.io.IOException
java.io.IOException
public FilePersistenceHelper(java.lang.Class beanClass,
java.io.File storageDir,
java.lang.String suffix)
throws java.io.IOException
java.io.IOException| Method Detail |
|---|
public static java.io.File getDefaultStorageDirectory(java.io.File baseDir,
java.lang.Class beanClass)
throws java.io.IOException
java.io.IOException
public static void createStorageDirectory(java.io.File dir)
throws java.io.IOException
dir - the directory to create or check the permissions of
java.io.IOException - if failed to create the directory or if the directory exists
but has invalid permissions.
protected void setStorageDirectory(java.lang.String strDir)
throws java.io.IOException
java.io.IOException
protected void setStorageDirectory(java.io.File dir)
throws java.io.IOException
java.io.IOExceptionpublic java.io.File getStorageDirectory()
public java.lang.String getFileSuffix()
public java.lang.Class getBeanClass()
public java.io.File getKeyAsFile(java.lang.Class clazz,
java.lang.Object key)
file name :== (class name)_(key scalar value).xml
where:
key - the key of the object
public void remove(java.lang.Class clazz,
java.lang.Object key)
throws org.globus.wsrf.ResourceException
org.globus.wsrf.ResourceException
public java.util.List list()
throws java.lang.Exception
java.lang.Exception
public void removeAll()
throws java.lang.Exception
java.lang.Exception
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||