?? postfilecache.java
字號:
package com.laoer.bbscs.sys;
import com.laoer.comm.util.*;
import com.laoer.bbscs.bean.*;
/**
* <p>Title: TianYi BBS</p>
*
* <p>Description: TianYi BBS System</p>
*
* <p>Copyright: Copyright (c) 2004</p>
*
* <p>Company: LAOER.COM/TIANYISOFT.NET</p>
*
* @author laoer
* @version 6.0
*/
public class PostFileCache {
public PostFileCache() {
}
public void pubPostFileInCache(Forum forum) {
String content = FileIO.readFile(SysUtil.getForumPath(forum.
getBoardID(), forum.getPostTime()) + forum.getDetail(),
Constant.CHARSET);
CacheManager.getCache(3).add(String.valueOf(forum.getId().longValue()),
content);
}
public String getPostFileFromCache(Forum forum) {
String content = (String) CacheManager.getCache(3).get(String.valueOf(forum.
getId().longValue()));
if (content == null) {
content = FileIO.readFile(SysUtil.getForumPath(forum.
getBoardID(), forum.getPostTime()) + forum.getDetail(),
Constant.CHARSET);
CacheManager.getCache(3).add(String.valueOf(forum.getId().longValue()),
content);
}
return content;
}
public void removePostFileFromCache(long postId) {
CacheManager.getCache(3).remove(String.valueOf(postId));
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -