public abstract class CacheItem {
protected final String fileName;
public static CacheItem getInstance(PageContext pc, String id, String key, boolean useId, Resource dir, String cacheName, TimeSpan timespan) throws IOException{
HttpServletRequest req = pc. getHttpServletRequest();
Cache cache = Util.getCache(pc,cacheName,ConfigImpl.CACHE_DEFAULT_TEMPLATE,null);
if(cache!=null)
return new CacheItemCache(pc, req, id, key, useId, cache,timespan);
return new CacheItemFS(pc, req, id, key, useId, dir);
}