id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1 value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
30,300 | lucee/Lucee | core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java | XMLConfigAdmin.updateSessionManagement | public void updateSessionManagement(Boolean sessionManagement) throws SecurityException {
checkWriteAccess();
boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING);
if (!hasAccess) throw new SecurityException("no access to update scope setting");
Element scope = _getRootElement("scope");
scope.setAttribute("sessionmanagement", Caster.toString(sessionManagement, ""));
} | java | public void updateSessionManagement(Boolean sessionManagement) throws SecurityException {
checkWriteAccess();
boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING);
if (!hasAccess) throw new SecurityException("no access to update scope setting");
Element scope = _getRootElement("scope");
scope.setAttribute("sessionmanagement", Caster.toString(sessionManagement, ""));
} | [
"public",
"void",
"updateSessionManagement",
"(",
"Boolean",
"sessionManagement",
")",
"throws",
"SecurityException",
"{",
"checkWriteAccess",
"(",
")",
";",
"boolean",
"hasAccess",
"=",
"ConfigWebUtil",
".",
"hasAccess",
"(",
"config",
",",
"SecurityManager",
".",
... | enable or desable session management
@param sessionManagement
@throws SecurityException | [
"enable",
"or",
"desable",
"session",
"management"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java#L2786-L2794 |
30,301 | lucee/Lucee | core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java | XMLConfigAdmin.updateClientManagement | public void updateClientManagement(Boolean clientManagement) throws SecurityException {
checkWriteAccess();
boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING);
if (!hasAccess) throw new SecurityException("no access to update scope setting");
Element scope = _getRootElement("scope");
scope.setAttribute("clientmanagement", Caster.toString(clientManagement, ""));
} | java | public void updateClientManagement(Boolean clientManagement) throws SecurityException {
checkWriteAccess();
boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING);
if (!hasAccess) throw new SecurityException("no access to update scope setting");
Element scope = _getRootElement("scope");
scope.setAttribute("clientmanagement", Caster.toString(clientManagement, ""));
} | [
"public",
"void",
"updateClientManagement",
"(",
"Boolean",
"clientManagement",
")",
"throws",
"SecurityException",
"{",
"checkWriteAccess",
"(",
")",
";",
"boolean",
"hasAccess",
"=",
"ConfigWebUtil",
".",
"hasAccess",
"(",
"config",
",",
"SecurityManager",
".",
"T... | enable or desable client management
@param clientManagement
@throws SecurityException | [
"enable",
"or",
"desable",
"client",
"management"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java#L2802-L2810 |
30,302 | lucee/Lucee | core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java | XMLConfigAdmin.updateClientCookies | public void updateClientCookies(Boolean clientCookies) throws SecurityException {
checkWriteAccess();
boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING);
if (!hasAccess) throw new SecurityException("no access to update scope setting");
Element scope = _getRootElement("scope");
scope.setAttribute("setclientcookies", Caster.toString(clientCookies, ""));
} | java | public void updateClientCookies(Boolean clientCookies) throws SecurityException {
checkWriteAccess();
boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING);
if (!hasAccess) throw new SecurityException("no access to update scope setting");
Element scope = _getRootElement("scope");
scope.setAttribute("setclientcookies", Caster.toString(clientCookies, ""));
} | [
"public",
"void",
"updateClientCookies",
"(",
"Boolean",
"clientCookies",
")",
"throws",
"SecurityException",
"{",
"checkWriteAccess",
"(",
")",
";",
"boolean",
"hasAccess",
"=",
"ConfigWebUtil",
".",
"hasAccess",
"(",
"config",
",",
"SecurityManager",
".",
"TYPE_SE... | set if client cookies are enabled or not
@param clientCookies
@throws SecurityException | [
"set",
"if",
"client",
"cookies",
"are",
"enabled",
"or",
"not"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java#L2818-L2825 |
30,303 | lucee/Lucee | core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java | XMLConfigAdmin.updateMode | public void updateMode(Boolean developmode) throws SecurityException {
checkWriteAccess();
boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING);
if (!hasAccess) throw new SecurityException("no access to update scope setting");
Element mode = _getRootElement("mode");
mode.setAttribute("develop", Caster.toString(developmode, ""));
} | java | public void updateMode(Boolean developmode) throws SecurityException {
checkWriteAccess();
boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING);
if (!hasAccess) throw new SecurityException("no access to update scope setting");
Element mode = _getRootElement("mode");
mode.setAttribute("develop", Caster.toString(developmode, ""));
} | [
"public",
"void",
"updateMode",
"(",
"Boolean",
"developmode",
")",
"throws",
"SecurityException",
"{",
"checkWriteAccess",
"(",
")",
";",
"boolean",
"hasAccess",
"=",
"ConfigWebUtil",
".",
"hasAccess",
"(",
"config",
",",
"SecurityManager",
".",
"TYPE_SETTING",
"... | set if it's develop mode or not
@param developmode
@throws SecurityException | [
"set",
"if",
"it",
"s",
"develop",
"mode",
"or",
"not"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java#L2833-L2840 |
30,304 | lucee/Lucee | core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java | XMLConfigAdmin.updateDomaincookies | public void updateDomaincookies(Boolean domainCookies) throws SecurityException {
checkWriteAccess();
boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING);
if (!hasAccess) throw new SecurityException("no access to update scope setting");
Element scope = _getRootElement("scope");
scope.setAttribute("setdomaincookies", Caster.toString(domainCookies, ""));
} | java | public void updateDomaincookies(Boolean domainCookies) throws SecurityException {
checkWriteAccess();
boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING);
if (!hasAccess) throw new SecurityException("no access to update scope setting");
Element scope = _getRootElement("scope");
scope.setAttribute("setdomaincookies", Caster.toString(domainCookies, ""));
} | [
"public",
"void",
"updateDomaincookies",
"(",
"Boolean",
"domainCookies",
")",
"throws",
"SecurityException",
"{",
"checkWriteAccess",
"(",
")",
";",
"boolean",
"hasAccess",
"=",
"ConfigWebUtil",
".",
"hasAccess",
"(",
"config",
",",
"SecurityManager",
".",
"TYPE_SE... | set if domain cookies are enabled or not
@param domainCookies
@throws SecurityException | [
"set",
"if",
"domain",
"cookies",
"are",
"enabled",
"or",
"not"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java#L2848-L2855 |
30,305 | lucee/Lucee | core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java | XMLConfigAdmin.updateLocale | public void updateLocale(String locale) throws SecurityException {
checkWriteAccess();
boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING);
if (!hasAccess) throw new SecurityException("no access to update regional setting");
Element scope = _getRootElement("regional");
scope.setAttribute("locale", locale.trim());
} | java | public void updateLocale(String locale) throws SecurityException {
checkWriteAccess();
boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING);
if (!hasAccess) throw new SecurityException("no access to update regional setting");
Element scope = _getRootElement("regional");
scope.setAttribute("locale", locale.trim());
} | [
"public",
"void",
"updateLocale",
"(",
"String",
"locale",
")",
"throws",
"SecurityException",
"{",
"checkWriteAccess",
"(",
")",
";",
"boolean",
"hasAccess",
"=",
"ConfigWebUtil",
".",
"hasAccess",
"(",
"config",
",",
"SecurityManager",
".",
"TYPE_SETTING",
")",
... | update the locale
@param locale
@throws SecurityException | [
"update",
"the",
"locale"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java#L2863-L2870 |
30,306 | lucee/Lucee | core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java | XMLConfigAdmin.updateTimeZone | public void updateTimeZone(String timeZone) throws SecurityException {
checkWriteAccess();
boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING);
if (!hasAccess) throw new SecurityException("no access to update regional setting");
Element regional = _getRootElement("regional");
regional.setAttribute("timezone", timeZone.trim());
} | java | public void updateTimeZone(String timeZone) throws SecurityException {
checkWriteAccess();
boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING);
if (!hasAccess) throw new SecurityException("no access to update regional setting");
Element regional = _getRootElement("regional");
regional.setAttribute("timezone", timeZone.trim());
} | [
"public",
"void",
"updateTimeZone",
"(",
"String",
"timeZone",
")",
"throws",
"SecurityException",
"{",
"checkWriteAccess",
"(",
")",
";",
"boolean",
"hasAccess",
"=",
"ConfigWebUtil",
".",
"hasAccess",
"(",
"config",
",",
"SecurityManager",
".",
"TYPE_SETTING",
"... | update the timeZone
@param timeZone
@throws SecurityException | [
"update",
"the",
"timeZone"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java#L2910-L2918 |
30,307 | lucee/Lucee | core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java | XMLConfigAdmin.updateTimeServer | public void updateTimeServer(String timeServer, Boolean useTimeServer) throws PageException {
checkWriteAccess();
if (useTimeServer != null && useTimeServer.booleanValue() && !StringUtil.isEmpty(timeServer, true)) {
try {
new NtpClient(timeServer).getOffset();
}
catch (IOException e) {
try {
new NtpClient(timeServer).getOffset();
}
catch (IOException ee) {
throw Caster.toPageException(ee);
}
}
}
boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING);
if (!hasAccess) throw new SecurityException("no access to update regional setting");
Element scope = _getRootElement("regional");
scope.setAttribute("timeserver", timeServer.trim());
if (useTimeServer != null) scope.setAttribute("use-timeserver", Caster.toString(useTimeServer));
else scope.removeAttribute("use-timeserver");
} | java | public void updateTimeServer(String timeServer, Boolean useTimeServer) throws PageException {
checkWriteAccess();
if (useTimeServer != null && useTimeServer.booleanValue() && !StringUtil.isEmpty(timeServer, true)) {
try {
new NtpClient(timeServer).getOffset();
}
catch (IOException e) {
try {
new NtpClient(timeServer).getOffset();
}
catch (IOException ee) {
throw Caster.toPageException(ee);
}
}
}
boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING);
if (!hasAccess) throw new SecurityException("no access to update regional setting");
Element scope = _getRootElement("regional");
scope.setAttribute("timeserver", timeServer.trim());
if (useTimeServer != null) scope.setAttribute("use-timeserver", Caster.toString(useTimeServer));
else scope.removeAttribute("use-timeserver");
} | [
"public",
"void",
"updateTimeServer",
"(",
"String",
"timeServer",
",",
"Boolean",
"useTimeServer",
")",
"throws",
"PageException",
"{",
"checkWriteAccess",
"(",
")",
";",
"if",
"(",
"useTimeServer",
"!=",
"null",
"&&",
"useTimeServer",
".",
"booleanValue",
"(",
... | update the timeServer
@param timeServer
@param useTimeServer
@throws PageException | [
"update",
"the",
"timeServer"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java#L2927-L2950 |
30,308 | lucee/Lucee | core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java | XMLConfigAdmin.updateBaseComponent | public void updateBaseComponent(String baseComponentCFML, String baseComponentLucee) throws SecurityException {
checkWriteAccess();
boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING);
if (!hasAccess) throw new SecurityException("no access to update component setting");
// config.resetBaseComponentPage();
Element scope = _getRootElement("component");
// if(baseComponent.trim().length()>0)
scope.removeAttribute("base");
scope.setAttribute("base-cfml", baseComponentCFML);
scope.setAttribute("base-lucee", baseComponentLucee);
} | java | public void updateBaseComponent(String baseComponentCFML, String baseComponentLucee) throws SecurityException {
checkWriteAccess();
boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING);
if (!hasAccess) throw new SecurityException("no access to update component setting");
// config.resetBaseComponentPage();
Element scope = _getRootElement("component");
// if(baseComponent.trim().length()>0)
scope.removeAttribute("base");
scope.setAttribute("base-cfml", baseComponentCFML);
scope.setAttribute("base-lucee", baseComponentLucee);
} | [
"public",
"void",
"updateBaseComponent",
"(",
"String",
"baseComponentCFML",
",",
"String",
"baseComponentLucee",
")",
"throws",
"SecurityException",
"{",
"checkWriteAccess",
"(",
")",
";",
"boolean",
"hasAccess",
"=",
"ConfigWebUtil",
".",
"hasAccess",
"(",
"config",... | update the baseComponent
@param baseComponent
@throws SecurityException | [
"update",
"the",
"baseComponent"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java#L2958-L2968 |
30,309 | lucee/Lucee | core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java | XMLConfigAdmin.updateDebug | public void updateDebug(Boolean debug, Boolean database, Boolean exception, Boolean tracing, Boolean dump, Boolean timer, Boolean implicitAccess, Boolean queryUsage)
throws SecurityException {
checkWriteAccess();
boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_DEBUGGING);
if (!hasAccess) throw new SecurityException("no access to change debugging settings");
Element debugging = _getRootElement("debugging");
if (debug != null) debugging.setAttribute("debug", Caster.toString(debug.booleanValue()));
else debugging.removeAttribute("debug");
if (database != null) debugging.setAttribute("database", Caster.toString(database.booleanValue()));
else debugging.removeAttribute("database");
if (exception != null) debugging.setAttribute("exception", Caster.toString(exception.booleanValue()));
else debugging.removeAttribute("exception");
if (tracing != null) debugging.setAttribute("tracing", Caster.toString(tracing.booleanValue()));
else debugging.removeAttribute("tracing");
if (dump != null) debugging.setAttribute("dump", Caster.toString(dump.booleanValue()));
else debugging.removeAttribute("dump");
if (timer != null) debugging.setAttribute("timer", Caster.toString(timer.booleanValue()));
else debugging.removeAttribute("timer");
if (implicitAccess != null) debugging.setAttribute("implicit-access", Caster.toString(implicitAccess.booleanValue()));
else debugging.removeAttribute("implicit-access");
if (queryUsage != null) debugging.setAttribute("query-usage", Caster.toString(queryUsage.booleanValue()));
else debugging.removeAttribute("query-usage");
} | java | public void updateDebug(Boolean debug, Boolean database, Boolean exception, Boolean tracing, Boolean dump, Boolean timer, Boolean implicitAccess, Boolean queryUsage)
throws SecurityException {
checkWriteAccess();
boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_DEBUGGING);
if (!hasAccess) throw new SecurityException("no access to change debugging settings");
Element debugging = _getRootElement("debugging");
if (debug != null) debugging.setAttribute("debug", Caster.toString(debug.booleanValue()));
else debugging.removeAttribute("debug");
if (database != null) debugging.setAttribute("database", Caster.toString(database.booleanValue()));
else debugging.removeAttribute("database");
if (exception != null) debugging.setAttribute("exception", Caster.toString(exception.booleanValue()));
else debugging.removeAttribute("exception");
if (tracing != null) debugging.setAttribute("tracing", Caster.toString(tracing.booleanValue()));
else debugging.removeAttribute("tracing");
if (dump != null) debugging.setAttribute("dump", Caster.toString(dump.booleanValue()));
else debugging.removeAttribute("dump");
if (timer != null) debugging.setAttribute("timer", Caster.toString(timer.booleanValue()));
else debugging.removeAttribute("timer");
if (implicitAccess != null) debugging.setAttribute("implicit-access", Caster.toString(implicitAccess.booleanValue()));
else debugging.removeAttribute("implicit-access");
if (queryUsage != null) debugging.setAttribute("query-usage", Caster.toString(queryUsage.booleanValue()));
else debugging.removeAttribute("query-usage");
} | [
"public",
"void",
"updateDebug",
"(",
"Boolean",
"debug",
",",
"Boolean",
"database",
",",
"Boolean",
"exception",
",",
"Boolean",
"tracing",
",",
"Boolean",
"dump",
",",
"Boolean",
"timer",
",",
"Boolean",
"implicitAccess",
",",
"Boolean",
"queryUsage",
")",
... | updates if debugging or not
@param debug if value is null server setting is used
@throws SecurityException | [
"updates",
"if",
"debugging",
"or",
"not"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java#L3076-L3107 |
30,310 | lucee/Lucee | core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java | XMLConfigAdmin.updateErrorTemplate | public void updateErrorTemplate(int statusCode, String template) throws SecurityException {
checkWriteAccess();
boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_DEBUGGING);
if (!hasAccess) throw new SecurityException("no access to change error settings");
Element error = _getRootElement("error");
// if(template.trim().length()>0)
error.setAttribute("template-" + statusCode, template);
} | java | public void updateErrorTemplate(int statusCode, String template) throws SecurityException {
checkWriteAccess();
boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_DEBUGGING);
if (!hasAccess) throw new SecurityException("no access to change error settings");
Element error = _getRootElement("error");
// if(template.trim().length()>0)
error.setAttribute("template-" + statusCode, template);
} | [
"public",
"void",
"updateErrorTemplate",
"(",
"int",
"statusCode",
",",
"String",
"template",
")",
"throws",
"SecurityException",
"{",
"checkWriteAccess",
"(",
")",
";",
"boolean",
"hasAccess",
"=",
"ConfigWebUtil",
".",
"hasAccess",
"(",
"config",
",",
"SecurityM... | updates the ErrorTemplate
@param template
@throws SecurityException | [
"updates",
"the",
"ErrorTemplate"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java#L3131-L3139 |
30,311 | lucee/Lucee | core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java | XMLConfigAdmin.updateSessionType | public void updateSessionType(String type) throws SecurityException {
checkWriteAccess();
boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING);
if (!hasAccess) throw new SecurityException("no access to update scope setting");
type = type.toLowerCase().trim();
Element scope = _getRootElement("scope");
scope.setAttribute("session-type", type);
} | java | public void updateSessionType(String type) throws SecurityException {
checkWriteAccess();
boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING);
if (!hasAccess) throw new SecurityException("no access to update scope setting");
type = type.toLowerCase().trim();
Element scope = _getRootElement("scope");
scope.setAttribute("session-type", type);
} | [
"public",
"void",
"updateSessionType",
"(",
"String",
"type",
")",
"throws",
"SecurityException",
"{",
"checkWriteAccess",
"(",
")",
";",
"boolean",
"hasAccess",
"=",
"ConfigWebUtil",
".",
"hasAccess",
"(",
"config",
",",
"SecurityManager",
".",
"TYPE_SETTING",
")... | session type update
@param type
@throws SecurityException | [
"session",
"type",
"update"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java#L3390-L3399 |
30,312 | lucee/Lucee | core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java | XMLConfigAdmin.updateUpdate | public void updateUpdate(String type, String location) throws SecurityException {
checkWriteAccess();
if (!(config instanceof ConfigServer)) {
throw new SecurityException("can't change update setting from this context, access is denied");
}
Element update = _getRootElement("update");
update.setAttribute("type", type);
try {
location = HTTPUtil.toURL(location, true).toString();
}
catch (Throwable e) {
ExceptionUtil.rethrowIfNecessary(e);
}
update.setAttribute("location", location);
} | java | public void updateUpdate(String type, String location) throws SecurityException {
checkWriteAccess();
if (!(config instanceof ConfigServer)) {
throw new SecurityException("can't change update setting from this context, access is denied");
}
Element update = _getRootElement("update");
update.setAttribute("type", type);
try {
location = HTTPUtil.toURL(location, true).toString();
}
catch (Throwable e) {
ExceptionUtil.rethrowIfNecessary(e);
}
update.setAttribute("location", location);
} | [
"public",
"void",
"updateUpdate",
"(",
"String",
"type",
",",
"String",
"location",
")",
"throws",
"SecurityException",
"{",
"checkWriteAccess",
"(",
")",
";",
"if",
"(",
"!",
"(",
"config",
"instanceof",
"ConfigServer",
")",
")",
"{",
"throw",
"new",
"Secur... | updates update settingd for Lucee
@param type
@param location
@throws SecurityException | [
"updates",
"update",
"settingd",
"for",
"Lucee"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java#L3442-L3457 |
30,313 | lucee/Lucee | core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java | XMLConfigAdmin.removeSecurityManager | public void removeSecurityManager(Password password, String id) throws PageException {
checkWriteAccess();
((ConfigServerImpl) ConfigImpl.getConfigServer(config, password)).removeSecurityManager(id);
Element security = _getRootElement("security");
Element[] children = XMLConfigWebFactory.getChildren(security, "accessor");
for (int i = 0; i < children.length; i++) {
if (id.equals(children[i].getAttribute("id"))) {
security.removeChild(children[i]);
}
}
} | java | public void removeSecurityManager(Password password, String id) throws PageException {
checkWriteAccess();
((ConfigServerImpl) ConfigImpl.getConfigServer(config, password)).removeSecurityManager(id);
Element security = _getRootElement("security");
Element[] children = XMLConfigWebFactory.getChildren(security, "accessor");
for (int i = 0; i < children.length; i++) {
if (id.equals(children[i].getAttribute("id"))) {
security.removeChild(children[i]);
}
}
} | [
"public",
"void",
"removeSecurityManager",
"(",
"Password",
"password",
",",
"String",
"id",
")",
"throws",
"PageException",
"{",
"checkWriteAccess",
"(",
")",
";",
"(",
"(",
"ConfigServerImpl",
")",
"ConfigImpl",
".",
"getConfigServer",
"(",
"config",
",",
"pas... | remove security manager matching given id
@param id
@throws PageException | [
"remove",
"security",
"manager",
"matching",
"given",
"id"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java#L3516-L3528 |
30,314 | lucee/Lucee | core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java | XMLConfigAdmin.runUpdate | public void runUpdate(Password password) throws PageException {
checkWriteAccess();
ConfigServerImpl cs = (ConfigServerImpl) ConfigImpl.getConfigServer(config, password);
CFMLEngineFactory factory = cs.getCFMLEngine().getCFMLEngineFactory();
synchronized (factory) {
try {
cleanUp(factory);
factory.update(cs.getPassword(), cs.getIdentification());
}
catch (Exception e) {
throw Caster.toPageException(e);
}
}
} | java | public void runUpdate(Password password) throws PageException {
checkWriteAccess();
ConfigServerImpl cs = (ConfigServerImpl) ConfigImpl.getConfigServer(config, password);
CFMLEngineFactory factory = cs.getCFMLEngine().getCFMLEngineFactory();
synchronized (factory) {
try {
cleanUp(factory);
factory.update(cs.getPassword(), cs.getIdentification());
}
catch (Exception e) {
throw Caster.toPageException(e);
}
}
} | [
"public",
"void",
"runUpdate",
"(",
"Password",
"password",
")",
"throws",
"PageException",
"{",
"checkWriteAccess",
"(",
")",
";",
"ConfigServerImpl",
"cs",
"=",
"(",
"ConfigServerImpl",
")",
"ConfigImpl",
".",
"getConfigServer",
"(",
"config",
",",
"password",
... | run update from cfml engine
@throws PageException | [
"run",
"update",
"from",
"cfml",
"engine"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java#L3535-L3550 |
30,315 | lucee/Lucee | core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java | XMLConfigAdmin.hasRHExtensions | public static RHExtension hasRHExtensions(ConfigImpl config, ExtensionDefintion ed) throws PageException, SAXException, IOException {
XMLConfigAdmin admin = new XMLConfigAdmin(config, null);
return admin._hasRHExtensions(config, ed);
} | java | public static RHExtension hasRHExtensions(ConfigImpl config, ExtensionDefintion ed) throws PageException, SAXException, IOException {
XMLConfigAdmin admin = new XMLConfigAdmin(config, null);
return admin._hasRHExtensions(config, ed);
} | [
"public",
"static",
"RHExtension",
"hasRHExtensions",
"(",
"ConfigImpl",
"config",
",",
"ExtensionDefintion",
"ed",
")",
"throws",
"PageException",
",",
"SAXException",
",",
"IOException",
"{",
"XMLConfigAdmin",
"admin",
"=",
"new",
"XMLConfigAdmin",
"(",
"config",
... | returns the version if the extension is available
@param config
@param id
@return
@throws PageException
@throws IOException
@throws SAXException | [
"returns",
"the",
"version",
"if",
"the",
"extension",
"is",
"available"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java#L6277-L6280 |
30,316 | lucee/Lucee | core/src/main/java/lucee/runtime/functions/other/IsNull.java | IsNull.call | public static boolean call(PageContext pc, String str) {
try {
return pc.evaluate(str) == null;
}
catch (PageException e) {
return true;
}
} | java | public static boolean call(PageContext pc, String str) {
try {
return pc.evaluate(str) == null;
}
catch (PageException e) {
return true;
}
} | [
"public",
"static",
"boolean",
"call",
"(",
"PageContext",
"pc",
",",
"String",
"str",
")",
"{",
"try",
"{",
"return",
"pc",
".",
"evaluate",
"(",
"str",
")",
"==",
"null",
";",
"}",
"catch",
"(",
"PageException",
"e",
")",
"{",
"return",
"true",
";"... | called by modifed call from translation time evaluator | [
"called",
"by",
"modifed",
"call",
"from",
"translation",
"time",
"evaluator"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/functions/other/IsNull.java#L34-L42 |
30,317 | lucee/Lucee | core/src/main/java/lucee/runtime/tag/Lock.java | Lock.setTimeout | public void setTimeout(Object oTimeout) throws PageException {
if (oTimeout instanceof TimeSpan) this.timeoutInMillis = toInt(((TimeSpan) oTimeout).getMillis());
else this.timeoutInMillis = toInt(Caster.toDoubleValue(oTimeout) * 1000D);
// print.out(Caster.toString(timeoutInMillis));
} | java | public void setTimeout(Object oTimeout) throws PageException {
if (oTimeout instanceof TimeSpan) this.timeoutInMillis = toInt(((TimeSpan) oTimeout).getMillis());
else this.timeoutInMillis = toInt(Caster.toDoubleValue(oTimeout) * 1000D);
// print.out(Caster.toString(timeoutInMillis));
} | [
"public",
"void",
"setTimeout",
"(",
"Object",
"oTimeout",
")",
"throws",
"PageException",
"{",
"if",
"(",
"oTimeout",
"instanceof",
"TimeSpan",
")",
"this",
".",
"timeoutInMillis",
"=",
"toInt",
"(",
"(",
"(",
"TimeSpan",
")",
"oTimeout",
")",
".",
"getMill... | set the value timeout Specifies the maximum amount of time, in seconds, to wait to obtain a lock.
If a lock can be obtained within the specified period, execution continues inside the body of the
tag. Otherwise, the behavior depends on the value of the throwOnTimeout attribute.
@param timeout value to set | [
"set",
"the",
"value",
"timeout",
"Specifies",
"the",
"maximum",
"amount",
"of",
"time",
"in",
"seconds",
"to",
"wait",
"to",
"obtain",
"a",
"lock",
".",
"If",
"a",
"lock",
"can",
"be",
"obtained",
"within",
"the",
"specified",
"period",
"execution",
"cont... | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/tag/Lock.java#L131-L135 |
30,318 | lucee/Lucee | core/src/main/java/lucee/runtime/tag/Lock.java | Lock.setName | public void setName(String name) throws ApplicationException {
if (name == null) return;
this.name = name.trim();
if (name.length() == 0) throw new ApplicationException("invalid attribute definition", "attribute [name] can't be a empty string");
} | java | public void setName(String name) throws ApplicationException {
if (name == null) return;
this.name = name.trim();
if (name.length() == 0) throw new ApplicationException("invalid attribute definition", "attribute [name] can't be a empty string");
} | [
"public",
"void",
"setName",
"(",
"String",
"name",
")",
"throws",
"ApplicationException",
"{",
"if",
"(",
"name",
"==",
"null",
")",
"return",
";",
"this",
".",
"name",
"=",
"name",
".",
"trim",
"(",
")",
";",
"if",
"(",
"name",
".",
"length",
"(",
... | set the value name
@param name value to set
@throws ApplicationException | [
"set",
"the",
"value",
"name"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/tag/Lock.java#L195-L199 |
30,319 | lucee/Lucee | core/src/main/java/lucee/commons/io/res/util/ResourceSnippet.java | ResourceSnippet.createResourceSnippet | public static ResourceSnippet createResourceSnippet(InputStream is, int startChar, int endChar, String charset) {
return createResourceSnippet(getContents(is, charset), startChar, endChar);
} | java | public static ResourceSnippet createResourceSnippet(InputStream is, int startChar, int endChar, String charset) {
return createResourceSnippet(getContents(is, charset), startChar, endChar);
} | [
"public",
"static",
"ResourceSnippet",
"createResourceSnippet",
"(",
"InputStream",
"is",
",",
"int",
"startChar",
",",
"int",
"endChar",
",",
"String",
"charset",
")",
"{",
"return",
"createResourceSnippet",
"(",
"getContents",
"(",
"is",
",",
"charset",
")",
"... | extract a ResourceSnippet from InputStream at the given char positions
@param is - InputStream of the Resource
@param startChar - start position of the snippet
@param endChar - end position of the snippet
@param charset - use server's charset, default should be UTF-8
@return | [
"extract",
"a",
"ResourceSnippet",
"from",
"InputStream",
"at",
"the",
"given",
"char",
"positions"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/io/res/util/ResourceSnippet.java#L106-L109 |
30,320 | lucee/Lucee | core/src/main/java/lucee/commons/io/res/util/ResourceSnippet.java | ResourceSnippet.createResourceSnippet | public static ResourceSnippet createResourceSnippet(Resource res, int startChar, int endChar, String charset) {
try {
return createResourceSnippet(res.getInputStream(), startChar, endChar, charset);
}
catch (IOException ex) {
return ResourceSnippet.Empty;
}
} | java | public static ResourceSnippet createResourceSnippet(Resource res, int startChar, int endChar, String charset) {
try {
return createResourceSnippet(res.getInputStream(), startChar, endChar, charset);
}
catch (IOException ex) {
return ResourceSnippet.Empty;
}
} | [
"public",
"static",
"ResourceSnippet",
"createResourceSnippet",
"(",
"Resource",
"res",
",",
"int",
"startChar",
",",
"int",
"endChar",
",",
"String",
"charset",
")",
"{",
"try",
"{",
"return",
"createResourceSnippet",
"(",
"res",
".",
"getInputStream",
"(",
")"... | extract a ResourceSnippet from a Resource at the given char positions
@param res - Resource from which to extract the snippet
@param startChar - start position of the snippet
@param endChar - end position of the snippet
@param charset - use server's charset, default should be UTF-8
@return | [
"extract",
"a",
"ResourceSnippet",
"from",
"a",
"Resource",
"at",
"the",
"given",
"char",
"positions"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/io/res/util/ResourceSnippet.java#L120-L130 |
30,321 | lucee/Lucee | core/src/main/java/lucee/commons/io/res/util/ResourceSnippet.java | ResourceSnippet.getLineNumber | public static int getLineNumber(String text, int posChar) {
int len = Math.min(posChar, text.length());
int result = 1;
for (int i = 0; i < len; i++) {
if (text.charAt(i) == '\n') result++;
}
return result;
} | java | public static int getLineNumber(String text, int posChar) {
int len = Math.min(posChar, text.length());
int result = 1;
for (int i = 0; i < len; i++) {
if (text.charAt(i) == '\n') result++;
}
return result;
} | [
"public",
"static",
"int",
"getLineNumber",
"(",
"String",
"text",
",",
"int",
"posChar",
")",
"{",
"int",
"len",
"=",
"Math",
".",
"min",
"(",
"posChar",
",",
"text",
".",
"length",
"(",
")",
")",
";",
"int",
"result",
"=",
"1",
";",
"for",
"(",
... | returns the line number of the given char in the text | [
"returns",
"the",
"line",
"number",
"of",
"the",
"given",
"char",
"in",
"the",
"text"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/io/res/util/ResourceSnippet.java#L133-L144 |
30,322 | lucee/Lucee | core/src/main/java/lucee/runtime/cache/CacheUtil.java | CacheUtil.getPassword | public static Password getPassword(PageContext pc, String password, boolean server) throws lucee.runtime.exp.SecurityException { // TODO: move this to a utility class in a more
// generic package?
// no password passed
if (StringUtil.isEmpty(password, true)) {
ApplicationContext appContext = pc.getApplicationContext();
if (appContext instanceof ModernApplicationContext) password = Caster.toString(((ModernApplicationContext) appContext).getCustom(KeyConstants._webAdminPassword), "");
}
else password = password.trim();
if (StringUtil.isEmpty(password, true)) throw new lucee.runtime.exp.SecurityException(
"A Web Admin Password is required to manipulate Cache connections. " + "You can either pass the password as an argument to this function, or set it in "
+ (pc.getRequestDialect() == CFMLEngine.DIALECT_CFML ? Constants.CFML_APPLICATION_EVENT_HANDLER : Constants.LUCEE_APPLICATION_EVENT_HANDLER)
+ " with the variable [this.webAdminPassword].");
return PasswordImpl.passwordToCompare(pc.getConfig(), server, password);
} | java | public static Password getPassword(PageContext pc, String password, boolean server) throws lucee.runtime.exp.SecurityException { // TODO: move this to a utility class in a more
// generic package?
// no password passed
if (StringUtil.isEmpty(password, true)) {
ApplicationContext appContext = pc.getApplicationContext();
if (appContext instanceof ModernApplicationContext) password = Caster.toString(((ModernApplicationContext) appContext).getCustom(KeyConstants._webAdminPassword), "");
}
else password = password.trim();
if (StringUtil.isEmpty(password, true)) throw new lucee.runtime.exp.SecurityException(
"A Web Admin Password is required to manipulate Cache connections. " + "You can either pass the password as an argument to this function, or set it in "
+ (pc.getRequestDialect() == CFMLEngine.DIALECT_CFML ? Constants.CFML_APPLICATION_EVENT_HANDLER : Constants.LUCEE_APPLICATION_EVENT_HANDLER)
+ " with the variable [this.webAdminPassword].");
return PasswordImpl.passwordToCompare(pc.getConfig(), server, password);
} | [
"public",
"static",
"Password",
"getPassword",
"(",
"PageContext",
"pc",
",",
"String",
"password",
",",
"boolean",
"server",
")",
"throws",
"lucee",
".",
"runtime",
".",
"exp",
".",
"SecurityException",
"{",
"// TODO: move this to a utility class in a more",
"// gene... | returns true if the webAdminPassword matches the passed password if one is passed, or a password
defined in Application . cfc as this.webAdminPassword if null or empty-string is passed for
password
@param pc
@param password
@return
@throws lucee.runtime.exp.SecurityException | [
"returns",
"true",
"if",
"the",
"webAdminPassword",
"matches",
"the",
"passed",
"password",
"if",
"one",
"is",
"passed",
"or",
"a",
"password",
"defined",
"in",
"Application",
".",
"cfc",
"as",
"this",
".",
"webAdminPassword",
"if",
"null",
"or",
"empty",
"-... | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/cache/CacheUtil.java#L382-L397 |
30,323 | lucee/Lucee | core/src/main/java/lucee/runtime/net/smtp/URLDataSource2.java | URLDataSource2.getContentType | @Override
public String getContentType() {
URLConnection connection = null;
try {
connection = url.openConnection();
}
catch (IOException e) {}
if (connection == null) return DEFAULT_CONTENT_TYPE;
return connection.getContentType();
} | java | @Override
public String getContentType() {
URLConnection connection = null;
try {
connection = url.openConnection();
}
catch (IOException e) {}
if (connection == null) return DEFAULT_CONTENT_TYPE;
return connection.getContentType();
} | [
"@",
"Override",
"public",
"String",
"getContentType",
"(",
")",
"{",
"URLConnection",
"connection",
"=",
"null",
";",
"try",
"{",
"connection",
"=",
"url",
".",
"openConnection",
"(",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"}",
"if",... | Returns the value of the URL content-type header field | [
"Returns",
"the",
"value",
"of",
"the",
"URL",
"content",
"-",
"type",
"header",
"field"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/net/smtp/URLDataSource2.java#L49-L60 |
30,324 | lucee/Lucee | core/src/main/java/lucee/runtime/net/smtp/URLDataSource2.java | URLDataSource2.getInputStream | @Override
public InputStream getInputStream() throws IOException {
if (barr == null) {
barr = IOUtil.toBytes(url.openStream());
}
return new ByteArrayInputStream(barr);
} | java | @Override
public InputStream getInputStream() throws IOException {
if (barr == null) {
barr = IOUtil.toBytes(url.openStream());
}
return new ByteArrayInputStream(barr);
} | [
"@",
"Override",
"public",
"InputStream",
"getInputStream",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"barr",
"==",
"null",
")",
"{",
"barr",
"=",
"IOUtil",
".",
"toBytes",
"(",
"url",
".",
"openStream",
"(",
")",
")",
";",
"}",
"return",
"new... | Returns an InputStream obtained from the data source | [
"Returns",
"an",
"InputStream",
"obtained",
"from",
"the",
"data",
"source"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/net/smtp/URLDataSource2.java#L73-L79 |
30,325 | lucee/Lucee | core/src/main/java/lucee/runtime/net/smtp/URLDataSource2.java | URLDataSource2.getOutputStream | @Override
public OutputStream getOutputStream() throws IOException {
URLConnection connection = url.openConnection();
if (connection == null) return null;
connection.setDoOutput(true); // is it necessary?
return connection.getOutputStream();
} | java | @Override
public OutputStream getOutputStream() throws IOException {
URLConnection connection = url.openConnection();
if (connection == null) return null;
connection.setDoOutput(true); // is it necessary?
return connection.getOutputStream();
} | [
"@",
"Override",
"public",
"OutputStream",
"getOutputStream",
"(",
")",
"throws",
"IOException",
"{",
"URLConnection",
"connection",
"=",
"url",
".",
"openConnection",
"(",
")",
";",
"if",
"(",
"connection",
"==",
"null",
")",
"return",
"null",
";",
"connectio... | Returns an OutputStream obtained from the data source | [
"Returns",
"an",
"OutputStream",
"obtained",
"from",
"the",
"data",
"source"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/net/smtp/URLDataSource2.java#L84-L92 |
30,326 | lucee/Lucee | core/src/main/java/lucee/runtime/registry/RegistryEntry.java | RegistryEntry.toType | public static short toType(String strType) throws RegistryException {
if (strType.equals(REGDWORD_TOKEN)) return RegistryEntry.TYPE_DWORD;
else if (strType.equals(REGSTR_TOKEN)) return RegistryEntry.TYPE_STRING;
else if (strType.equals(REGKEY_TOKEN)) return RegistryEntry.TYPE_KEY;
throw new RegistryException(strType + " is not a valid Registry Type");
} | java | public static short toType(String strType) throws RegistryException {
if (strType.equals(REGDWORD_TOKEN)) return RegistryEntry.TYPE_DWORD;
else if (strType.equals(REGSTR_TOKEN)) return RegistryEntry.TYPE_STRING;
else if (strType.equals(REGKEY_TOKEN)) return RegistryEntry.TYPE_KEY;
throw new RegistryException(strType + " is not a valid Registry Type");
} | [
"public",
"static",
"short",
"toType",
"(",
"String",
"strType",
")",
"throws",
"RegistryException",
"{",
"if",
"(",
"strType",
".",
"equals",
"(",
"REGDWORD_TOKEN",
")",
")",
"return",
"RegistryEntry",
".",
"TYPE_DWORD",
";",
"else",
"if",
"(",
"strType",
"... | cast a String type to a short Type
@param strType
@return
@throws RegistryException | [
"cast",
"a",
"String",
"type",
"to",
"a",
"short",
"Type"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/registry/RegistryEntry.java#L113-L118 |
30,327 | lucee/Lucee | core/src/main/java/lucee/commons/collection/WeakHashMapPro.java | WeakHashMapPro.expungeStaleEntries | private void expungeStaleEntries() {
for (Object x; (x = queue.poll()) != null;) {
synchronized (queue) {
@SuppressWarnings("unchecked")
Entry<K, V> e = (Entry<K, V>) x;
int i = indexFor(e.hash, table.length);
Entry<K, V> prev = table[i];
Entry<K, V> p = prev;
while (p != null) {
Entry<K, V> next = p.next;
if (p == e) {
if (prev == e) table[i] = next;
else prev.next = next;
// Must not null out e.next;
// stale entries may be in use by a HashIterator
e.value = null; // Help GC
size--;
break;
}
prev = p;
p = next;
}
}
}
} | java | private void expungeStaleEntries() {
for (Object x; (x = queue.poll()) != null;) {
synchronized (queue) {
@SuppressWarnings("unchecked")
Entry<K, V> e = (Entry<K, V>) x;
int i = indexFor(e.hash, table.length);
Entry<K, V> prev = table[i];
Entry<K, V> p = prev;
while (p != null) {
Entry<K, V> next = p.next;
if (p == e) {
if (prev == e) table[i] = next;
else prev.next = next;
// Must not null out e.next;
// stale entries may be in use by a HashIterator
e.value = null; // Help GC
size--;
break;
}
prev = p;
p = next;
}
}
}
} | [
"private",
"void",
"expungeStaleEntries",
"(",
")",
"{",
"for",
"(",
"Object",
"x",
";",
"(",
"x",
"=",
"queue",
".",
"poll",
"(",
")",
")",
"!=",
"null",
";",
")",
"{",
"synchronized",
"(",
"queue",
")",
"{",
"@",
"SuppressWarnings",
"(",
"\"uncheck... | Expunges stale entries from the table. | [
"Expunges",
"stale",
"entries",
"from",
"the",
"table",
"."
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/collection/WeakHashMapPro.java#L255-L280 |
30,328 | lucee/Lucee | core/src/main/java/lucee/commons/collection/WeakHashMapPro.java | WeakHashMapPro.getEntry | Entry<K, V> getEntry(Object key) {
Object k = maskNull(key);
int h = hash(k);
Entry<K, V>[] tab = getTable();
int index = indexFor(h, tab.length);
Entry<K, V> e = tab[index];
while (e != null && !(e.hash == h && eq(k, e.get())))
e = e.next;
return e;
} | java | Entry<K, V> getEntry(Object key) {
Object k = maskNull(key);
int h = hash(k);
Entry<K, V>[] tab = getTable();
int index = indexFor(h, tab.length);
Entry<K, V> e = tab[index];
while (e != null && !(e.hash == h && eq(k, e.get())))
e = e.next;
return e;
} | [
"Entry",
"<",
"K",
",",
"V",
">",
"getEntry",
"(",
"Object",
"key",
")",
"{",
"Object",
"k",
"=",
"maskNull",
"(",
"key",
")",
";",
"int",
"h",
"=",
"hash",
"(",
"k",
")",
";",
"Entry",
"<",
"K",
",",
"V",
">",
"[",
"]",
"tab",
"=",
"getTab... | Returns the entry associated with the specified key in this map. Returns null if the map contains
no mapping for this key. | [
"Returns",
"the",
"entry",
"associated",
"with",
"the",
"specified",
"key",
"in",
"this",
"map",
".",
"Returns",
"null",
"if",
"the",
"map",
"contains",
"no",
"mapping",
"for",
"this",
"key",
"."
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/collection/WeakHashMapPro.java#L369-L378 |
30,329 | lucee/Lucee | core/src/main/java/lucee/commons/io/res/ResourcesImpl.java | ResourcesImpl.registerResourceProvider | @Override
public void registerResourceProvider(ResourceProvider provider) {
provider.setResources(this);
String scheme = provider.getScheme();
if (StringUtil.isEmpty(scheme)) return;
ResourceProviderFactory[] tmp = new ResourceProviderFactory[resources.length + 1];
for (int i = 0; i < resources.length; i++) {
if (scheme.equalsIgnoreCase(resources[i].getScheme())) {
resources[i] = new ResourceProviderFactory(this, provider);
return;
}
tmp[i] = resources[i];
}
tmp[resources.length] = new ResourceProviderFactory(this, provider);
resources = tmp;
} | java | @Override
public void registerResourceProvider(ResourceProvider provider) {
provider.setResources(this);
String scheme = provider.getScheme();
if (StringUtil.isEmpty(scheme)) return;
ResourceProviderFactory[] tmp = new ResourceProviderFactory[resources.length + 1];
for (int i = 0; i < resources.length; i++) {
if (scheme.equalsIgnoreCase(resources[i].getScheme())) {
resources[i] = new ResourceProviderFactory(this, provider);
return;
}
tmp[i] = resources[i];
}
tmp[resources.length] = new ResourceProviderFactory(this, provider);
resources = tmp;
} | [
"@",
"Override",
"public",
"void",
"registerResourceProvider",
"(",
"ResourceProvider",
"provider",
")",
"{",
"provider",
".",
"setResources",
"(",
"this",
")",
";",
"String",
"scheme",
"=",
"provider",
".",
"getScheme",
"(",
")",
";",
"if",
"(",
"StringUtil",... | adds a additional resource to System
@param provider | [
"adds",
"a",
"additional",
"resource",
"to",
"System"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/io/res/ResourcesImpl.java#L58-L74 |
30,330 | lucee/Lucee | core/src/main/java/lucee/commons/io/res/ResourcesImpl.java | ResourcesImpl.getResource | @Override
public Resource getResource(String path) {
int index = path.indexOf("://");
if (index != -1) {
String scheme = path.substring(0, index).toLowerCase().trim();
String subPath = path.substring(index + 3);
for (int i = 0; i < resources.length; i++) {
if (scheme.equalsIgnoreCase(resources[i].getScheme())) {
return resources[i].instance().getResource(subPath);
}
}
}
return defaultResource.getResource(path);
} | java | @Override
public Resource getResource(String path) {
int index = path.indexOf("://");
if (index != -1) {
String scheme = path.substring(0, index).toLowerCase().trim();
String subPath = path.substring(index + 3);
for (int i = 0; i < resources.length; i++) {
if (scheme.equalsIgnoreCase(resources[i].getScheme())) {
return resources[i].instance().getResource(subPath);
}
}
}
return defaultResource.getResource(path);
} | [
"@",
"Override",
"public",
"Resource",
"getResource",
"(",
"String",
"path",
")",
"{",
"int",
"index",
"=",
"path",
".",
"indexOf",
"(",
"\"://\"",
")",
";",
"if",
"(",
"index",
"!=",
"-",
"1",
")",
"{",
"String",
"scheme",
"=",
"path",
".",
"substri... | returns a resource that matching the given path
@param path
@return matching resource | [
"returns",
"a",
"resource",
"that",
"matching",
"the",
"given",
"path"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/io/res/ResourcesImpl.java#L163-L176 |
30,331 | lucee/Lucee | core/src/main/java/lucee/runtime/type/QueryImpl.java | QueryImpl.getPid | private int getPid() {
PageContext pc = ThreadLocalPageContext.get();
if (pc == null) {
pc = CFMLEngineFactory.getInstance().getThreadPageContext();
if (pc == null) throw new RuntimeException("cannot get pid for current thread");
}
return pc.getId();
} | java | private int getPid() {
PageContext pc = ThreadLocalPageContext.get();
if (pc == null) {
pc = CFMLEngineFactory.getInstance().getThreadPageContext();
if (pc == null) throw new RuntimeException("cannot get pid for current thread");
}
return pc.getId();
} | [
"private",
"int",
"getPid",
"(",
")",
"{",
"PageContext",
"pc",
"=",
"ThreadLocalPageContext",
".",
"get",
"(",
")",
";",
"if",
"(",
"pc",
"==",
"null",
")",
"{",
"pc",
"=",
"CFMLEngineFactory",
".",
"getInstance",
"(",
")",
".",
"getThreadPageContext",
... | private static int pidc=0; | [
"private",
"static",
"int",
"pidc",
"=",
"0",
";"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/QueryImpl.java#L808-L816 |
30,332 | lucee/Lucee | core/src/main/java/lucee/runtime/type/QueryImpl.java | QueryImpl.getColumnlist | public String getColumnlist(boolean upperCase) {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < columnNames.length; i++) {
if (i > 0) sb.append(',');
sb.append(upperCase ? columnNames[i].getUpperString() : columnNames[i].getString());
}
return sb.toString();
} | java | public String getColumnlist(boolean upperCase) {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < columnNames.length; i++) {
if (i > 0) sb.append(',');
sb.append(upperCase ? columnNames[i].getUpperString() : columnNames[i].getString());
}
return sb.toString();
} | [
"public",
"String",
"getColumnlist",
"(",
"boolean",
"upperCase",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"columnNames",
".",
"length",
";",
"i",
"++",
")",
"{",
"i... | return a string list of all columns
@return string list | [
"return",
"a",
"string",
"list",
"of",
"all",
"columns"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/QueryImpl.java#L1048-L1055 |
30,333 | lucee/Lucee | core/src/main/java/lucee/runtime/type/QueryImpl.java | QueryImpl.sort | @Override
public synchronized void sort(String strColumn, int order) throws PageException {
// disconnectCache();
sort(getColumn(strColumn), order);
} | java | @Override
public synchronized void sort(String strColumn, int order) throws PageException {
// disconnectCache();
sort(getColumn(strColumn), order);
} | [
"@",
"Override",
"public",
"synchronized",
"void",
"sort",
"(",
"String",
"strColumn",
",",
"int",
"order",
")",
"throws",
"PageException",
"{",
"// disconnectCache();",
"sort",
"(",
"getColumn",
"(",
"strColumn",
")",
",",
"order",
")",
";",
"}"
] | sorts a query by a column
@param strColumn column to sort
@param order sort type (Query.ORDER_ASC or Query.ORDER_DESC)
@throws PageException | [
"sorts",
"a",
"query",
"by",
"a",
"column"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/QueryImpl.java#L1107-L1111 |
30,334 | lucee/Lucee | core/src/main/java/lucee/runtime/converter/WDDXConverter.java | WDDXConverter._deserializeQuery | private Object _deserializeQuery(Element recordset) throws ConverterException {
try {
// create Query Object
Query query = new QueryImpl(lucee.runtime.type.util.ListUtil.listToArray(recordset.getAttribute("fieldNames"), ','),
Caster.toIntValue(recordset.getAttribute("rowCount")), "query");
NodeList list = recordset.getChildNodes();
int len = list.getLength();
for (int i = 0; i < len; i++) {
Node node = list.item(i);
if (node instanceof Element) {
_deserializeQueryField(query, (Element) node);
}
}
return query;
}
catch (PageException e) {
throw toConverterException(e);
}
} | java | private Object _deserializeQuery(Element recordset) throws ConverterException {
try {
// create Query Object
Query query = new QueryImpl(lucee.runtime.type.util.ListUtil.listToArray(recordset.getAttribute("fieldNames"), ','),
Caster.toIntValue(recordset.getAttribute("rowCount")), "query");
NodeList list = recordset.getChildNodes();
int len = list.getLength();
for (int i = 0; i < len; i++) {
Node node = list.item(i);
if (node instanceof Element) {
_deserializeQueryField(query, (Element) node);
}
}
return query;
}
catch (PageException e) {
throw toConverterException(e);
}
} | [
"private",
"Object",
"_deserializeQuery",
"(",
"Element",
"recordset",
")",
"throws",
"ConverterException",
"{",
"try",
"{",
"// create Query Object",
"Query",
"query",
"=",
"new",
"QueryImpl",
"(",
"lucee",
".",
"runtime",
".",
"type",
".",
"util",
".",
"ListUt... | Desirialize a Query Object
@param recordset Query Object as XML Element
@return Query Object
@throws ConverterException | [
"Desirialize",
"a",
"Query",
"Object"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/converter/WDDXConverter.java#L658-L678 |
30,335 | lucee/Lucee | core/src/main/java/lucee/runtime/converter/WDDXConverter.java | WDDXConverter._deserializeQueryField | private void _deserializeQueryField(Query query, Element field) throws PageException, ConverterException {
String name = field.getAttribute("name");
NodeList list = field.getChildNodes();
int len = list.getLength();
int count = 0;
for (int i = 0; i < len; i++) {
Node node = list.item(i);
if (node instanceof Element) {
query.setAt(KeyImpl.init(name), ++count, _deserialize((Element) node));
}
}
} | java | private void _deserializeQueryField(Query query, Element field) throws PageException, ConverterException {
String name = field.getAttribute("name");
NodeList list = field.getChildNodes();
int len = list.getLength();
int count = 0;
for (int i = 0; i < len; i++) {
Node node = list.item(i);
if (node instanceof Element) {
query.setAt(KeyImpl.init(name), ++count, _deserialize((Element) node));
}
}
} | [
"private",
"void",
"_deserializeQueryField",
"(",
"Query",
"query",
",",
"Element",
"field",
")",
"throws",
"PageException",
",",
"ConverterException",
"{",
"String",
"name",
"=",
"field",
".",
"getAttribute",
"(",
"\"name\"",
")",
";",
"NodeList",
"list",
"=",
... | deserilize a single Field of a query WDDX Object
@param query
@param field
@throws ConverterException
@throws PageException | [
"deserilize",
"a",
"single",
"Field",
"of",
"a",
"query",
"WDDX",
"Object"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/converter/WDDXConverter.java#L702-L714 |
30,336 | lucee/Lucee | core/src/main/java/lucee/runtime/converter/WDDXConverter.java | WDDXConverter._deserializeComponent | private Object _deserializeComponent(Element elComp) throws ConverterException {
// String type=elStruct.getAttribute("type");
String name = elComp.getAttribute("name");
String md5 = elComp.getAttribute("md5");
// TLPC
PageContext pc = ThreadLocalPageContext.get();
// Load comp
Component comp = null;
try {
comp = pc.loadComponent(name);
if (!ComponentUtil.md5(comp).equals(md5)) {
throw new ConverterException("component [" + name
+ "] in this enviroment has not the same interface as the component to load, it is possible that one off the components has Functions added dynamicly.");
}
}
catch (ConverterException e) {
throw e;
}
catch (Exception e) {
throw new ConverterException(e.getMessage());
}
NodeList list = elComp.getChildNodes();
ComponentScope scope = comp.getComponentScope();
int len = list.getLength();
String scopeName;
Element var, value;
Collection.Key key;
for (int i = 0; i < len; i++) {
Node node = list.item(i);
if (node instanceof Element) {
var = (Element) node;
value = getChildElement((Element) node);
scopeName = var.getAttribute("scope");
if (value != null) {
key = Caster.toKey(var.getAttribute("name"), null);
if (key == null) continue;
if ("variables".equalsIgnoreCase(scopeName)) scope.setEL(key, _deserialize(value));
else comp.setEL(key, _deserialize(value));
}
}
}
return comp;
} | java | private Object _deserializeComponent(Element elComp) throws ConverterException {
// String type=elStruct.getAttribute("type");
String name = elComp.getAttribute("name");
String md5 = elComp.getAttribute("md5");
// TLPC
PageContext pc = ThreadLocalPageContext.get();
// Load comp
Component comp = null;
try {
comp = pc.loadComponent(name);
if (!ComponentUtil.md5(comp).equals(md5)) {
throw new ConverterException("component [" + name
+ "] in this enviroment has not the same interface as the component to load, it is possible that one off the components has Functions added dynamicly.");
}
}
catch (ConverterException e) {
throw e;
}
catch (Exception e) {
throw new ConverterException(e.getMessage());
}
NodeList list = elComp.getChildNodes();
ComponentScope scope = comp.getComponentScope();
int len = list.getLength();
String scopeName;
Element var, value;
Collection.Key key;
for (int i = 0; i < len; i++) {
Node node = list.item(i);
if (node instanceof Element) {
var = (Element) node;
value = getChildElement((Element) node);
scopeName = var.getAttribute("scope");
if (value != null) {
key = Caster.toKey(var.getAttribute("name"), null);
if (key == null) continue;
if ("variables".equalsIgnoreCase(scopeName)) scope.setEL(key, _deserialize(value));
else comp.setEL(key, _deserialize(value));
}
}
}
return comp;
} | [
"private",
"Object",
"_deserializeComponent",
"(",
"Element",
"elComp",
")",
"throws",
"ConverterException",
"{",
"// String type=elStruct.getAttribute(\"type\");",
"String",
"name",
"=",
"elComp",
".",
"getAttribute",
"(",
"\"name\"",
")",
";",
"String",
"md5",
"=",
... | Desirialize a Component Object
@param elComp Component Object as XML Element
@return Component Object
@throws ConverterException
@throws ConverterException | [
"Desirialize",
"a",
"Component",
"Object"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/converter/WDDXConverter.java#L724-L769 |
30,337 | lucee/Lucee | core/src/main/java/lucee/runtime/converter/WDDXConverter.java | WDDXConverter.getChildElement | private Element getChildElement(Element parent) {
NodeList list = parent.getChildNodes();
int len = list.getLength();
for (int i = 0; i < len; i++) {
Node node = list.item(i);
if (node instanceof Element) {
return (Element) node;
}
}
return null;
} | java | private Element getChildElement(Element parent) {
NodeList list = parent.getChildNodes();
int len = list.getLength();
for (int i = 0; i < len; i++) {
Node node = list.item(i);
if (node instanceof Element) {
return (Element) node;
}
}
return null;
} | [
"private",
"Element",
"getChildElement",
"(",
"Element",
"parent",
")",
"{",
"NodeList",
"list",
"=",
"parent",
".",
"getChildNodes",
"(",
")",
";",
"int",
"len",
"=",
"list",
".",
"getLength",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i... | return fitst child Element of a Element, if there are no child Elements return null
@param parent parent node
@return child Element | [
"return",
"fitst",
"child",
"Element",
"of",
"a",
"Element",
"if",
"there",
"are",
"no",
"child",
"Elements",
"return",
"null"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/converter/WDDXConverter.java#L837-L847 |
30,338 | lucee/Lucee | core/src/main/java/lucee/runtime/util/NumberFormat.java | NumberFormat.format | public String format(Locale locale, double number) {
DecimalFormat df = getDecimalFormat(locale);
df.applyPattern(",0");
df.setGroupingSize(3);
return df.format(number);
} | java | public String format(Locale locale, double number) {
DecimalFormat df = getDecimalFormat(locale);
df.applyPattern(",0");
df.setGroupingSize(3);
return df.format(number);
} | [
"public",
"String",
"format",
"(",
"Locale",
"locale",
",",
"double",
"number",
")",
"{",
"DecimalFormat",
"df",
"=",
"getDecimalFormat",
"(",
"locale",
")",
";",
"df",
".",
"applyPattern",
"(",
"\",0\"",
")",
";",
"df",
".",
"setGroupingSize",
"(",
"3",
... | formats a number
@param number
@return formatted number as string | [
"formats",
"a",
"number"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/util/NumberFormat.java#L42-L47 |
30,339 | lucee/Lucee | core/src/main/java/lucee/runtime/util/NumberFormat.java | NumberFormat.formatX | public String formatX(Locale locale, double number, String mask) throws InvalidMaskException {
return format(locale, number, convertMask(mask));
} | java | public String formatX(Locale locale, double number, String mask) throws InvalidMaskException {
return format(locale, number, convertMask(mask));
} | [
"public",
"String",
"formatX",
"(",
"Locale",
"locale",
",",
"double",
"number",
",",
"String",
"mask",
")",
"throws",
"InvalidMaskException",
"{",
"return",
"format",
"(",
"locale",
",",
"number",
",",
"convertMask",
"(",
"mask",
")",
")",
";",
"}"
] | format a number with given mask
@param number
@param mask
@return formatted number as string
@throws InvalidMaskException | [
"format",
"a",
"number",
"with",
"given",
"mask"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/util/NumberFormat.java#L59-L61 |
30,340 | lucee/Lucee | core/src/main/java/lucee/runtime/type/ArrayClassic.java | ArrayClassic.enlargeOffset | private void enlargeOffset() {
if (offset == 0) {
offCount = offCount == 0 ? 1 : offCount * 2;
offset = offCount;
Object[] narr = new Object[arr.length + offset];
for (int i = 0; i < size; i++) {
narr[offset + i] = arr[i];
}
arr = narr;
}
} | java | private void enlargeOffset() {
if (offset == 0) {
offCount = offCount == 0 ? 1 : offCount * 2;
offset = offCount;
Object[] narr = new Object[arr.length + offset];
for (int i = 0; i < size; i++) {
narr[offset + i] = arr[i];
}
arr = narr;
}
} | [
"private",
"void",
"enlargeOffset",
"(",
")",
"{",
"if",
"(",
"offset",
"==",
"0",
")",
"{",
"offCount",
"=",
"offCount",
"==",
"0",
"?",
"1",
":",
"offCount",
"*",
"2",
";",
"offset",
"=",
"offCount",
";",
"Object",
"[",
"]",
"narr",
"=",
"new",
... | !!! all methods that use this method must be sync enlarge the offset if 0 | [
"!!!",
"all",
"methods",
"that",
"use",
"this",
"method",
"must",
"be",
"sync",
"enlarge",
"the",
"offset",
"if",
"0"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/ArrayClassic.java#L275-L285 |
30,341 | lucee/Lucee | core/src/main/java/lucee/transformer/cfml/evaluator/impl/Component.java | Component.isInsideCITemplate | private Boolean isInsideCITemplate(Page page) {
SourceCode sc = page.getSourceCode();
if (!(sc instanceof PageSourceCode)) return null;
PageSource psc = ((PageSourceCode) sc).getPageSource();
String src = psc.getDisplayPath();
return Constants.isComponentExtension(ResourceUtil.getExtension(src, ""));
// int pos=src.lastIndexOf(".");
// return pos!=-1 && pos<src.length() && src.substring(pos+1).equals(Constants.COMPONENT_EXTENSION);
} | java | private Boolean isInsideCITemplate(Page page) {
SourceCode sc = page.getSourceCode();
if (!(sc instanceof PageSourceCode)) return null;
PageSource psc = ((PageSourceCode) sc).getPageSource();
String src = psc.getDisplayPath();
return Constants.isComponentExtension(ResourceUtil.getExtension(src, ""));
// int pos=src.lastIndexOf(".");
// return pos!=-1 && pos<src.length() && src.substring(pos+1).equals(Constants.COMPONENT_EXTENSION);
} | [
"private",
"Boolean",
"isInsideCITemplate",
"(",
"Page",
"page",
")",
"{",
"SourceCode",
"sc",
"=",
"page",
".",
"getSourceCode",
"(",
")",
";",
"if",
"(",
"!",
"(",
"sc",
"instanceof",
"PageSourceCode",
")",
")",
"return",
"null",
";",
"PageSource",
"psc"... | is the template ending with a component extension?
@param page
@return return true if so false otherwse and null if the code is not depending on a template | [
"is",
"the",
"template",
"ending",
"with",
"a",
"component",
"extension?"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/cfml/evaluator/impl/Component.java#L206-L214 |
30,342 | lucee/Lucee | core/src/main/java/lucee/runtime/op/Caster.java | Caster.toNumber | public static Number toNumber(String str, Number defaultValue) {
try {
// float
if (str.indexOf('.') != -1) {
return new BigDecimal(str);
}
// integer
BigInteger bi = new BigInteger(str);
int l = bi.bitLength();
if (l < 32) return new Integer(bi.intValue());
if (l < 64) return new Long(bi.longValue());
return bi;
}
catch (Throwable t) {
ExceptionUtil.rethrowIfNecessary(t);
return defaultValue;
}
} | java | public static Number toNumber(String str, Number defaultValue) {
try {
// float
if (str.indexOf('.') != -1) {
return new BigDecimal(str);
}
// integer
BigInteger bi = new BigInteger(str);
int l = bi.bitLength();
if (l < 32) return new Integer(bi.intValue());
if (l < 64) return new Long(bi.longValue());
return bi;
}
catch (Throwable t) {
ExceptionUtil.rethrowIfNecessary(t);
return defaultValue;
}
} | [
"public",
"static",
"Number",
"toNumber",
"(",
"String",
"str",
",",
"Number",
"defaultValue",
")",
"{",
"try",
"{",
"// float",
"if",
"(",
"str",
".",
"indexOf",
"(",
"'",
"'",
")",
"!=",
"-",
"1",
")",
"{",
"return",
"new",
"BigDecimal",
"(",
"str"... | returns a number Object, this can be a BigDecimal,BigInteger,Long, Double, depending on the
input.
@param str
@return
@throws PageException | [
"returns",
"a",
"number",
"Object",
"this",
"can",
"be",
"a",
"BigDecimal",
"BigInteger",
"Long",
"Double",
"depending",
"on",
"the",
"input",
"."
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/op/Caster.java#L1433-L1450 |
30,343 | lucee/Lucee | core/src/main/java/lucee/runtime/op/Caster.java | Caster.toString3 | public static String toString3(double d) {
long l = (long) d;
if (l == d) return toString(l);
String str = Double.toString(d);
int pos;
if ((pos = str.indexOf('E')) != -1 && pos == str.length() - 2) {
return new StringBuffer(pos + 2).append(str.charAt(0)).append(str.substring(2, toDigit(str.charAt(pos + 1)) + 2)).append('.')
.append(str.substring(toDigit(str.charAt(pos + 1)) + 2, pos)).toString();
}
return str;
} | java | public static String toString3(double d) {
long l = (long) d;
if (l == d) return toString(l);
String str = Double.toString(d);
int pos;
if ((pos = str.indexOf('E')) != -1 && pos == str.length() - 2) {
return new StringBuffer(pos + 2).append(str.charAt(0)).append(str.substring(2, toDigit(str.charAt(pos + 1)) + 2)).append('.')
.append(str.substring(toDigit(str.charAt(pos + 1)) + 2, pos)).toString();
}
return str;
} | [
"public",
"static",
"String",
"toString3",
"(",
"double",
"d",
")",
"{",
"long",
"l",
"=",
"(",
"long",
")",
"d",
";",
"if",
"(",
"l",
"==",
"d",
")",
"return",
"toString",
"(",
"l",
")",
";",
"String",
"str",
"=",
"Double",
".",
"toString",
"(",... | cast a double value to a String
@param d double value to cast
@return casted String | [
"cast",
"a",
"double",
"value",
"to",
"a",
"String"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/op/Caster.java#L2083-L2095 |
30,344 | lucee/Lucee | core/src/main/java/lucee/runtime/op/Caster.java | Caster.toBinary | public static byte[] toBinary(Object o) throws PageException {
if (o instanceof byte[]) return (byte[]) o;
else if (o instanceof ObjectWrap) return toBinary(((ObjectWrap) o).getEmbededObject(""));
else if (o instanceof InputStream) {
ByteArrayOutputStream barr = new ByteArrayOutputStream();
try {
IOUtil.copy((InputStream) o, barr, false, true);
}
catch (IOException e) {
throw ExpressionException.newInstance(e);
}
return barr.toByteArray();
}
// depending on extension Image
else if (o != null && o.getClass().getName().equals("org.lucee.extension.image.Image")) {
return ImageUtil.getImageBytes(o, null);
}
else if (o instanceof BufferedImage) {
return ImageUtil.getImageBytes((BufferedImage) o);
}
else if (o instanceof ByteArrayOutputStream) {
return ((ByteArrayOutputStream) o).toByteArray();
}
else if (o instanceof Blob) {
InputStream is = null;
try {
is = ((Blob) o).getBinaryStream();
return IOUtil.toBytes(is);
}
catch (Exception e) {
throw new ExpressionException(e.getMessage());
}
finally {
IOUtil.closeEL(is);
}
}
try {
return Base64Encoder.decode(toString(o));
}
catch (PageException e) {
throw new CasterException(o, "binary");
}
} | java | public static byte[] toBinary(Object o) throws PageException {
if (o instanceof byte[]) return (byte[]) o;
else if (o instanceof ObjectWrap) return toBinary(((ObjectWrap) o).getEmbededObject(""));
else if (o instanceof InputStream) {
ByteArrayOutputStream barr = new ByteArrayOutputStream();
try {
IOUtil.copy((InputStream) o, barr, false, true);
}
catch (IOException e) {
throw ExpressionException.newInstance(e);
}
return barr.toByteArray();
}
// depending on extension Image
else if (o != null && o.getClass().getName().equals("org.lucee.extension.image.Image")) {
return ImageUtil.getImageBytes(o, null);
}
else if (o instanceof BufferedImage) {
return ImageUtil.getImageBytes((BufferedImage) o);
}
else if (o instanceof ByteArrayOutputStream) {
return ((ByteArrayOutputStream) o).toByteArray();
}
else if (o instanceof Blob) {
InputStream is = null;
try {
is = ((Blob) o).getBinaryStream();
return IOUtil.toBytes(is);
}
catch (Exception e) {
throw new ExpressionException(e.getMessage());
}
finally {
IOUtil.closeEL(is);
}
}
try {
return Base64Encoder.decode(toString(o));
}
catch (PageException e) {
throw new CasterException(o, "binary");
}
} | [
"public",
"static",
"byte",
"[",
"]",
"toBinary",
"(",
"Object",
"o",
")",
"throws",
"PageException",
"{",
"if",
"(",
"o",
"instanceof",
"byte",
"[",
"]",
")",
"return",
"(",
"byte",
"[",
"]",
")",
"o",
";",
"else",
"if",
"",
"(",
"o",
"instanceof"... | cast a Object to a Binary
@param o Object to cast
@return casted Binary
@throws PageException | [
"cast",
"a",
"Object",
"to",
"a",
"Binary"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/op/Caster.java#L2682-L2725 |
30,345 | lucee/Lucee | core/src/main/java/lucee/runtime/op/Caster.java | Caster.toBase64 | public static String toBase64(Object o, String charset, String defaultValue) {
;
if (o instanceof byte[]) return toB64((byte[]) o, defaultValue);
else if (o instanceof String) return toB64((String) o, charset, defaultValue);
else if (o instanceof Number) return toB64(toString(((Number) o)), charset, defaultValue);
else if (o instanceof ObjectWrap) {
return toBase64(((ObjectWrap) o).getEmbededObject(defaultValue), charset, defaultValue);
}
else if (o == null) {
return toBase64("", charset, defaultValue);
}
else {
byte[] b = toBinary(o, null);
if (b != null) return toB64(b, defaultValue);
else {
String str = toString(o, null);
if (str != null) return toBase64(str, charset, defaultValue);
else return defaultValue;
}
}
} | java | public static String toBase64(Object o, String charset, String defaultValue) {
;
if (o instanceof byte[]) return toB64((byte[]) o, defaultValue);
else if (o instanceof String) return toB64((String) o, charset, defaultValue);
else if (o instanceof Number) return toB64(toString(((Number) o)), charset, defaultValue);
else if (o instanceof ObjectWrap) {
return toBase64(((ObjectWrap) o).getEmbededObject(defaultValue), charset, defaultValue);
}
else if (o == null) {
return toBase64("", charset, defaultValue);
}
else {
byte[] b = toBinary(o, null);
if (b != null) return toB64(b, defaultValue);
else {
String str = toString(o, null);
if (str != null) return toBase64(str, charset, defaultValue);
else return defaultValue;
}
}
} | [
"public",
"static",
"String",
"toBase64",
"(",
"Object",
"o",
",",
"String",
"charset",
",",
"String",
"defaultValue",
")",
"{",
";",
"if",
"(",
"o",
"instanceof",
"byte",
"[",
"]",
")",
"return",
"toB64",
"(",
"(",
"byte",
"[",
"]",
")",
"o",
",",
... | cast a Object to a Base64 value
@param o Object to cast
@param defaultValue
@return to Base64 String | [
"cast",
"a",
"Object",
"to",
"a",
"Base64",
"value"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/op/Caster.java#L2782-L2802 |
30,346 | lucee/Lucee | core/src/main/java/lucee/runtime/op/Caster.java | Caster.toQueryColumn | public static QueryColumn toQueryColumn(Object o) throws PageException {
if (o instanceof QueryColumn) return (QueryColumn) o;
throw new CasterException(o, "querycolumn");
} | java | public static QueryColumn toQueryColumn(Object o) throws PageException {
if (o instanceof QueryColumn) return (QueryColumn) o;
throw new CasterException(o, "querycolumn");
} | [
"public",
"static",
"QueryColumn",
"toQueryColumn",
"(",
"Object",
"o",
")",
"throws",
"PageException",
"{",
"if",
"(",
"o",
"instanceof",
"QueryColumn",
")",
"return",
"(",
"QueryColumn",
")",
"o",
";",
"throw",
"new",
"CasterException",
"(",
"o",
",",
"\"q... | converts a object to a QueryColumn, if possible
@param o
@return
@throws PageException | [
"converts",
"a",
"object",
"to",
"a",
"QueryColumn",
"if",
"possible"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/op/Caster.java#L2985-L2988 |
30,347 | lucee/Lucee | core/src/main/java/lucee/runtime/op/Caster.java | Caster.toQueryColumn | public static QueryColumn toQueryColumn(Object o, PageContext pc) throws PageException {
if (o instanceof QueryColumn) return (QueryColumn) o;
if (o instanceof String) {
o = VariableInterpreter.getVariableAsCollection(pc, (String) o);
if (o instanceof QueryColumn) return (QueryColumn) o;
}
throw new CasterException(o, "querycolumn");
} | java | public static QueryColumn toQueryColumn(Object o, PageContext pc) throws PageException {
if (o instanceof QueryColumn) return (QueryColumn) o;
if (o instanceof String) {
o = VariableInterpreter.getVariableAsCollection(pc, (String) o);
if (o instanceof QueryColumn) return (QueryColumn) o;
}
throw new CasterException(o, "querycolumn");
} | [
"public",
"static",
"QueryColumn",
"toQueryColumn",
"(",
"Object",
"o",
",",
"PageContext",
"pc",
")",
"throws",
"PageException",
"{",
"if",
"(",
"o",
"instanceof",
"QueryColumn",
")",
"return",
"(",
"QueryColumn",
")",
"o",
";",
"if",
"(",
"o",
"instanceof"... | converts a object to a QueryColumn, if possible, also variable declarations are allowed. this
method is used within the generated bytecode
@param o
@return
@throws PageException
@info used in bytecode generation | [
"converts",
"a",
"object",
"to",
"a",
"QueryColumn",
"if",
"possible",
"also",
"variable",
"declarations",
"are",
"allowed",
".",
"this",
"method",
"is",
"used",
"within",
"the",
"generated",
"bytecode"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/op/Caster.java#L3004-L3012 |
30,348 | lucee/Lucee | core/src/main/java/lucee/runtime/op/Caster.java | Caster.toCollection | public static Collection toCollection(Object o) throws PageException {
if (o instanceof Collection) return (Collection) o;
else if (o instanceof Node) return XMLCaster.toXMLStruct((Node) o, false);
else if (o instanceof Map) {
return MapAsStruct.toStruct((Map) o, true);// StructImpl((Map)o);
}
else if (o instanceof ObjectWrap) {
return toCollection(((ObjectWrap) o).getEmbededObject());
}
else if (Decision.isArray(o)) {
return toArray(o);
}
throw new CasterException(o, "collection");
} | java | public static Collection toCollection(Object o) throws PageException {
if (o instanceof Collection) return (Collection) o;
else if (o instanceof Node) return XMLCaster.toXMLStruct((Node) o, false);
else if (o instanceof Map) {
return MapAsStruct.toStruct((Map) o, true);// StructImpl((Map)o);
}
else if (o instanceof ObjectWrap) {
return toCollection(((ObjectWrap) o).getEmbededObject());
}
else if (Decision.isArray(o)) {
return toArray(o);
}
throw new CasterException(o, "collection");
} | [
"public",
"static",
"Collection",
"toCollection",
"(",
"Object",
"o",
")",
"throws",
"PageException",
"{",
"if",
"(",
"o",
"instanceof",
"Collection",
")",
"return",
"(",
"Collection",
")",
"o",
";",
"else",
"if",
"(",
"o",
"instanceof",
"Node",
")",
"retu... | cast a Object to a Collection
@param o Object to cast
@return casted Collection
@throws PageException | [
"cast",
"a",
"Object",
"to",
"a",
"Collection"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/op/Caster.java#L4082-L4095 |
30,349 | lucee/Lucee | core/src/main/java/lucee/runtime/op/Caster.java | Caster.toComponent | public static Component toComponent(Object o) throws PageException {
if (o instanceof Component) return (Component) o;
else if (o instanceof ObjectWrap) {
return toComponent(((ObjectWrap) o).getEmbededObject());
}
throw new CasterException(o, "Component");
} | java | public static Component toComponent(Object o) throws PageException {
if (o instanceof Component) return (Component) o;
else if (o instanceof ObjectWrap) {
return toComponent(((ObjectWrap) o).getEmbededObject());
}
throw new CasterException(o, "Component");
} | [
"public",
"static",
"Component",
"toComponent",
"(",
"Object",
"o",
")",
"throws",
"PageException",
"{",
"if",
"(",
"o",
"instanceof",
"Component",
")",
"return",
"(",
"Component",
")",
"o",
";",
"else",
"if",
"(",
"o",
"instanceof",
"ObjectWrap",
")",
"{"... | cast a Object to a Component
@param o Object to cast
@return casted Component
@throws PageException | [
"cast",
"a",
"Object",
"to",
"a",
"Component"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/op/Caster.java#L4109-L4115 |
30,350 | lucee/Lucee | core/src/main/java/lucee/runtime/op/Caster.java | Caster.toLocale | public static Locale toLocale(String strLocale, Locale defaultValue) {
return LocaleFactory.getLocale(strLocale, defaultValue);
} | java | public static Locale toLocale(String strLocale, Locale defaultValue) {
return LocaleFactory.getLocale(strLocale, defaultValue);
} | [
"public",
"static",
"Locale",
"toLocale",
"(",
"String",
"strLocale",
",",
"Locale",
"defaultValue",
")",
"{",
"return",
"LocaleFactory",
".",
"getLocale",
"(",
"strLocale",
",",
"defaultValue",
")",
";",
"}"
] | casts a string to a Locale
@param strLocale
@param defaultValue
@return Locale from String | [
"casts",
"a",
"string",
"to",
"a",
"Locale"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/op/Caster.java#L4233-L4235 |
30,351 | lucee/Lucee | core/src/main/java/lucee/runtime/op/Caster.java | Caster.toTimeZone | public static TimeZone toTimeZone(String strTimeZone, TimeZone defaultValue) {
return TimeZoneUtil.toTimeZone(strTimeZone, defaultValue);
} | java | public static TimeZone toTimeZone(String strTimeZone, TimeZone defaultValue) {
return TimeZoneUtil.toTimeZone(strTimeZone, defaultValue);
} | [
"public",
"static",
"TimeZone",
"toTimeZone",
"(",
"String",
"strTimeZone",
",",
"TimeZone",
"defaultValue",
")",
"{",
"return",
"TimeZoneUtil",
".",
"toTimeZone",
"(",
"strTimeZone",
",",
"defaultValue",
")",
";",
"}"
] | casts a string to a TimeZone
@param strTimeZone
@param defaultValue
@return TimeZone from String | [
"casts",
"a",
"string",
"to",
"a",
"TimeZone"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/op/Caster.java#L4255-L4257 |
30,352 | lucee/Lucee | core/src/main/java/lucee/runtime/op/Caster.java | Caster.toInteger | public static Integer toInteger(Object o, Integer defaultValue) {
if (defaultValue != null) return Integer.valueOf(toIntValue(o, defaultValue.intValue()));
int res = toIntValue(o, Integer.MIN_VALUE);
if (res == Integer.MIN_VALUE) return defaultValue;
return Integer.valueOf(res);
} | java | public static Integer toInteger(Object o, Integer defaultValue) {
if (defaultValue != null) return Integer.valueOf(toIntValue(o, defaultValue.intValue()));
int res = toIntValue(o, Integer.MIN_VALUE);
if (res == Integer.MIN_VALUE) return defaultValue;
return Integer.valueOf(res);
} | [
"public",
"static",
"Integer",
"toInteger",
"(",
"Object",
"o",
",",
"Integer",
"defaultValue",
")",
"{",
"if",
"(",
"defaultValue",
"!=",
"null",
")",
"return",
"Integer",
".",
"valueOf",
"(",
"toIntValue",
"(",
"o",
",",
"defaultValue",
".",
"intValue",
... | casts a Object to a Integer
@param o Object to cast to Integer
@param defaultValue
@return Integer from Object | [
"casts",
"a",
"Object",
"to",
"a",
"Integer"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/op/Caster.java#L4400-L4405 |
30,353 | lucee/Lucee | core/src/main/java/org/apache/taglibs/datetime/FormatTag.java | FormatTag.doAfterBody | @Override
public final int doAfterBody() throws JspException {
// Use the body of the tag as input for the date
BodyContent body = getBodyContent();
String s = body.getString().trim();
// Clear the body since we will output only the formatted date
body.clearBody();
if (output_date == null) {
long time;
try {
time = Long.valueOf(s).longValue();
output_date = new Date(time);
}
catch (NumberFormatException nfe) {}
}
return SKIP_BODY;
} | java | @Override
public final int doAfterBody() throws JspException {
// Use the body of the tag as input for the date
BodyContent body = getBodyContent();
String s = body.getString().trim();
// Clear the body since we will output only the formatted date
body.clearBody();
if (output_date == null) {
long time;
try {
time = Long.valueOf(s).longValue();
output_date = new Date(time);
}
catch (NumberFormatException nfe) {}
}
return SKIP_BODY;
} | [
"@",
"Override",
"public",
"final",
"int",
"doAfterBody",
"(",
")",
"throws",
"JspException",
"{",
"// Use the body of the tag as input for the date",
"BodyContent",
"body",
"=",
"getBodyContent",
"(",
")",
";",
"String",
"s",
"=",
"body",
".",
"getString",
"(",
"... | Method called at end of format tag body.
@return SKIP_BODY | [
"Method",
"called",
"at",
"end",
"of",
"format",
"tag",
"body",
"."
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/org/apache/taglibs/datetime/FormatTag.java#L77-L94 |
30,354 | lucee/Lucee | core/src/main/java/org/apache/taglibs/datetime/FormatTag.java | FormatTag.doEndTag | @Override
public final int doEndTag() throws JspException {
String date_formatted = default_text;
if (output_date != null) {
// Get the pattern to use
SimpleDateFormat sdf;
String pat = pattern;
if (pat == null && patternid != null) {
Object attr = pageContext.findAttribute(patternid);
if (attr != null) pat = attr.toString();
}
if (pat == null) {
sdf = new SimpleDateFormat();
pat = sdf.toPattern();
}
// Get a DateFormatSymbols
if (symbolsRef != null) {
symbols = (DateFormatSymbols) pageContext.findAttribute(symbolsRef);
if (symbols == null) {
throw new JspException("datetime format tag could not find dateFormatSymbols for symbolsRef \"" + symbolsRef + "\".");
}
}
// Get a SimpleDateFormat using locale if necessary
if (localeRef != null) {
Locale locale = (Locale) pageContext.findAttribute(localeRef);
if (locale == null) {
throw new JspException("datetime format tag could not find locale for localeRef \"" + localeRef + "\".");
}
sdf = new SimpleDateFormat(pat, locale);
}
else if (locale_flag) {
sdf = new SimpleDateFormat(pat, pageContext.getRequest().getLocale());
}
else if (symbols != null) {
sdf = new SimpleDateFormat(pat, symbols);
}
else {
sdf = new SimpleDateFormat(pat);
}
// See if there is a timeZone
if (timeZone_string != null) {
TimeZone timeZone = (TimeZone) pageContext.getAttribute(timeZone_string, PageContext.SESSION_SCOPE);
if (timeZone == null) {
throw new JspTagException("Datetime format tag timeZone " + "script variable \"" + timeZone_string + " \" does not exist");
}
sdf.setTimeZone(timeZone);
}
// Format the date for display
date_formatted = sdf.format(output_date);
}
try {
pageContext.getOut().write(date_formatted);
}
catch (Exception e) {
throw new JspException("IO Error: " + e.getMessage());
}
return EVAL_PAGE;
} | java | @Override
public final int doEndTag() throws JspException {
String date_formatted = default_text;
if (output_date != null) {
// Get the pattern to use
SimpleDateFormat sdf;
String pat = pattern;
if (pat == null && patternid != null) {
Object attr = pageContext.findAttribute(patternid);
if (attr != null) pat = attr.toString();
}
if (pat == null) {
sdf = new SimpleDateFormat();
pat = sdf.toPattern();
}
// Get a DateFormatSymbols
if (symbolsRef != null) {
symbols = (DateFormatSymbols) pageContext.findAttribute(symbolsRef);
if (symbols == null) {
throw new JspException("datetime format tag could not find dateFormatSymbols for symbolsRef \"" + symbolsRef + "\".");
}
}
// Get a SimpleDateFormat using locale if necessary
if (localeRef != null) {
Locale locale = (Locale) pageContext.findAttribute(localeRef);
if (locale == null) {
throw new JspException("datetime format tag could not find locale for localeRef \"" + localeRef + "\".");
}
sdf = new SimpleDateFormat(pat, locale);
}
else if (locale_flag) {
sdf = new SimpleDateFormat(pat, pageContext.getRequest().getLocale());
}
else if (symbols != null) {
sdf = new SimpleDateFormat(pat, symbols);
}
else {
sdf = new SimpleDateFormat(pat);
}
// See if there is a timeZone
if (timeZone_string != null) {
TimeZone timeZone = (TimeZone) pageContext.getAttribute(timeZone_string, PageContext.SESSION_SCOPE);
if (timeZone == null) {
throw new JspTagException("Datetime format tag timeZone " + "script variable \"" + timeZone_string + " \" does not exist");
}
sdf.setTimeZone(timeZone);
}
// Format the date for display
date_formatted = sdf.format(output_date);
}
try {
pageContext.getOut().write(date_formatted);
}
catch (Exception e) {
throw new JspException("IO Error: " + e.getMessage());
}
return EVAL_PAGE;
} | [
"@",
"Override",
"public",
"final",
"int",
"doEndTag",
"(",
")",
"throws",
"JspException",
"{",
"String",
"date_formatted",
"=",
"default_text",
";",
"if",
"(",
"output_date",
"!=",
"null",
")",
"{",
"// Get the pattern to use",
"SimpleDateFormat",
"sdf",
";",
"... | Method called at end of Tag
@return EVAL_PAGE | [
"Method",
"called",
"at",
"end",
"of",
"Tag"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/org/apache/taglibs/datetime/FormatTag.java#L101-L168 |
30,355 | lucee/Lucee | core/src/main/java/lucee/commons/lang/PCLCollection.java | PCLCollection.loadClass | public synchronized Class<?> loadClass(String className) throws ClassNotFoundException {
// if class is already loaded flush the classloader and do new classloader
PCLBlock cl = index.get(className);
if (cl != null) {
return cl.loadClass(className);
}
throw new ClassNotFoundException("class " + className + " not found");
} | java | public synchronized Class<?> loadClass(String className) throws ClassNotFoundException {
// if class is already loaded flush the classloader and do new classloader
PCLBlock cl = index.get(className);
if (cl != null) {
return cl.loadClass(className);
}
throw new ClassNotFoundException("class " + className + " not found");
} | [
"public",
"synchronized",
"Class",
"<",
"?",
">",
"loadClass",
"(",
"String",
"className",
")",
"throws",
"ClassNotFoundException",
"{",
"// if class is already loaded flush the classloader and do new classloader",
"PCLBlock",
"cl",
"=",
"index",
".",
"get",
"(",
"classNa... | load existing class
@param name
@return
@throws ClassNotFoundException | [
"load",
"existing",
"class"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/lang/PCLCollection.java#L119-L126 |
30,356 | lucee/Lucee | core/src/main/java/lucee/commons/lang/PCLCollection.java | PCLCollection.shrink | public synchronized int shrink(boolean force) {
int before = index.size();
// CFM
int flushCFM = 0;
while (cfms.size() > 1) {
flush(cfms.poll());
flushCFM++;
}
// CFC
if (force && flushCFM < 2 && cfcs.size() > 1) {
flush(oldest(cfcs));
if (cfcs.size() > 1) flush(cfcs.poll());
}
// print.o("shrink("+mapping.getVirtual()+"):"+(before-index.size())+">"+force+";"+(flushCFM));
return before - index.size();
} | java | public synchronized int shrink(boolean force) {
int before = index.size();
// CFM
int flushCFM = 0;
while (cfms.size() > 1) {
flush(cfms.poll());
flushCFM++;
}
// CFC
if (force && flushCFM < 2 && cfcs.size() > 1) {
flush(oldest(cfcs));
if (cfcs.size() > 1) flush(cfcs.poll());
}
// print.o("shrink("+mapping.getVirtual()+"):"+(before-index.size())+">"+force+";"+(flushCFM));
return before - index.size();
} | [
"public",
"synchronized",
"int",
"shrink",
"(",
"boolean",
"force",
")",
"{",
"int",
"before",
"=",
"index",
".",
"size",
"(",
")",
";",
"// CFM",
"int",
"flushCFM",
"=",
"0",
";",
"while",
"(",
"cfms",
".",
"size",
"(",
")",
">",
"1",
")",
"{",
... | shrink the classloader elements
@return how many page have removed from classloaders | [
"shrink",
"the",
"classloader",
"elements"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/lang/PCLCollection.java#L142-L159 |
30,357 | lucee/Lucee | core/src/main/java/lucee/runtime/type/ArrayImplNS.java | ArrayImplNS.setE | @Override
public Object setE(int key, Object value) throws ExpressionException {
if (offset + key > arr.length) enlargeCapacity(key);
if (key > size) size = key;
arr[(offset + key) - 1] = checkValue(value);
return value;
} | java | @Override
public Object setE(int key, Object value) throws ExpressionException {
if (offset + key > arr.length) enlargeCapacity(key);
if (key > size) size = key;
arr[(offset + key) - 1] = checkValue(value);
return value;
} | [
"@",
"Override",
"public",
"Object",
"setE",
"(",
"int",
"key",
",",
"Object",
"value",
")",
"throws",
"ExpressionException",
"{",
"if",
"(",
"offset",
"+",
"key",
">",
"arr",
".",
"length",
")",
"enlargeCapacity",
"(",
"key",
")",
";",
"if",
"(",
"key... | set value at defined position
@param key
@param value
@return defined value
@throws ExpressionException | [
"set",
"value",
"at",
"defined",
"position"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/ArrayImplNS.java#L220-L226 |
30,358 | lucee/Lucee | core/src/main/java/lucee/runtime/type/ArrayImplNS.java | ArrayImplNS.add | @Override
public boolean add(Object o) {
if (offset + size + 1 > arr.length) enlargeCapacity(size + 1);
arr[offset + size] = o;
size++;
return true;
} | java | @Override
public boolean add(Object o) {
if (offset + size + 1 > arr.length) enlargeCapacity(size + 1);
arr[offset + size] = o;
size++;
return true;
} | [
"@",
"Override",
"public",
"boolean",
"add",
"(",
"Object",
"o",
")",
"{",
"if",
"(",
"offset",
"+",
"size",
"+",
"1",
">",
"arr",
".",
"length",
")",
"enlargeCapacity",
"(",
"size",
"+",
"1",
")",
";",
"arr",
"[",
"offset",
"+",
"size",
"]",
"="... | adds a value and return this array
@param o
@return this Array | [
"adds",
"a",
"value",
"and",
"return",
"this",
"array"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/ArrayImplNS.java#L441-L447 |
30,359 | lucee/Lucee | core/src/main/java/lucee/servlet/pic/PicServlet.java | PicServlet.service | @Override
protected void service(HttpServletRequest req, HttpServletResponse rsp) throws ServletException, IOException {
// get out Stream
// pic
String[] arrPath = (req.getServletPath()).split("\\.");
String pic = PIC_SOURCE + "404.gif";
if (arrPath.length >= 3) {
pic = PIC_SOURCE + ((arrPath[arrPath.length - 3] + "." + arrPath[arrPath.length - 2]).replaceFirst("/", ""));
// mime type
String mime = "image/" + arrPath[arrPath.length - 2];
ReqRspUtil.setContentType(rsp, mime);
}
// write data from pic input to response output
OutputStream os = null;
InputStream is = null;
try {
os = rsp.getOutputStream();
is = getClass().getResourceAsStream(pic);
if (is == null) {
is = getClass().getResourceAsStream(PIC_SOURCE + "404.gif");
}
byte[] buf = new byte[4 * 1024];
int nread = 0;
while ((nread = is.read(buf)) >= 0) {
os.write(buf, 0, nread);
}
}
catch (FileNotFoundException e) {}
catch (IOException e) {}
finally {
IOUtil.closeEL(is, os);
}
} | java | @Override
protected void service(HttpServletRequest req, HttpServletResponse rsp) throws ServletException, IOException {
// get out Stream
// pic
String[] arrPath = (req.getServletPath()).split("\\.");
String pic = PIC_SOURCE + "404.gif";
if (arrPath.length >= 3) {
pic = PIC_SOURCE + ((arrPath[arrPath.length - 3] + "." + arrPath[arrPath.length - 2]).replaceFirst("/", ""));
// mime type
String mime = "image/" + arrPath[arrPath.length - 2];
ReqRspUtil.setContentType(rsp, mime);
}
// write data from pic input to response output
OutputStream os = null;
InputStream is = null;
try {
os = rsp.getOutputStream();
is = getClass().getResourceAsStream(pic);
if (is == null) {
is = getClass().getResourceAsStream(PIC_SOURCE + "404.gif");
}
byte[] buf = new byte[4 * 1024];
int nread = 0;
while ((nread = is.read(buf)) >= 0) {
os.write(buf, 0, nread);
}
}
catch (FileNotFoundException e) {}
catch (IOException e) {}
finally {
IOUtil.closeEL(is, os);
}
} | [
"@",
"Override",
"protected",
"void",
"service",
"(",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"rsp",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"// get out Stream",
"// pic",
"String",
"[",
"]",
"arrPath",
"=",
"(",
"req",
".",
... | Interpretiert den Script-Name und laedt das entsprechende Bild aus den internen Resourcen.
@see javax.servlet.http.HttpServlet#service(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse) | [
"Interpretiert",
"den",
"Script",
"-",
"Name",
"und",
"laedt",
"das",
"entsprechende",
"Bild",
"aus",
"den",
"internen",
"Resourcen",
"."
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/servlet/pic/PicServlet.java#L53-L89 |
30,360 | lucee/Lucee | core/src/main/java/lucee/transformer/util/Hash.java | Hash.getHashText | public static String getHashText(String plainText, String algorithm) throws NoSuchAlgorithmException {
MessageDigest mdAlgorithm = MessageDigest.getInstance(algorithm);
mdAlgorithm.update(plainText.getBytes());
byte[] digest = mdAlgorithm.digest();
StringBuffer hexString = new StringBuffer();
for (int i = 0; i < digest.length; i++) {
plainText = Integer.toHexString(0xFF & digest[i]);
if (plainText.length() < 2) {
plainText = "0" + plainText;
}
hexString.append(plainText);
}
return hexString.toString();
} | java | public static String getHashText(String plainText, String algorithm) throws NoSuchAlgorithmException {
MessageDigest mdAlgorithm = MessageDigest.getInstance(algorithm);
mdAlgorithm.update(plainText.getBytes());
byte[] digest = mdAlgorithm.digest();
StringBuffer hexString = new StringBuffer();
for (int i = 0; i < digest.length; i++) {
plainText = Integer.toHexString(0xFF & digest[i]);
if (plainText.length() < 2) {
plainText = "0" + plainText;
}
hexString.append(plainText);
}
return hexString.toString();
} | [
"public",
"static",
"String",
"getHashText",
"(",
"String",
"plainText",
",",
"String",
"algorithm",
")",
"throws",
"NoSuchAlgorithmException",
"{",
"MessageDigest",
"mdAlgorithm",
"=",
"MessageDigest",
".",
"getInstance",
"(",
"algorithm",
")",
";",
"mdAlgorithm",
... | Method getHashText.
@param plainText
@param algorithm The algorithm to use like MD2, MD5, SHA-1, etc.
@return String
@throws NoSuchAlgorithmException | [
"Method",
"getHashText",
"."
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/util/Hash.java#L68-L87 |
30,361 | lucee/Lucee | core/src/main/java/lucee/transformer/library/function/FunctionLibFactory.java | FunctionLibFactory.characters | @Override
public void characters(char ch[], int start, int length) {
content.append(new String(ch, start, length));
} | java | @Override
public void characters(char ch[], int start, int length) {
content.append(new String(ch, start, length));
} | [
"@",
"Override",
"public",
"void",
"characters",
"(",
"char",
"ch",
"[",
"]",
",",
"int",
"start",
",",
"int",
"length",
")",
"{",
"content",
".",
"append",
"(",
"new",
"String",
"(",
"ch",
",",
"start",
",",
"length",
")",
")",
";",
"}"
] | Geerbte Methode von org.xml.sax.ContentHandler, wird bei durchparsen des XML, zum einlesen des
Content eines Body Element aufgerufen.
@see org.xml.sax.ContentHandler#characters(char[], int, int) | [
"Geerbte",
"Methode",
"von",
"org",
".",
"xml",
".",
"sax",
".",
"ContentHandler",
"wird",
"bei",
"durchparsen",
"des",
"XML",
"zum",
"einlesen",
"des",
"Content",
"eines",
"Body",
"Element",
"aufgerufen",
"."
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/library/function/FunctionLibFactory.java#L260-L263 |
30,362 | lucee/Lucee | core/src/main/java/lucee/transformer/library/function/FunctionLibFactory.java | FunctionLibFactory.loadFromDirectory | public static FunctionLib[] loadFromDirectory(Resource dir, Identification id) throws FunctionLibException {
if (!dir.isDirectory()) return new FunctionLib[0];
ArrayList<FunctionLib> arr = new ArrayList<FunctionLib>();
Resource[] files = dir.listResources(new ExtensionResourceFilter(new String[] { "fld", "fldx" }));
for (int i = 0; i < files.length; i++) {
if (files[i].isFile()) arr.add(FunctionLibFactory.loadFromFile(files[i], id));
}
return arr.toArray(new FunctionLib[arr.size()]);
} | java | public static FunctionLib[] loadFromDirectory(Resource dir, Identification id) throws FunctionLibException {
if (!dir.isDirectory()) return new FunctionLib[0];
ArrayList<FunctionLib> arr = new ArrayList<FunctionLib>();
Resource[] files = dir.listResources(new ExtensionResourceFilter(new String[] { "fld", "fldx" }));
for (int i = 0; i < files.length; i++) {
if (files[i].isFile()) arr.add(FunctionLibFactory.loadFromFile(files[i], id));
}
return arr.toArray(new FunctionLib[arr.size()]);
} | [
"public",
"static",
"FunctionLib",
"[",
"]",
"loadFromDirectory",
"(",
"Resource",
"dir",
",",
"Identification",
"id",
")",
"throws",
"FunctionLibException",
"{",
"if",
"(",
"!",
"dir",
".",
"isDirectory",
"(",
")",
")",
"return",
"new",
"FunctionLib",
"[",
... | Laedt mehrere FunctionLib's die innerhalb eines Verzeichnisses liegen.
@param dir Verzeichnis im dem die FunctionLib's liegen.
@param saxParser Definition des Sax Parser mit dem die FunctionLib's eingelesen werden sollen.
@return FunctionLib's als Array
@throws FunctionLibException | [
"Laedt",
"mehrere",
"FunctionLib",
"s",
"die",
"innerhalb",
"eines",
"Verzeichnisses",
"liegen",
"."
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/library/function/FunctionLibFactory.java#L353-L363 |
30,363 | lucee/Lucee | core/src/main/java/lucee/transformer/library/function/FunctionLibFactory.java | FunctionLibFactory.loadFromFile | public static FunctionLib loadFromFile(Resource res, Identification id) throws FunctionLibException {
// Read in XML
FunctionLib lib = FunctionLibFactory.hashLib.get(id(res));// getHashLib(file.getAbsolutePath());
if (lib == null) {
lib = new FunctionLibFactory(null, res, id, false).getLib();
FunctionLibFactory.hashLib.put(id(res), lib);
}
lib.setSource(res.toString());
return lib;
} | java | public static FunctionLib loadFromFile(Resource res, Identification id) throws FunctionLibException {
// Read in XML
FunctionLib lib = FunctionLibFactory.hashLib.get(id(res));// getHashLib(file.getAbsolutePath());
if (lib == null) {
lib = new FunctionLibFactory(null, res, id, false).getLib();
FunctionLibFactory.hashLib.put(id(res), lib);
}
lib.setSource(res.toString());
return lib;
} | [
"public",
"static",
"FunctionLib",
"loadFromFile",
"(",
"Resource",
"res",
",",
"Identification",
"id",
")",
"throws",
"FunctionLibException",
"{",
"// Read in XML",
"FunctionLib",
"lib",
"=",
"FunctionLibFactory",
".",
"hashLib",
".",
"get",
"(",
"id",
"(",
"res"... | Laedt eine einzelne FunctionLib.
@param res FLD die geladen werden soll.
@param saxParser Definition des Sax Parser mit dem die FunctionLib eingelsesen werden soll.
@return FunctionLib
@throws FunctionLibException | [
"Laedt",
"eine",
"einzelne",
"FunctionLib",
"."
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/library/function/FunctionLibFactory.java#L373-L383 |
30,364 | lucee/Lucee | core/src/main/java/lucee/transformer/library/function/FunctionLibFactory.java | FunctionLibFactory.loadFromSystem | public static FunctionLib[] loadFromSystem(Identification id) throws FunctionLibException {
if (systemFLDs[CFMLEngine.DIALECT_CFML] == null) {
FunctionLib cfml = new FunctionLibFactory(null, FLD_BASE, id, true).getLib();
FunctionLib lucee = cfml.duplicate(false);
systemFLDs[CFMLEngine.DIALECT_CFML] = new FunctionLibFactory(cfml, FLD_CFML, id, true).getLib();
systemFLDs[CFMLEngine.DIALECT_LUCEE] = new FunctionLibFactory(lucee, FLD_LUCEE, id, true).getLib();
}
return systemFLDs;
} | java | public static FunctionLib[] loadFromSystem(Identification id) throws FunctionLibException {
if (systemFLDs[CFMLEngine.DIALECT_CFML] == null) {
FunctionLib cfml = new FunctionLibFactory(null, FLD_BASE, id, true).getLib();
FunctionLib lucee = cfml.duplicate(false);
systemFLDs[CFMLEngine.DIALECT_CFML] = new FunctionLibFactory(cfml, FLD_CFML, id, true).getLib();
systemFLDs[CFMLEngine.DIALECT_LUCEE] = new FunctionLibFactory(lucee, FLD_LUCEE, id, true).getLib();
}
return systemFLDs;
} | [
"public",
"static",
"FunctionLib",
"[",
"]",
"loadFromSystem",
"(",
"Identification",
"id",
")",
"throws",
"FunctionLibException",
"{",
"if",
"(",
"systemFLDs",
"[",
"CFMLEngine",
".",
"DIALECT_CFML",
"]",
"==",
"null",
")",
"{",
"FunctionLib",
"cfml",
"=",
"n... | Laedt die Systeminterne FLD.
@param saxParser Definition des Sax Parser mit dem die FunctionLib eingelsesen werden soll.
@return FunctionLib
@throws FunctionLibException | [
"Laedt",
"die",
"Systeminterne",
"FLD",
"."
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/library/function/FunctionLibFactory.java#L410-L418 |
30,365 | lucee/Lucee | core/src/main/java/lucee/transformer/library/function/FunctionLibFactory.java | FunctionLibFactory.copyFunctions | private static void copyFunctions(FunctionLib extFL, FunctionLib newFL) {
Iterator<Entry<String, FunctionLibFunction>> it = extFL.getFunctions().entrySet().iterator();
FunctionLibFunction flf;
while (it.hasNext()) {
flf = it.next().getValue(); // TODO function must be duplicated because it gets a new FunctionLib assigned
newFL.setFunction(flf);
}
} | java | private static void copyFunctions(FunctionLib extFL, FunctionLib newFL) {
Iterator<Entry<String, FunctionLibFunction>> it = extFL.getFunctions().entrySet().iterator();
FunctionLibFunction flf;
while (it.hasNext()) {
flf = it.next().getValue(); // TODO function must be duplicated because it gets a new FunctionLib assigned
newFL.setFunction(flf);
}
} | [
"private",
"static",
"void",
"copyFunctions",
"(",
"FunctionLib",
"extFL",
",",
"FunctionLib",
"newFL",
")",
"{",
"Iterator",
"<",
"Entry",
"<",
"String",
",",
"FunctionLibFunction",
">",
">",
"it",
"=",
"extFL",
".",
"getFunctions",
"(",
")",
".",
"entrySet... | copy function from one FunctionLib to a other
@param extFL
@param newFL | [
"copy",
"function",
"from",
"one",
"FunctionLib",
"to",
"a",
"other"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/library/function/FunctionLibFactory.java#L463-L470 |
30,366 | lucee/Lucee | core/src/main/java/lucee/transformer/library/function/FunctionLibFactory.java | FunctionLibFactory.setAttributes | private static void setAttributes(FunctionLib extFL, FunctionLib newFL) {
newFL.setDescription(extFL.getDescription());
newFL.setDisplayName(extFL.getDisplayName());
newFL.setShortName(extFL.getShortName());
newFL.setUri(extFL.getUri());
newFL.setVersion(extFL.getVersion());
} | java | private static void setAttributes(FunctionLib extFL, FunctionLib newFL) {
newFL.setDescription(extFL.getDescription());
newFL.setDisplayName(extFL.getDisplayName());
newFL.setShortName(extFL.getShortName());
newFL.setUri(extFL.getUri());
newFL.setVersion(extFL.getVersion());
} | [
"private",
"static",
"void",
"setAttributes",
"(",
"FunctionLib",
"extFL",
",",
"FunctionLib",
"newFL",
")",
"{",
"newFL",
".",
"setDescription",
"(",
"extFL",
".",
"getDescription",
"(",
")",
")",
";",
"newFL",
".",
"setDisplayName",
"(",
"extFL",
".",
"get... | copy attributes from old fld to the new
@param extFL
@param newFL | [
"copy",
"attributes",
"from",
"old",
"fld",
"to",
"the",
"new"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/library/function/FunctionLibFactory.java#L478-L484 |
30,367 | lucee/Lucee | core/src/main/java/lucee/runtime/crypt/BlowfishCBC.java | BlowfishCBC.encryptBlock | @Override
protected long encryptBlock(long lPlainblock) {
// chain with the CBC IV
lPlainblock ^= m_lCBCIV;
// encrypt the block
lPlainblock = super.encryptBlock(lPlainblock);
// the encrypted block is the new CBC IV
return (m_lCBCIV = lPlainblock);
} | java | @Override
protected long encryptBlock(long lPlainblock) {
// chain with the CBC IV
lPlainblock ^= m_lCBCIV;
// encrypt the block
lPlainblock = super.encryptBlock(lPlainblock);
// the encrypted block is the new CBC IV
return (m_lCBCIV = lPlainblock);
} | [
"@",
"Override",
"protected",
"long",
"encryptBlock",
"(",
"long",
"lPlainblock",
")",
"{",
"// chain with the CBC IV",
"lPlainblock",
"^=",
"m_lCBCIV",
";",
"// encrypt the block",
"lPlainblock",
"=",
"super",
".",
"encryptBlock",
"(",
"lPlainblock",
")",
";",
"// ... | internal routine to encrypt a block in CBC mode | [
"internal",
"routine",
"to",
"encrypt",
"a",
"block",
"in",
"CBC",
"mode"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/crypt/BlowfishCBC.java#L168-L183 |
30,368 | lucee/Lucee | core/src/main/java/lucee/runtime/crypt/BlowfishCBC.java | BlowfishCBC.decryptBlock | @Override
protected long decryptBlock(long lCipherblock) {
// save the current block
long lTemp = lCipherblock;
// decrypt the block
lCipherblock = super.decryptBlock(lCipherblock);
// dechain the block
lCipherblock ^= m_lCBCIV;
// set the new CBC IV
m_lCBCIV = lTemp;
// return the decrypted block
return lCipherblock;
} | java | @Override
protected long decryptBlock(long lCipherblock) {
// save the current block
long lTemp = lCipherblock;
// decrypt the block
lCipherblock = super.decryptBlock(lCipherblock);
// dechain the block
lCipherblock ^= m_lCBCIV;
// set the new CBC IV
m_lCBCIV = lTemp;
// return the decrypted block
return lCipherblock;
} | [
"@",
"Override",
"protected",
"long",
"decryptBlock",
"(",
"long",
"lCipherblock",
")",
"{",
"// save the current block",
"long",
"lTemp",
"=",
"lCipherblock",
";",
"// decrypt the block",
"lCipherblock",
"=",
"super",
".",
"decryptBlock",
"(",
"lCipherblock",
")",
... | internal routine to decrypt a block in CBC mode | [
"internal",
"routine",
"to",
"decrypt",
"a",
"block",
"in",
"CBC",
"mode"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/crypt/BlowfishCBC.java#L187-L210 |
30,369 | lucee/Lucee | core/src/main/java/lucee/runtime/tag/Exit.java | Exit.setMethod | public void setMethod(String method) {
method = method.toLowerCase();
if (method.equals("loop")) this.method = MODE_LOOP;
else if (method.equals("exittag")) this.method = MODE_EXIT_TAG;
else if (method.equals("exittemplate")) this.method = MODE_EXIT_TEMPLATE;
} | java | public void setMethod(String method) {
method = method.toLowerCase();
if (method.equals("loop")) this.method = MODE_LOOP;
else if (method.equals("exittag")) this.method = MODE_EXIT_TAG;
else if (method.equals("exittemplate")) this.method = MODE_EXIT_TEMPLATE;
} | [
"public",
"void",
"setMethod",
"(",
"String",
"method",
")",
"{",
"method",
"=",
"method",
".",
"toLowerCase",
"(",
")",
";",
"if",
"(",
"method",
".",
"equals",
"(",
"\"loop\"",
")",
")",
"this",
".",
"method",
"=",
"MODE_LOOP",
";",
"else",
"if",
"... | set the value method
@param method value to set | [
"set",
"the",
"value",
"method"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/tag/Exit.java#L52-L57 |
30,370 | lucee/Lucee | core/src/main/java/lucee/runtime/cache/legacy/FileCacheEntry.java | FileCacheEntry.isOK | private boolean isOK(TimeSpan timeSpan) {
return res.exists() && (res.lastModified() + timeSpan.getMillis() >= System.currentTimeMillis());
} | java | private boolean isOK(TimeSpan timeSpan) {
return res.exists() && (res.lastModified() + timeSpan.getMillis() >= System.currentTimeMillis());
} | [
"private",
"boolean",
"isOK",
"(",
"TimeSpan",
"timeSpan",
")",
"{",
"return",
"res",
".",
"exists",
"(",
")",
"&&",
"(",
"res",
".",
"lastModified",
"(",
")",
"+",
"timeSpan",
".",
"getMillis",
"(",
")",
">=",
"System",
".",
"currentTimeMillis",
"(",
... | private String name,raw; | [
"private",
"String",
"name",
"raw",
";"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/cache/legacy/FileCacheEntry.java#L35-L37 |
30,371 | lucee/Lucee | core/src/main/java/lucee/transformer/bytecode/Page.java | Page.registerString | public Range registerString(BytecodeContext bc, String str) throws IOException {
boolean append = true;
if (staticTextLocation == null) {
if (bc.getPageSource() == null) return null;
PageSource ps = bc.getPageSource();
Mapping m = ps.getMapping();
staticTextLocation = m.getClassRootDirectory();
staticTextLocation.mkdirs();
staticTextLocation = staticTextLocation.getRealResource(ps.getClassName().replace('.', '/') + ".txt");
if (staticTextLocation.exists()) append = false;
else staticTextLocation.createFile(true);
off = 0;
}
IOUtil.write(staticTextLocation, str, CharsetUtil.UTF8, append);
Range r = new Range(off, str.length());
off += str.length();
return r;
} | java | public Range registerString(BytecodeContext bc, String str) throws IOException {
boolean append = true;
if (staticTextLocation == null) {
if (bc.getPageSource() == null) return null;
PageSource ps = bc.getPageSource();
Mapping m = ps.getMapping();
staticTextLocation = m.getClassRootDirectory();
staticTextLocation.mkdirs();
staticTextLocation = staticTextLocation.getRealResource(ps.getClassName().replace('.', '/') + ".txt");
if (staticTextLocation.exists()) append = false;
else staticTextLocation.createFile(true);
off = 0;
}
IOUtil.write(staticTextLocation, str, CharsetUtil.UTF8, append);
Range r = new Range(off, str.length());
off += str.length();
return r;
} | [
"public",
"Range",
"registerString",
"(",
"BytecodeContext",
"bc",
",",
"String",
"str",
")",
"throws",
"IOException",
"{",
"boolean",
"append",
"=",
"true",
";",
"if",
"(",
"staticTextLocation",
"==",
"null",
")",
"{",
"if",
"(",
"bc",
".",
"getPageSource",... | return null if not possible to register
@param bc
@param str
@return
@throws IOException | [
"return",
"null",
"if",
"not",
"possible",
"to",
"register"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/bytecode/Page.java#L1612-L1634 |
30,372 | lucee/Lucee | core/src/main/java/lucee/runtime/type/util/ComponentUtil.java | ComponentUtil.hasChangesOfChildren | private static boolean hasChangesOfChildren(long last, PageContext pc, Class clazz) {
java.lang.reflect.Method[] methods = clazz.getMethods();
java.lang.reflect.Method method;
Class[] params;
for (int i = 0; i < methods.length; i++) {
method = methods[i];
if (method.getDeclaringClass() == clazz) {
if (_hasChangesOfChildren(pc, last, method.getReturnType())) return true;
params = method.getParameterTypes();
for (int y = 0; y < params.length; y++) {
if (_hasChangesOfChildren(pc, last, params[y])) return true;
}
}
}
return false;
} | java | private static boolean hasChangesOfChildren(long last, PageContext pc, Class clazz) {
java.lang.reflect.Method[] methods = clazz.getMethods();
java.lang.reflect.Method method;
Class[] params;
for (int i = 0; i < methods.length; i++) {
method = methods[i];
if (method.getDeclaringClass() == clazz) {
if (_hasChangesOfChildren(pc, last, method.getReturnType())) return true;
params = method.getParameterTypes();
for (int y = 0; y < params.length; y++) {
if (_hasChangesOfChildren(pc, last, params[y])) return true;
}
}
}
return false;
} | [
"private",
"static",
"boolean",
"hasChangesOfChildren",
"(",
"long",
"last",
",",
"PageContext",
"pc",
",",
"Class",
"clazz",
")",
"{",
"java",
".",
"lang",
".",
"reflect",
".",
"Method",
"[",
"]",
"methods",
"=",
"clazz",
".",
"getMethods",
"(",
")",
";... | check if one of the children is changed
@param component
@param pc
@param clazz
@return return true if children has changed | [
"check",
"if",
"one",
"of",
"the",
"children",
"is",
"changed"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/util/ComponentUtil.java#L221-L237 |
30,373 | lucee/Lucee | core/src/main/java/lucee/runtime/type/util/ComponentUtil.java | ComponentUtil.toIntAccess | public static int toIntAccess(String access) throws ApplicationException {
access = StringUtil.toLowerCase(access.trim());
if (access.equals("package")) return Component.ACCESS_PACKAGE;
else if (access.equals("private")) return Component.ACCESS_PRIVATE;
else if (access.equals("public")) return Component.ACCESS_PUBLIC;
else if (access.equals("remote")) return Component.ACCESS_REMOTE;
throw new ApplicationException("invalid access type [" + access + "], access types are remote, public, package, private");
} | java | public static int toIntAccess(String access) throws ApplicationException {
access = StringUtil.toLowerCase(access.trim());
if (access.equals("package")) return Component.ACCESS_PACKAGE;
else if (access.equals("private")) return Component.ACCESS_PRIVATE;
else if (access.equals("public")) return Component.ACCESS_PUBLIC;
else if (access.equals("remote")) return Component.ACCESS_REMOTE;
throw new ApplicationException("invalid access type [" + access + "], access types are remote, public, package, private");
} | [
"public",
"static",
"int",
"toIntAccess",
"(",
"String",
"access",
")",
"throws",
"ApplicationException",
"{",
"access",
"=",
"StringUtil",
".",
"toLowerCase",
"(",
"access",
".",
"trim",
"(",
")",
")",
";",
"if",
"(",
"access",
".",
"equals",
"(",
"\"pack... | cast a strong access definition to the int type
@param access access type
@return int access type
@throws ExpressionException | [
"cast",
"a",
"strong",
"access",
"definition",
"to",
"the",
"int",
"type"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/util/ComponentUtil.java#L635-L643 |
30,374 | lucee/Lucee | core/src/main/java/lucee/runtime/type/util/ComponentUtil.java | ComponentUtil.toStringAccess | public static String toStringAccess(int access) throws ApplicationException {
String res = toStringAccess(access, null);
if (res != null) return res;
throw new ApplicationException(
"invalid access type [" + access + "], access types are Component.ACCESS_PACKAGE, Component.ACCESS_PRIVATE, Component.ACCESS_PUBLIC, Component.ACCESS_REMOTE");
} | java | public static String toStringAccess(int access) throws ApplicationException {
String res = toStringAccess(access, null);
if (res != null) return res;
throw new ApplicationException(
"invalid access type [" + access + "], access types are Component.ACCESS_PACKAGE, Component.ACCESS_PRIVATE, Component.ACCESS_PUBLIC, Component.ACCESS_REMOTE");
} | [
"public",
"static",
"String",
"toStringAccess",
"(",
"int",
"access",
")",
"throws",
"ApplicationException",
"{",
"String",
"res",
"=",
"toStringAccess",
"(",
"access",
",",
"null",
")",
";",
"if",
"(",
"res",
"!=",
"null",
")",
"return",
"res",
";",
"thro... | cast int type to string type
@param access
@return String access type
@throws ExpressionException | [
"cast",
"int",
"type",
"to",
"string",
"type"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/util/ComponentUtil.java#L661-L666 |
30,375 | lucee/Lucee | core/src/main/java/lucee/runtime/tag/Col.java | Col.setAlign | public void setAlign(String align) throws ApplicationException {
align = StringUtil.toLowerCase(align);
if (align.equals("left")) this.align = Table.ALIGN_LEFT;
else if (align.equals("center")) this.align = Table.ALIGN_CENTER;
else if (align.equals("right")) this.align = Table.ALIGN_RIGHT;
else throw new ApplicationException("value [" + align + "] of attribute align from tag col is invalid", "valid values are [left, center, right]");
} | java | public void setAlign(String align) throws ApplicationException {
align = StringUtil.toLowerCase(align);
if (align.equals("left")) this.align = Table.ALIGN_LEFT;
else if (align.equals("center")) this.align = Table.ALIGN_CENTER;
else if (align.equals("right")) this.align = Table.ALIGN_RIGHT;
else throw new ApplicationException("value [" + align + "] of attribute align from tag col is invalid", "valid values are [left, center, right]");
} | [
"public",
"void",
"setAlign",
"(",
"String",
"align",
")",
"throws",
"ApplicationException",
"{",
"align",
"=",
"StringUtil",
".",
"toLowerCase",
"(",
"align",
")",
";",
"if",
"(",
"align",
".",
"equals",
"(",
"\"left\"",
")",
")",
"this",
".",
"align",
... | set the value align Column alignment, Left, Right, or Center.
@param align value to set
@throws ApplicationException | [
"set",
"the",
"value",
"align",
"Column",
"alignment",
"Left",
"Right",
"or",
"Center",
"."
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/tag/Col.java#L94-L100 |
30,376 | lucee/Lucee | core/src/main/java/lucee/runtime/converter/JSConverter.java | JSConverter.serialize | public String serialize(Object object, String clientVariableName) throws ConverterException {
StringBuilder sb = new StringBuilder();
_serialize(clientVariableName, object, sb, new HashSet<Object>());
String str = sb.toString().trim();
return clientVariableName + "=" + str + (StringUtil.endsWith(str, ';') ? "" : ";");
// return sb.toString();
} | java | public String serialize(Object object, String clientVariableName) throws ConverterException {
StringBuilder sb = new StringBuilder();
_serialize(clientVariableName, object, sb, new HashSet<Object>());
String str = sb.toString().trim();
return clientVariableName + "=" + str + (StringUtil.endsWith(str, ';') ? "" : ";");
// return sb.toString();
} | [
"public",
"String",
"serialize",
"(",
"Object",
"object",
",",
"String",
"clientVariableName",
")",
"throws",
"ConverterException",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"_serialize",
"(",
"clientVariableName",
",",
"object",
",",... | serialize a CFML object to a JavaScript Object
@param object object to serialize
@param clientVariableName name of the variable to create
@return vonverte Javascript Code as String
@throws ConverterException | [
"serialize",
"a",
"CFML",
"object",
"to",
"a",
"JavaScript",
"Object"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/converter/JSConverter.java#L65-L71 |
30,377 | lucee/Lucee | core/src/main/java/lucee/runtime/functions/other/GetTickCount.java | GetTickCount.call | public static double call(PageContext pc, double unit) {
if (UNIT_NANO == unit) return System.nanoTime();
if (UNIT_MICRO == unit) return System.nanoTime() / 1000;
if (UNIT_MILLI == unit) return System.currentTimeMillis();
return System.currentTimeMillis() / 1000;
} | java | public static double call(PageContext pc, double unit) {
if (UNIT_NANO == unit) return System.nanoTime();
if (UNIT_MICRO == unit) return System.nanoTime() / 1000;
if (UNIT_MILLI == unit) return System.currentTimeMillis();
return System.currentTimeMillis() / 1000;
} | [
"public",
"static",
"double",
"call",
"(",
"PageContext",
"pc",
",",
"double",
"unit",
")",
"{",
"if",
"(",
"UNIT_NANO",
"==",
"unit",
")",
"return",
"System",
".",
"nanoTime",
"(",
")",
";",
"if",
"(",
"UNIT_MICRO",
"==",
"unit",
")",
"return",
"Syste... | this function is only called when the evaluator validates the unit definition on compilation time | [
"this",
"function",
"is",
"only",
"called",
"when",
"the",
"evaluator",
"validates",
"the",
"unit",
"definition",
"on",
"compilation",
"time"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/functions/other/GetTickCount.java#L59-L64 |
30,378 | lucee/Lucee | core/src/main/java/lucee/runtime/regex/Perl5Util.java | Perl5Util.indexOf | public static Object indexOf(String strPattern, String strInput, int offset, boolean caseSensitive, boolean matchAll) throws MalformedPatternException {
// Perl5Compiler compiler = new Perl5Compiler();
PatternMatcherInput input = new PatternMatcherInput(strInput);
Perl5Matcher matcher = new Perl5Matcher();
int compileOptions = caseSensitive ? 0 : Perl5Compiler.CASE_INSENSITIVE_MASK;
compileOptions += Perl5Compiler.SINGLELINE_MASK;
if (offset < 1) offset = 1;
Pattern pattern = getPattern(strPattern, compileOptions);
// Pattern pattern = compiler.compile(strPattern,compileOptions);
if (offset <= strInput.length()) input.setCurrentOffset(offset - 1);
if (offset <= strInput.length()) {
Array matches = new ArrayImpl();
while (matcher.contains(input, pattern)) {
int match = matcher.getMatch().beginOffset(0) + 1;
if (!matchAll) {
return new Double(match);
}
matches.appendEL(match);
}
if (matches.size() != 0) {
return matches;
}
}
return 0;
} | java | public static Object indexOf(String strPattern, String strInput, int offset, boolean caseSensitive, boolean matchAll) throws MalformedPatternException {
// Perl5Compiler compiler = new Perl5Compiler();
PatternMatcherInput input = new PatternMatcherInput(strInput);
Perl5Matcher matcher = new Perl5Matcher();
int compileOptions = caseSensitive ? 0 : Perl5Compiler.CASE_INSENSITIVE_MASK;
compileOptions += Perl5Compiler.SINGLELINE_MASK;
if (offset < 1) offset = 1;
Pattern pattern = getPattern(strPattern, compileOptions);
// Pattern pattern = compiler.compile(strPattern,compileOptions);
if (offset <= strInput.length()) input.setCurrentOffset(offset - 1);
if (offset <= strInput.length()) {
Array matches = new ArrayImpl();
while (matcher.contains(input, pattern)) {
int match = matcher.getMatch().beginOffset(0) + 1;
if (!matchAll) {
return new Double(match);
}
matches.appendEL(match);
}
if (matches.size() != 0) {
return matches;
}
}
return 0;
} | [
"public",
"static",
"Object",
"indexOf",
"(",
"String",
"strPattern",
",",
"String",
"strInput",
",",
"int",
"offset",
",",
"boolean",
"caseSensitive",
",",
"boolean",
"matchAll",
")",
"throws",
"MalformedPatternException",
"{",
"// Perl5Compiler compiler = new Perl5Com... | return index of the first occurence of the pattern in input text
@param strPattern pattern to search
@param strInput text to search pattern
@param offset
@param caseSensitive
@return position of the first occurence
@throws MalformedPatternException | [
"return",
"index",
"of",
"the",
"first",
"occurence",
"of",
"the",
"pattern",
"in",
"input",
"text"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/regex/Perl5Util.java#L58-L88 |
30,379 | lucee/Lucee | core/src/main/java/lucee/runtime/config/ConfigWebUtil.java | ConfigWebUtil.deployWeb | public static void deployWeb(ConfigServer cs, ConfigWeb cw, boolean throwError) throws IOException {
Resource deploy = cs.getConfigDir().getRealResource("web-deployment"), trg;
if (!deploy.isDirectory()) return;
trg = cw.getRootDirectory();
try {
_deploy(cw, deploy, trg);
}
catch (IOException ioe) {
if (throwError) throw ioe;
SystemOut.printDate(cw.getErrWriter(), ExceptionUtil.getStacktrace(ioe, true));
}
} | java | public static void deployWeb(ConfigServer cs, ConfigWeb cw, boolean throwError) throws IOException {
Resource deploy = cs.getConfigDir().getRealResource("web-deployment"), trg;
if (!deploy.isDirectory()) return;
trg = cw.getRootDirectory();
try {
_deploy(cw, deploy, trg);
}
catch (IOException ioe) {
if (throwError) throw ioe;
SystemOut.printDate(cw.getErrWriter(), ExceptionUtil.getStacktrace(ioe, true));
}
} | [
"public",
"static",
"void",
"deployWeb",
"(",
"ConfigServer",
"cs",
",",
"ConfigWeb",
"cw",
",",
"boolean",
"throwError",
")",
"throws",
"IOException",
"{",
"Resource",
"deploy",
"=",
"cs",
".",
"getConfigDir",
"(",
")",
".",
"getRealResource",
"(",
"\"web-dep... | deploys all content in "web-deployment" to a web context, used for new context mostly or update
existings
@param cs
@param cw
@param throwError
@throws IOException | [
"deploys",
"all",
"content",
"in",
"web",
"-",
"deployment",
"to",
"a",
"web",
"context",
"used",
"for",
"new",
"context",
"mostly",
"or",
"update",
"existings"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/ConfigWebUtil.java#L107-L119 |
30,380 | lucee/Lucee | core/src/main/java/lucee/runtime/config/ConfigWebUtil.java | ConfigWebUtil.getFile | public static Resource getFile(Config config, Resource directory, String path, short type) {
path = replacePlaceholder(path, config);
if (!StringUtil.isEmpty(path, true)) {
Resource file = getFile(directory.getRealResource(path), type);
if (file != null) return file;
file = getFile(config.getResource(path), type);
if (file != null) return file;
}
return null;
} | java | public static Resource getFile(Config config, Resource directory, String path, short type) {
path = replacePlaceholder(path, config);
if (!StringUtil.isEmpty(path, true)) {
Resource file = getFile(directory.getRealResource(path), type);
if (file != null) return file;
file = getFile(config.getResource(path), type);
if (file != null) return file;
}
return null;
} | [
"public",
"static",
"Resource",
"getFile",
"(",
"Config",
"config",
",",
"Resource",
"directory",
",",
"String",
"path",
",",
"short",
"type",
")",
"{",
"path",
"=",
"replacePlaceholder",
"(",
"path",
",",
"config",
")",
";",
"if",
"(",
"!",
"StringUtil",
... | touch a file object by the string definition
@param config
@param directory
@param path
@param type
@return matching file | [
"touch",
"a",
"file",
"object",
"by",
"the",
"string",
"definition"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/ConfigWebUtil.java#L225-L236 |
30,381 | lucee/Lucee | core/src/main/java/lucee/runtime/config/ConfigWebUtil.java | ConfigWebUtil.getFile | static Resource getFile(Resource rootDir, String strDir, String defaultDir, Resource configDir, short type, ConfigImpl config) {
strDir = replacePlaceholder(strDir, config);
if (!StringUtil.isEmpty(strDir, true)) {
Resource res;
if (strDir.indexOf("://") != -1) { // TODO better impl.
res = getFile(config.getResource(strDir), type);
if (res != null) return res;
}
res = rootDir == null ? null : getFile(rootDir.getRealResource(strDir), type);
if (res != null) return res;
res = getFile(config.getResource(strDir), type);
if (res != null) return res;
}
if (defaultDir == null) return null;
Resource file = getFile(configDir.getRealResource(defaultDir), type);
return file;
} | java | static Resource getFile(Resource rootDir, String strDir, String defaultDir, Resource configDir, short type, ConfigImpl config) {
strDir = replacePlaceholder(strDir, config);
if (!StringUtil.isEmpty(strDir, true)) {
Resource res;
if (strDir.indexOf("://") != -1) { // TODO better impl.
res = getFile(config.getResource(strDir), type);
if (res != null) return res;
}
res = rootDir == null ? null : getFile(rootDir.getRealResource(strDir), type);
if (res != null) return res;
res = getFile(config.getResource(strDir), type);
if (res != null) return res;
}
if (defaultDir == null) return null;
Resource file = getFile(configDir.getRealResource(defaultDir), type);
return file;
} | [
"static",
"Resource",
"getFile",
"(",
"Resource",
"rootDir",
",",
"String",
"strDir",
",",
"String",
"defaultDir",
",",
"Resource",
"configDir",
",",
"short",
"type",
",",
"ConfigImpl",
"config",
")",
"{",
"strDir",
"=",
"replacePlaceholder",
"(",
"strDir",
",... | generate a file object by the string definition
@param rootDir
@param strDir
@param defaultDir
@param configDir
@param type
@param config
@return file | [
"generate",
"a",
"file",
"object",
"by",
"the",
"string",
"definition"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/ConfigWebUtil.java#L249-L266 |
30,382 | lucee/Lucee | core/src/main/java/lucee/runtime/config/ConfigWebUtil.java | ConfigWebUtil.getExistingResource | public static Resource getExistingResource(ServletContext sc, String strDir, String defaultDir, Resource configDir, short type, Config config) {
// ARP
strDir = replacePlaceholder(strDir, config);
if (strDir != null && strDir.trim().length() > 0) {
Resource res = sc == null ? null : _getExistingFile(config.getResource(ResourceUtil.merge(ReqRspUtil.getRootPath(sc), strDir)), type);
if (res != null) return res;
res = _getExistingFile(config.getResource(strDir), type);
if (res != null) return res;
}
if (defaultDir == null) return null;
return _getExistingFile(configDir.getRealResource(defaultDir), type);
} | java | public static Resource getExistingResource(ServletContext sc, String strDir, String defaultDir, Resource configDir, short type, Config config) {
// ARP
strDir = replacePlaceholder(strDir, config);
if (strDir != null && strDir.trim().length() > 0) {
Resource res = sc == null ? null : _getExistingFile(config.getResource(ResourceUtil.merge(ReqRspUtil.getRootPath(sc), strDir)), type);
if (res != null) return res;
res = _getExistingFile(config.getResource(strDir), type);
if (res != null) return res;
}
if (defaultDir == null) return null;
return _getExistingFile(configDir.getRealResource(defaultDir), type);
} | [
"public",
"static",
"Resource",
"getExistingResource",
"(",
"ServletContext",
"sc",
",",
"String",
"strDir",
",",
"String",
"defaultDir",
",",
"Resource",
"configDir",
",",
"short",
"type",
",",
"Config",
"config",
")",
"{",
"// ARP",
"strDir",
"=",
"replacePlac... | get only a existing file, dont create it
@param sc
@param strDir
@param defaultDir
@param configDir
@param type
@param config
@return existing file | [
"get",
"only",
"a",
"existing",
"file",
"dont",
"create",
"it"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/ConfigWebUtil.java#L361-L375 |
30,383 | lucee/Lucee | core/src/main/java/lucee/runtime/config/ConfigWebUtil.java | ConfigWebUtil.isFile | public static boolean isFile(Resource file) {
if (file.exists()) return file.isFile();
Resource parent = file.getParentResource();
return parent.mkdirs() && file.createNewFile();
} | java | public static boolean isFile(Resource file) {
if (file.exists()) return file.isFile();
Resource parent = file.getParentResource();
return parent.mkdirs() && file.createNewFile();
} | [
"public",
"static",
"boolean",
"isFile",
"(",
"Resource",
"file",
")",
"{",
"if",
"(",
"file",
".",
"exists",
"(",
")",
")",
"return",
"file",
".",
"isFile",
"(",
")",
";",
"Resource",
"parent",
"=",
"file",
".",
"getParentResource",
"(",
")",
";",
"... | checks if file is a file or not, if file doesn't exist, it will be created
@param file
@return is file or not | [
"checks",
"if",
"file",
"is",
"a",
"file",
"or",
"not",
"if",
"file",
"doesn",
"t",
"exist",
"it",
"will",
"be",
"created"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/ConfigWebUtil.java#L414-L418 |
30,384 | lucee/Lucee | core/src/main/java/lucee/runtime/config/ConfigWebUtil.java | ConfigWebUtil.hasAccess | public static boolean hasAccess(Config config, int type) {
boolean has = true;
if (config instanceof ConfigWeb) {
has = ((ConfigWeb) config).getSecurityManager().getAccess(type) != SecurityManager.VALUE_NO;
}
return has;
} | java | public static boolean hasAccess(Config config, int type) {
boolean has = true;
if (config instanceof ConfigWeb) {
has = ((ConfigWeb) config).getSecurityManager().getAccess(type) != SecurityManager.VALUE_NO;
}
return has;
} | [
"public",
"static",
"boolean",
"hasAccess",
"(",
"Config",
"config",
",",
"int",
"type",
")",
"{",
"boolean",
"has",
"=",
"true",
";",
"if",
"(",
"config",
"instanceof",
"ConfigWeb",
")",
"{",
"has",
"=",
"(",
"(",
"ConfigWeb",
")",
"config",
")",
".",... | has access checks if config object has access to given type
@param config
@param type
@return has access | [
"has",
"access",
"checks",
"if",
"config",
"object",
"has",
"access",
"to",
"given",
"type"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/ConfigWebUtil.java#L427-L434 |
30,385 | lucee/Lucee | core/src/main/java/lucee/runtime/converter/JavaConverter.java | JavaConverter.serialize | public static String serialize(Serializable o) throws IOException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
serialize(o, baos);
return Base64Coder.encode(baos.toByteArray());
} | java | public static String serialize(Serializable o) throws IOException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
serialize(o, baos);
return Base64Coder.encode(baos.toByteArray());
} | [
"public",
"static",
"String",
"serialize",
"(",
"Serializable",
"o",
")",
"throws",
"IOException",
"{",
"ByteArrayOutputStream",
"baos",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"serialize",
"(",
"o",
",",
"baos",
")",
";",
"return",
"Base64Coder",
... | serialize a Java Object of Type Serializable
@param o
@return serialized String
@throws IOException | [
"serialize",
"a",
"Java",
"Object",
"of",
"Type",
"Serializable"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/converter/JavaConverter.java#L65-L69 |
30,386 | lucee/Lucee | core/src/main/java/lucee/runtime/converter/JavaConverter.java | JavaConverter.deserialize | public static Object deserialize(String str) throws IOException, ClassNotFoundException, CoderException {
ByteArrayInputStream bais = new ByteArrayInputStream(Base64Coder.decode(str));
return deserialize(bais);
} | java | public static Object deserialize(String str) throws IOException, ClassNotFoundException, CoderException {
ByteArrayInputStream bais = new ByteArrayInputStream(Base64Coder.decode(str));
return deserialize(bais);
} | [
"public",
"static",
"Object",
"deserialize",
"(",
"String",
"str",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
",",
"CoderException",
"{",
"ByteArrayInputStream",
"bais",
"=",
"new",
"ByteArrayInputStream",
"(",
"Base64Coder",
".",
"decode",
"(",
"s... | unserialize a serialized Object
@param str
@return unserialized Object
@throws IOException
@throws ClassNotFoundException
@throws CoderException | [
"unserialize",
"a",
"serialized",
"Object"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/converter/JavaConverter.java#L102-L105 |
30,387 | lucee/Lucee | core/src/main/java/lucee/runtime/component/ComponentLoader.java | ComponentLoader.loadComponent | public static ComponentImpl loadComponent(PageContext pc, Page page, String callPath, boolean isRealPath, boolean silent, boolean isExtendedComponent, boolean executeConstr)
throws PageException {
CIPage cip = toCIPage(page, callPath);
if (silent) {
// TODO is there a more direct way
BodyContent bc = pc.pushBody();
try {
return _loadComponent(pc, cip, callPath, isRealPath, isExtendedComponent, executeConstr);
}
finally {
BodyContentUtil.clearAndPop(pc, bc);
}
}
return _loadComponent(pc, cip, callPath, isRealPath, isExtendedComponent, executeConstr);
} | java | public static ComponentImpl loadComponent(PageContext pc, Page page, String callPath, boolean isRealPath, boolean silent, boolean isExtendedComponent, boolean executeConstr)
throws PageException {
CIPage cip = toCIPage(page, callPath);
if (silent) {
// TODO is there a more direct way
BodyContent bc = pc.pushBody();
try {
return _loadComponent(pc, cip, callPath, isRealPath, isExtendedComponent, executeConstr);
}
finally {
BodyContentUtil.clearAndPop(pc, bc);
}
}
return _loadComponent(pc, cip, callPath, isRealPath, isExtendedComponent, executeConstr);
} | [
"public",
"static",
"ComponentImpl",
"loadComponent",
"(",
"PageContext",
"pc",
",",
"Page",
"page",
",",
"String",
"callPath",
",",
"boolean",
"isRealPath",
",",
"boolean",
"silent",
",",
"boolean",
"isExtendedComponent",
",",
"boolean",
"executeConstr",
")",
"th... | do not change, method is used in flex extension | [
"do",
"not",
"change",
"method",
"is",
"used",
"in",
"flex",
"extension"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/component/ComponentLoader.java#L367-L381 |
30,388 | lucee/Lucee | core/src/main/java/lucee/runtime/writer/CFMLWriterImpl.java | CFMLWriterImpl.setBufferConfig | @Override
public void setBufferConfig(int bufferSize, boolean autoFlush) throws IOException {
this.bufferSize = bufferSize;
this.autoFlush = autoFlush;
_check();
} | java | @Override
public void setBufferConfig(int bufferSize, boolean autoFlush) throws IOException {
this.bufferSize = bufferSize;
this.autoFlush = autoFlush;
_check();
} | [
"@",
"Override",
"public",
"void",
"setBufferConfig",
"(",
"int",
"bufferSize",
",",
"boolean",
"autoFlush",
")",
"throws",
"IOException",
"{",
"this",
".",
"bufferSize",
"=",
"bufferSize",
";",
"this",
".",
"autoFlush",
"=",
"autoFlush",
";",
"_check",
"(",
... | reset configuration of buffer
@param bufferSize size of the buffer
@param autoFlush does the buffer autoflush
@throws IOException | [
"reset",
"configuration",
"of",
"buffer"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/writer/CFMLWriterImpl.java#L121-L126 |
30,389 | lucee/Lucee | core/src/main/java/lucee/transformer/bytecode/op/OpDecision.java | OpDecision.toExprBoolean | public static ExprBoolean toExprBoolean(Expression left, Expression right, int operation) {
return new OpDecision(left, right, operation);
} | java | public static ExprBoolean toExprBoolean(Expression left, Expression right, int operation) {
return new OpDecision(left, right, operation);
} | [
"public",
"static",
"ExprBoolean",
"toExprBoolean",
"(",
"Expression",
"left",
",",
"Expression",
"right",
",",
"int",
"operation",
")",
"{",
"return",
"new",
"OpDecision",
"(",
"left",
",",
"right",
",",
"operation",
")",
";",
"}"
] | Create a String expression from a operation
@param left
@param right
@return String expression | [
"Create",
"a",
"String",
"expression",
"from",
"a",
"operation"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/bytecode/op/OpDecision.java#L67-L69 |
30,390 | lucee/Lucee | core/src/main/java/lucee/runtime/osgi/BundleFile.java | BundleFile.newInstance | public static BundleFile newInstance(Resource res) {
try {
BundleFile bf = new BundleFile(res);
if (bf.isBundle()) return bf;
}
catch (Throwable t) {
ExceptionUtil.rethrowIfNecessary(t);
}
return null;
} | java | public static BundleFile newInstance(Resource res) {
try {
BundleFile bf = new BundleFile(res);
if (bf.isBundle()) return bf;
}
catch (Throwable t) {
ExceptionUtil.rethrowIfNecessary(t);
}
return null;
} | [
"public",
"static",
"BundleFile",
"newInstance",
"(",
"Resource",
"res",
")",
"{",
"try",
"{",
"BundleFile",
"bf",
"=",
"new",
"BundleFile",
"(",
"res",
")",
";",
"if",
"(",
"bf",
".",
"isBundle",
"(",
")",
")",
"return",
"bf",
";",
"}",
"catch",
"("... | only return a instance if the Resource is a valid bundle, otherwise it returns null
@param res
@return | [
"only",
"return",
"a",
"instance",
"if",
"the",
"Resource",
"is",
"a",
"valid",
"bundle",
"otherwise",
"it",
"returns",
"null"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/osgi/BundleFile.java#L69-L80 |
30,391 | lucee/Lucee | core/src/main/java/lucee/runtime/PageSourceImpl.java | PageSourceImpl.loadPhysical | private Page loadPhysical(PageContext pc, Page page) throws TemplateException {
if (!mapping.hasPhysical()) return null;
ConfigWeb config = pc.getConfig();
PageContextImpl pci = (PageContextImpl) pc;
if ((mapping.getInspectTemplate() == Config.INSPECT_NEVER || pci.isTrusted(page)) && isLoad(LOAD_PHYSICAL)) return page;
Resource srcFile = getPhyscalFile();
long srcLastModified = srcFile.lastModified();
if (srcLastModified == 0L) return null;
// Page exists
if (page != null) {
// if(page!=null && !recompileAlways) {
if (srcLastModified != page.getSourceLastModified()) {
// same size, maybe the content has not changed?
boolean same = false;
if (page instanceof PagePro && ((PagePro) page).getSourceLength() == srcFile.length()) {
PagePro pp = (PagePro) page;
try {
same = pp.getHash() == PageSourceCode.toString(this, config.getTemplateCharset()).hashCode();
}
catch (IOException e) {/*
* in case this exception happen, the following compile process will fail as well and report the
* error
*/}
}
if (!same) {
this.page = page = compile(config, mapping.getClassRootDirectory(), page, false, pc.ignoreScopes());
page.setPageSource(this);
page.setLoadType(LOAD_PHYSICAL);
}
}
}
// page doesn't exist
else {
Resource classRootDir = mapping.getClassRootDirectory();
Resource classFile = classRootDir.getRealResource(getJavaName() + ".class");
boolean isNew = false;
// new class
if (flush || !classFile.exists()) {
this.page = page = compile(config, classRootDir, null, false, pc.ignoreScopes());
flush = false;
isNew = true;
}
// load page
else {
try {
this.page = page = newInstance(mapping.getPhysicalClass(this.getClassName()));
}
catch (Throwable t) {
ExceptionUtil.rethrowIfNecessary(t);
this.page = page = null;
}
if (page == null) this.page = page = compile(config, classRootDir, null, false, pc.ignoreScopes());
}
// check if version changed or lasMod
if (!isNew && (srcLastModified != page.getSourceLastModified() || page.getVersion() != pc.getConfig().getFactory().getEngine().getInfo().getFullVersionInfo())) {
isNew = true;
this.page = page = compile(config, classRootDir, page, false, pc.ignoreScopes());
}
page.setPageSource(this);
page.setLoadType(LOAD_PHYSICAL);
}
pci.setPageUsed(page);
return page;
} | java | private Page loadPhysical(PageContext pc, Page page) throws TemplateException {
if (!mapping.hasPhysical()) return null;
ConfigWeb config = pc.getConfig();
PageContextImpl pci = (PageContextImpl) pc;
if ((mapping.getInspectTemplate() == Config.INSPECT_NEVER || pci.isTrusted(page)) && isLoad(LOAD_PHYSICAL)) return page;
Resource srcFile = getPhyscalFile();
long srcLastModified = srcFile.lastModified();
if (srcLastModified == 0L) return null;
// Page exists
if (page != null) {
// if(page!=null && !recompileAlways) {
if (srcLastModified != page.getSourceLastModified()) {
// same size, maybe the content has not changed?
boolean same = false;
if (page instanceof PagePro && ((PagePro) page).getSourceLength() == srcFile.length()) {
PagePro pp = (PagePro) page;
try {
same = pp.getHash() == PageSourceCode.toString(this, config.getTemplateCharset()).hashCode();
}
catch (IOException e) {/*
* in case this exception happen, the following compile process will fail as well and report the
* error
*/}
}
if (!same) {
this.page = page = compile(config, mapping.getClassRootDirectory(), page, false, pc.ignoreScopes());
page.setPageSource(this);
page.setLoadType(LOAD_PHYSICAL);
}
}
}
// page doesn't exist
else {
Resource classRootDir = mapping.getClassRootDirectory();
Resource classFile = classRootDir.getRealResource(getJavaName() + ".class");
boolean isNew = false;
// new class
if (flush || !classFile.exists()) {
this.page = page = compile(config, classRootDir, null, false, pc.ignoreScopes());
flush = false;
isNew = true;
}
// load page
else {
try {
this.page = page = newInstance(mapping.getPhysicalClass(this.getClassName()));
}
catch (Throwable t) {
ExceptionUtil.rethrowIfNecessary(t);
this.page = page = null;
}
if (page == null) this.page = page = compile(config, classRootDir, null, false, pc.ignoreScopes());
}
// check if version changed or lasMod
if (!isNew && (srcLastModified != page.getSourceLastModified() || page.getVersion() != pc.getConfig().getFactory().getEngine().getInfo().getFullVersionInfo())) {
isNew = true;
this.page = page = compile(config, classRootDir, page, false, pc.ignoreScopes());
}
page.setPageSource(this);
page.setLoadType(LOAD_PHYSICAL);
}
pci.setPageUsed(page);
return page;
} | [
"private",
"Page",
"loadPhysical",
"(",
"PageContext",
"pc",
",",
"Page",
"page",
")",
"throws",
"TemplateException",
"{",
"if",
"(",
"!",
"mapping",
".",
"hasPhysical",
"(",
")",
")",
"return",
"null",
";",
"ConfigWeb",
"config",
"=",
"pc",
".",
"getConfi... | throws only an exception when compilation fails
@param pc
@param page
@return
@throws PageException | [
"throws",
"only",
"an",
"exception",
"when",
"compilation",
"fails"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/PageSourceImpl.java#L284-L354 |
30,392 | lucee/Lucee | core/src/main/java/lucee/runtime/PageSourceImpl.java | PageSourceImpl.getDisplayPath | @Override
public String getDisplayPath() {
if (!mapping.hasArchive()) {
return StringUtil.toString(getPhyscalFile(), null);
}
else if (isLoad(LOAD_PHYSICAL)) {
return StringUtil.toString(getPhyscalFile(), null);
}
else if (isLoad(LOAD_ARCHIVE)) {
return StringUtil.toString(getArchiveSourcePath(), null);
}
else {
boolean pse = physcalExists();
boolean ase = archiveExists();
if (mapping.isPhysicalFirst()) {
if (pse) return getPhyscalFile().toString();
else if (ase) return getArchiveSourcePath();
return getPhyscalFile().toString();
}
if (ase) return getArchiveSourcePath();
else if (pse) return getPhyscalFile().toString();
return getArchiveSourcePath();
}
} | java | @Override
public String getDisplayPath() {
if (!mapping.hasArchive()) {
return StringUtil.toString(getPhyscalFile(), null);
}
else if (isLoad(LOAD_PHYSICAL)) {
return StringUtil.toString(getPhyscalFile(), null);
}
else if (isLoad(LOAD_ARCHIVE)) {
return StringUtil.toString(getArchiveSourcePath(), null);
}
else {
boolean pse = physcalExists();
boolean ase = archiveExists();
if (mapping.isPhysicalFirst()) {
if (pse) return getPhyscalFile().toString();
else if (ase) return getArchiveSourcePath();
return getPhyscalFile().toString();
}
if (ase) return getArchiveSourcePath();
else if (pse) return getPhyscalFile().toString();
return getArchiveSourcePath();
}
} | [
"@",
"Override",
"public",
"String",
"getDisplayPath",
"(",
")",
"{",
"if",
"(",
"!",
"mapping",
".",
"hasArchive",
"(",
")",
")",
"{",
"return",
"StringUtil",
".",
"toString",
"(",
"getPhyscalFile",
"(",
")",
",",
"null",
")",
";",
"}",
"else",
"if",
... | return source path as String
@return source path as String | [
"return",
"source",
"path",
"as",
"String"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/PageSourceImpl.java#L425-L449 |
30,393 | lucee/Lucee | core/src/main/java/lucee/runtime/PageSourceImpl.java | PageSourceImpl.getPhyscalFile | @Override
public Resource getPhyscalFile() {
if (physcalSource == null) {
if (!mapping.hasPhysical()) {
return null;
}
Resource tmp = mapping.getPhysical().getRealResource(relPath);
physcalSource = ResourceUtil.toExactResource(tmp);
// fix if the case not match
if (!tmp.getAbsolutePath().equals(physcalSource.getAbsolutePath())) {
String relpath = extractRealpath(relPath, physcalSource.getAbsolutePath());
// just a security!
if (relPath.equalsIgnoreCase(relpath)) {
this.relPath = relpath;
createClassAndPackage();
}
}
}
return physcalSource;
} | java | @Override
public Resource getPhyscalFile() {
if (physcalSource == null) {
if (!mapping.hasPhysical()) {
return null;
}
Resource tmp = mapping.getPhysical().getRealResource(relPath);
physcalSource = ResourceUtil.toExactResource(tmp);
// fix if the case not match
if (!tmp.getAbsolutePath().equals(physcalSource.getAbsolutePath())) {
String relpath = extractRealpath(relPath, physcalSource.getAbsolutePath());
// just a security!
if (relPath.equalsIgnoreCase(relpath)) {
this.relPath = relpath;
createClassAndPackage();
}
}
}
return physcalSource;
} | [
"@",
"Override",
"public",
"Resource",
"getPhyscalFile",
"(",
")",
"{",
"if",
"(",
"physcalSource",
"==",
"null",
")",
"{",
"if",
"(",
"!",
"mapping",
".",
"hasPhysical",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"Resource",
"tmp",
"=",
"mapping"... | return file object, based on physical path and realpath
@return file Object | [
"return",
"file",
"object",
"based",
"on",
"physical",
"path",
"and",
"realpath"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/PageSourceImpl.java#L493-L512 |
30,394 | lucee/Lucee | core/src/main/java/lucee/runtime/PageSourceImpl.java | PageSourceImpl.mergeRealPathes | private static String mergeRealPathes(Mapping mapping, String parentRealPath, String newRealPath, RefBoolean isOutSide) {
parentRealPath = pathRemoveLast(parentRealPath, isOutSide);
while (newRealPath.startsWith("../")) {
parentRealPath = pathRemoveLast(parentRealPath, isOutSide);
newRealPath = newRealPath.substring(3);
}
// check if come back
String path = parentRealPath.concat("/").concat(newRealPath);
if (path.startsWith("../")) {
int count = 0;
do {
count++;
path = path.substring(3);
}
while (path.startsWith("../"));
String strRoot = mapping.getPhysical().getAbsolutePath().replace('\\', '/');
if (!StringUtil.endsWith(strRoot, '/')) {
strRoot += '/';
}
int rootLen = strRoot.length();
String[] arr = ListUtil.toStringArray(ListUtil.listToArray(path, '/'), "");// path.split("/");
int tmpLen;
for (int i = count; i > 0; i--) {
if (arr.length > i) {
String tmp = '/' + list(arr, 0, i);
tmpLen = rootLen - tmp.length();
if (strRoot.lastIndexOf(tmp) == tmpLen && tmpLen >= 0) {
StringBuffer rtn = new StringBuffer();
while (i < count - i) {
count--;
rtn.append("../");
}
isOutSide.setValue(rtn.length() != 0);
return (rtn.length() == 0 ? "/" : rtn.toString()) + list(arr, i, arr.length);
}
}
}
}
return parentRealPath.concat("/").concat(newRealPath);
} | java | private static String mergeRealPathes(Mapping mapping, String parentRealPath, String newRealPath, RefBoolean isOutSide) {
parentRealPath = pathRemoveLast(parentRealPath, isOutSide);
while (newRealPath.startsWith("../")) {
parentRealPath = pathRemoveLast(parentRealPath, isOutSide);
newRealPath = newRealPath.substring(3);
}
// check if come back
String path = parentRealPath.concat("/").concat(newRealPath);
if (path.startsWith("../")) {
int count = 0;
do {
count++;
path = path.substring(3);
}
while (path.startsWith("../"));
String strRoot = mapping.getPhysical().getAbsolutePath().replace('\\', '/');
if (!StringUtil.endsWith(strRoot, '/')) {
strRoot += '/';
}
int rootLen = strRoot.length();
String[] arr = ListUtil.toStringArray(ListUtil.listToArray(path, '/'), "");// path.split("/");
int tmpLen;
for (int i = count; i > 0; i--) {
if (arr.length > i) {
String tmp = '/' + list(arr, 0, i);
tmpLen = rootLen - tmp.length();
if (strRoot.lastIndexOf(tmp) == tmpLen && tmpLen >= 0) {
StringBuffer rtn = new StringBuffer();
while (i < count - i) {
count--;
rtn.append("../");
}
isOutSide.setValue(rtn.length() != 0);
return (rtn.length() == 0 ? "/" : rtn.toString()) + list(arr, i, arr.length);
}
}
}
}
return parentRealPath.concat("/").concat(newRealPath);
} | [
"private",
"static",
"String",
"mergeRealPathes",
"(",
"Mapping",
"mapping",
",",
"String",
"parentRealPath",
",",
"String",
"newRealPath",
",",
"RefBoolean",
"isOutSide",
")",
"{",
"parentRealPath",
"=",
"pathRemoveLast",
"(",
"parentRealPath",
",",
"isOutSide",
")... | merge to realpath to one
@param mapping
@param parentRealPath
@param newRealPath
@param isOutSide
@return merged realpath | [
"merge",
"to",
"realpath",
"to",
"one"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/PageSourceImpl.java#L532-L574 |
30,395 | lucee/Lucee | core/src/main/java/lucee/runtime/PageSourceImpl.java | PageSourceImpl.list | private static String list(String[] arr, int from, int len) {
StringBuffer sb = new StringBuffer();
for (int i = from; i < len; i++) {
sb.append(arr[i]);
if (i + 1 != arr.length) sb.append('/');
}
return sb.toString();
} | java | private static String list(String[] arr, int from, int len) {
StringBuffer sb = new StringBuffer();
for (int i = from; i < len; i++) {
sb.append(arr[i]);
if (i + 1 != arr.length) sb.append('/');
}
return sb.toString();
} | [
"private",
"static",
"String",
"list",
"(",
"String",
"[",
"]",
"arr",
",",
"int",
"from",
",",
"int",
"len",
")",
"{",
"StringBuffer",
"sb",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"from",
";",
"i",
"<",
"len",
";... | convert a String array to a string list, but only part of it
@param arr String Array
@param from start from here
@param len how many element
@return String list | [
"convert",
"a",
"String",
"array",
"to",
"a",
"string",
"list",
"but",
"only",
"part",
"of",
"it"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/PageSourceImpl.java#L584-L591 |
30,396 | lucee/Lucee | core/src/main/java/lucee/runtime/PageSourceImpl.java | PageSourceImpl.pathRemoveLast | private static String pathRemoveLast(String path, RefBoolean isOutSide) {
if (path.length() == 0) {
isOutSide.setValue(true);
return "..";
}
else if (path.endsWith("..")) {
isOutSide.setValue(true);
return path.concat("/..");// path+"/..";
}
return path.substring(0, path.lastIndexOf('/'));
} | java | private static String pathRemoveLast(String path, RefBoolean isOutSide) {
if (path.length() == 0) {
isOutSide.setValue(true);
return "..";
}
else if (path.endsWith("..")) {
isOutSide.setValue(true);
return path.concat("/..");// path+"/..";
}
return path.substring(0, path.lastIndexOf('/'));
} | [
"private",
"static",
"String",
"pathRemoveLast",
"(",
"String",
"path",
",",
"RefBoolean",
"isOutSide",
")",
"{",
"if",
"(",
"path",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"isOutSide",
".",
"setValue",
"(",
"true",
")",
";",
"return",
"\"..\"",
... | remove the last elemtn of a path
@param path path to remove last element from it
@param isOutSide
@return path with removed element | [
"remove",
"the",
"last",
"elemtn",
"of",
"a",
"path"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/PageSourceImpl.java#L600-L610 |
30,397 | lucee/Lucee | core/src/main/java/lucee/runtime/PageSourceImpl.java | PageSourceImpl.getSourceAsInputStream | private InputStream getSourceAsInputStream() throws IOException {
if (!mapping.hasArchive()) return IOUtil.toBufferedInputStream(getPhyscalFile().getInputStream());
else if (isLoad(LOAD_PHYSICAL)) return IOUtil.toBufferedInputStream(getPhyscalFile().getInputStream());
else if (isLoad(LOAD_ARCHIVE)) {
StringBuffer name = new StringBuffer(_getPackageName().replace('.', '/'));
if (name.length() > 0) name.append("/");
name.append(getFileName());
return mapping.getArchiveResourceAsStream(name.toString());
}
else {
return null;
}
} | java | private InputStream getSourceAsInputStream() throws IOException {
if (!mapping.hasArchive()) return IOUtil.toBufferedInputStream(getPhyscalFile().getInputStream());
else if (isLoad(LOAD_PHYSICAL)) return IOUtil.toBufferedInputStream(getPhyscalFile().getInputStream());
else if (isLoad(LOAD_ARCHIVE)) {
StringBuffer name = new StringBuffer(_getPackageName().replace('.', '/'));
if (name.length() > 0) name.append("/");
name.append(getFileName());
return mapping.getArchiveResourceAsStream(name.toString());
}
else {
return null;
}
} | [
"private",
"InputStream",
"getSourceAsInputStream",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"mapping",
".",
"hasArchive",
"(",
")",
")",
"return",
"IOUtil",
".",
"toBufferedInputStream",
"(",
"getPhyscalFile",
"(",
")",
".",
"getInputStream",
"("... | return the inputstream of the source file
@return return the inputstream for the source from physical or archive
@throws FileNotFoundException | [
"return",
"the",
"inputstream",
"of",
"the",
"source",
"file"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/PageSourceImpl.java#L776-L789 |
30,398 | lucee/Lucee | core/src/main/java/lucee/runtime/PageSourceImpl.java | PageSourceImpl.clear | public void clear(ClassLoader cl) {
Page page = this.page;
if (page != null && page.getClass().getClassLoader().equals(cl)) {
this.page = null;
}
} | java | public void clear(ClassLoader cl) {
Page page = this.page;
if (page != null && page.getClass().getClassLoader().equals(cl)) {
this.page = null;
}
} | [
"public",
"void",
"clear",
"(",
"ClassLoader",
"cl",
")",
"{",
"Page",
"page",
"=",
"this",
".",
"page",
";",
"if",
"(",
"page",
"!=",
"null",
"&&",
"page",
".",
"getClass",
"(",
")",
".",
"getClassLoader",
"(",
")",
".",
"equals",
"(",
"cl",
")",
... | clear page, but only when page use the same classloader as provided
@param cl | [
"clear",
"page",
"but",
"only",
"when",
"page",
"use",
"the",
"same",
"classloader",
"as",
"provided"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/PageSourceImpl.java#L915-L920 |
30,399 | lucee/Lucee | core/src/main/java/lucee/runtime/schedule/ScheduleTaskImpl.java | ScheduleTaskImpl.toInterval | private static int toInterval(String interval) throws ScheduleException {
interval = interval.trim().toLowerCase();
int i = Caster.toIntValue(interval, 0);
if (i == 0) {
interval = interval.trim();
if (interval.equals("once")) return INTERVAL_ONCE;
else if (interval.equals("daily")) return INTERVAL_DAY;
else if (interval.equals("day")) return INTERVAL_DAY;
else if (interval.equals("monthly")) return INTERVAL_MONTH;
else if (interval.equals("month")) return INTERVAL_MONTH;
else if (interval.equals("weekly")) return INTERVAL_WEEK;
else if (interval.equals("week")) return INTERVAL_WEEK;
throw new ScheduleException("invalid interval definition [" + interval + "], valid values are [once,daily,monthly,weekly or number]");
}
if (i < 10) {
throw new ScheduleException("interval must be at least 10");
}
return i;
} | java | private static int toInterval(String interval) throws ScheduleException {
interval = interval.trim().toLowerCase();
int i = Caster.toIntValue(interval, 0);
if (i == 0) {
interval = interval.trim();
if (interval.equals("once")) return INTERVAL_ONCE;
else if (interval.equals("daily")) return INTERVAL_DAY;
else if (interval.equals("day")) return INTERVAL_DAY;
else if (interval.equals("monthly")) return INTERVAL_MONTH;
else if (interval.equals("month")) return INTERVAL_MONTH;
else if (interval.equals("weekly")) return INTERVAL_WEEK;
else if (interval.equals("week")) return INTERVAL_WEEK;
throw new ScheduleException("invalid interval definition [" + interval + "], valid values are [once,daily,monthly,weekly or number]");
}
if (i < 10) {
throw new ScheduleException("interval must be at least 10");
}
return i;
} | [
"private",
"static",
"int",
"toInterval",
"(",
"String",
"interval",
")",
"throws",
"ScheduleException",
"{",
"interval",
"=",
"interval",
".",
"trim",
"(",
")",
".",
"toLowerCase",
"(",
")",
";",
"int",
"i",
"=",
"Caster",
".",
"toIntValue",
"(",
"interva... | translate a String interval definition to a int definition
@param interval
@return interval
@throws ScheduleException | [
"translate",
"a",
"String",
"interval",
"definition",
"to",
"a",
"int",
"definition"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/schedule/ScheduleTaskImpl.java#L141-L159 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.