long timeout=type==Scope.SCOPE_CLIENT?cwi.getClientTimeout().getMillis():cwi.getSessionTimeout().getMillis();
long time = new DateTimeImpl(cwi).getTime()-timeout;
try {
// delete files that has expired
AndResourceFilter andFilter = new AndResourceFilter(new ResourceFilter[]{EXT_FILTER,new ExpiresFilter(time,true)});
String appName,cfid2,cfid;
Resource[] apps = dir.listResources(DIR_FILTER),cfidDir,files;
if(apps!=null)for(int a=0;a<apps.length;a++){
appName=StorageScopeFile.decode(apps[a].getName());