public class ObjectStorageImpl extends Object implements ObjectStorage
Constructor and Description |
---|
ObjectStorageImpl() |
ObjectStorageImpl(String rootFolder) |
Modifier and Type | Method and Description |
---|---|
void |
clearObject(Serializable object)
清除某个对象
|
void |
clearObjects()
清除所有对象,会清除子目录
|
void |
clearObjects(String typeName)
清除某种类型所有对象
|
String |
getRootFolder()
返回文件根路径
|
List<Serializable> |
loadObjects()
载入所有对象
|
<T> List<T> |
loadObjects(String typeName)
载入指定类型的对象
|
void |
saveObject(Serializable object)
保存普通对象
|
void |
saveObject(Serializable object,
String typeName)
存储某种类型的文件
|
void |
setRootFolder(String rootFolder) |
public ObjectStorageImpl()
public ObjectStorageImpl(String rootFolder)
public String getRootFolder()
ObjectStorage
getRootFolder
in interface ObjectStorage
public void setRootFolder(String rootFolder)
public List<Serializable> loadObjects() throws IOException, ClassNotFoundException
ObjectStorage
loadObjects
in interface ObjectStorage
IOException
ClassNotFoundException
public <T> List<T> loadObjects(String typeName) throws IOException, ClassNotFoundException
ObjectStorage
loadObjects
in interface ObjectStorage
IOException
ClassNotFoundException
public void saveObject(Serializable object) throws IOException
ObjectStorage
saveObject
in interface ObjectStorage
IOException
public void saveObject(Serializable object, String typeName) throws IOException
ObjectStorage
saveObject
in interface ObjectStorage
IOException
public void clearObject(Serializable object)
ObjectStorage
clearObject
in interface ObjectStorage
public void clearObjects() throws IOException
ObjectStorage
clearObjects
in interface ObjectStorage
IOException
public void clearObjects(String typeName) throws IOException
ObjectStorage
clearObjects
in interface ObjectStorage
IOException
Copyright © 2006–2018 TinyGroup. All rights reserved.