use of lucee.runtime.config.ConfigWebImpl in project Lucee by lucee.
the class SystemCacheClear method functionCache.
private static void functionCache(PageContext pc) {
ConfigWebImpl config = (ConfigWebImpl) pc.getConfig();
config.clearFunctionCache();
PagePoolClear.clear(config.getServerFunctionMapping());
PagePoolClear.clear(config.getFunctionMapping());
}
use of lucee.runtime.config.ConfigWebImpl in project Lucee by lucee.
the class RestInitApplication method _call.
public static String _call(PageContext pc, String dirPath, String serviceMapping, Boolean defaultMapping, String webAdminPassword) throws PageException {
if (StringUtil.isEmpty(serviceMapping, true)) {
serviceMapping = pc.getApplicationContext().getName();
}
Resource dir = RestDeleteApplication.toResource(pc, dirPath);
ConfigWebImpl config = (ConfigWebImpl) pc.getConfig();
Mapping[] mappings = config.getRestMappings();
Mapping mapping;
// id is mapping name
String virtual = serviceMapping.trim();
if (!virtual.startsWith("/"))
virtual = "/" + virtual;
if (!virtual.endsWith("/"))
virtual += "/";
boolean hasResetted = false;
for (int i = 0; i < mappings.length; i++) {
mapping = mappings[i];
if (mapping.getVirtualWithSlash().equals(virtual)) {
// directory has changed
if (!RestUtil.isMatch(pc, mapping, dir) || (defaultMapping != null && mapping.isDefault() != defaultMapping.booleanValue())) {
update(pc, dir, virtual, CacheUtil.getPassword(pc, webAdminPassword, false), defaultMapping == null ? mapping.isDefault() : defaultMapping.booleanValue());
}
mapping.reset(pc);
hasResetted = true;
}
}
if (!hasResetted) {
update(pc, dir, virtual, CacheUtil.getPassword(pc, webAdminPassword, false), defaultMapping == null ? false : defaultMapping.booleanValue());
}
return null;
}
Aggregations