public class FilePersistence extends RamPersistence
objects, PERSISTENCE_NO_NAME, resources
Constructor and Description |
---|
FilePersistence(IScope scope)
Create file persistence object for given scope
|
FilePersistence(org.springframework.core.io.support.ResourcePatternResolver resolver)
Create file persistence object from given resource pattern resolver
|
Modifier and Type | Method and Description |
---|---|
protected void |
checkRemoveEmptyDirectories(String base)
Remove empty dirs
|
protected String |
getObjectPath(String id,
String name)
Get object path for given id and name
|
boolean |
load(IPersistable object)
Load state of an already instantiated persistent object.
|
IPersistable |
load(String name)
Load a persistent object with the given name.
|
void |
notifyClose()
Notify store that it's being closed.
|
boolean |
remove(IPersistable object)
Delete the passed persistent object.
|
boolean |
remove(String name)
Delete the persistent object with the given name.
|
boolean |
save(IPersistable object)
Persist given object.
|
protected boolean |
saveObject(IPersistable object)
Save persistable object
|
void |
setExtension(String extension)
Setter for extension.
|
void |
setPath(String path)
Setter for file path.
|
getObjectId, getObjectName, getObjectNames, getObjects
public FilePersistence(org.springframework.core.io.support.ResourcePatternResolver resolver)
resolver
- Resource pattern resolver and loaderpublic FilePersistence(IScope scope)
scope
- Scopepublic void setPath(String path)
path
- New pathpublic void setExtension(String extension)
extension
- New extension.protected String getObjectPath(String id, String name)
getObjectPath
in class RamPersistence
id
- Object ID. The format of the object id is name
- Object namepublic IPersistable load(String name)
load
in interface IPersistenceStore
load
in class RamPersistence
name
- the name of the object to loadnull
if no such object was
foundpublic boolean load(IPersistable object)
load
in interface IPersistenceStore
load
in class RamPersistence
object
- the object to initializprotected boolean saveObject(IPersistable object)
object
- Persistable objecttrue
on success, false
otherwisepublic boolean save(IPersistable object)
save
in interface IPersistenceStore
save
in class RamPersistence
object
- Object to storetrue
on success, false
otherwiseprotected void checkRemoveEmptyDirectories(String base)
base
- Base directorypublic boolean remove(String name)
remove
in interface IPersistenceStore
remove
in class RamPersistence
name
- the name of the object to deletetrue
if object was persisted and thus can be removed, false
otherwisepublic boolean remove(IPersistable object)
remove
in interface IPersistenceStore
remove
in class RamPersistence
object
- the object to deletetrue
if object was persisted and thus can be removed, false
otherwisepublic void notifyClose()
notifyClose
in interface IPersistenceStore
notifyClose
in class RamPersistence
Copyright © 2006-2012 The Red5 Project