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()
ObjectStoragegetRootFolder in interface ObjectStoragepublic void setRootFolder(String rootFolder)
public List<Serializable> loadObjects() throws IOException, ClassNotFoundException
ObjectStorageloadObjects in interface ObjectStorageIOExceptionClassNotFoundExceptionpublic <T> List<T> loadObjects(String typeName) throws IOException, ClassNotFoundException
ObjectStorageloadObjects in interface ObjectStorageIOExceptionClassNotFoundExceptionpublic void saveObject(Serializable object) throws IOException
ObjectStoragesaveObject in interface ObjectStorageIOExceptionpublic void saveObject(Serializable object, String typeName) throws IOException
ObjectStoragesaveObject in interface ObjectStorageIOExceptionpublic void clearObject(Serializable object)
ObjectStorageclearObject in interface ObjectStoragepublic void clearObjects()
throws IOException
ObjectStorageclearObjects in interface ObjectStorageIOExceptionpublic void clearObjects(String typeName) throws IOException
ObjectStorageclearObjects in interface ObjectStorageIOExceptionCopyright © 2006–2018 TinyGroup. All rights reserved.