public static <T> T getCache(String namespace, Class<T> clazz) throws IOException, ClassNotFoundException{
CacheItem<Serializable> item = cacheMap.get(namespace);
T t = null;
if(item == null){
File file = new File("c:/cache/" + namespace + ".txt");
if(file.exists()){
FileInputStream fileInputStream = new FileInputStream(file);
ObjectInputStream inputStream = new ObjectInputStream(fileInputStream);
t = (T) inputStream.readObject();
}
}
return t;
}
CacheItem<Serializable> item = cacheMap.get(namespace);
T t = null;
if(item == null){
File file = new File("c:/cache/" + namespace + ".txt");
if(file.exists()){
FileInputStream fileInputStream = new FileInputStream(file);
ObjectInputStream inputStream = new ObjectInputStream(fileInputStream);
t = (T) inputStream.readObject();
}
}
return t;
}