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,500 | lucee/Lucee | core/src/main/java/lucee/runtime/tag/FileTag.java | FileTag.setAttributes | private static void setAttributes(Resource file, String attributes) throws PageException {
if (!SystemUtil.isWindows() || StringUtil.isEmpty(attributes)) return;
try {
ResourceUtil.setAttribute(file, attributes);
}
catch (IOException e) {
throw new ApplicationException("can't change attributes of file " + file, e.getMessage());
}
} | java | private static void setAttributes(Resource file, String attributes) throws PageException {
if (!SystemUtil.isWindows() || StringUtil.isEmpty(attributes)) return;
try {
ResourceUtil.setAttribute(file, attributes);
}
catch (IOException e) {
throw new ApplicationException("can't change attributes of file " + file, e.getMessage());
}
} | [
"private",
"static",
"void",
"setAttributes",
"(",
"Resource",
"file",
",",
"String",
"attributes",
")",
"throws",
"PageException",
"{",
"if",
"(",
"!",
"SystemUtil",
".",
"isWindows",
"(",
")",
"||",
"StringUtil",
".",
"isEmpty",
"(",
"attributes",
")",
")"... | set attributes on file
@param file
@throws PageException | [
"set",
"attributes",
"on",
"file"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/tag/FileTag.java#L1187-L1195 |
30,501 | lucee/Lucee | core/src/main/java/lucee/runtime/tag/FileTag.java | FileTag.setMode | private static void setMode(Resource file, int mode) throws ApplicationException {
if (mode == -1 || SystemUtil.isWindows()) return;
try {
file.setMode(mode);
// FileUtil.setMode(file,mode);
}
catch (IOException e) {
throw new ApplicationException("can't change mode of file " + file, e.getMessage());
}
} | java | private static void setMode(Resource file, int mode) throws ApplicationException {
if (mode == -1 || SystemUtil.isWindows()) return;
try {
file.setMode(mode);
// FileUtil.setMode(file,mode);
}
catch (IOException e) {
throw new ApplicationException("can't change mode of file " + file, e.getMessage());
}
} | [
"private",
"static",
"void",
"setMode",
"(",
"Resource",
"file",
",",
"int",
"mode",
")",
"throws",
"ApplicationException",
"{",
"if",
"(",
"mode",
"==",
"-",
"1",
"||",
"SystemUtil",
".",
"isWindows",
"(",
")",
")",
"return",
";",
"try",
"{",
"file",
... | change mode of given file
@param file
@throws ApplicationException | [
"change",
"mode",
"of",
"given",
"file"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/tag/FileTag.java#L1203-L1212 |
30,502 | lucee/Lucee | core/src/main/java/lucee/transformer/bytecode/expression/var/VariableImpl.java | VariableImpl.methodExists | private static Boolean methodExists(Class clazz, String methodName, Type[] args, Type returnType) {
try {
Class<?>[] _args = new Class[args.length];
for (int i = 0; i < _args.length; i++) {
_args[i] = Types.toClass(args[i]);
}
Class<?> rtn = Types.toClass(returnType);
try {
java.lang.reflect.Method m = clazz.getMethod(methodName, _args);
return m.getReturnType() == rtn;
}
catch (Exception e) {
return false;
}
}
catch (Exception e) {
SystemOut.printDate(e);
return null;
}
} | java | private static Boolean methodExists(Class clazz, String methodName, Type[] args, Type returnType) {
try {
Class<?>[] _args = new Class[args.length];
for (int i = 0; i < _args.length; i++) {
_args[i] = Types.toClass(args[i]);
}
Class<?> rtn = Types.toClass(returnType);
try {
java.lang.reflect.Method m = clazz.getMethod(methodName, _args);
return m.getReturnType() == rtn;
}
catch (Exception e) {
return false;
}
}
catch (Exception e) {
SystemOut.printDate(e);
return null;
}
} | [
"private",
"static",
"Boolean",
"methodExists",
"(",
"Class",
"clazz",
",",
"String",
"methodName",
",",
"Type",
"[",
"]",
"args",
",",
"Type",
"returnType",
")",
"{",
"try",
"{",
"Class",
"<",
"?",
">",
"[",
"]",
"_args",
"=",
"new",
"Class",
"[",
"... | checks if a method exists
@param clazz
@param methodName
@param args
@param returnType
@return returns null when checking fi | [
"checks",
"if",
"a",
"method",
"exists"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/bytecode/expression/var/VariableImpl.java#L545-L564 |
30,503 | lucee/Lucee | core/src/main/java/lucee/transformer/bytecode/expression/var/VariableImpl.java | VariableImpl.toNamedArguments | private static NamedArgument[] toNamedArguments(Argument[] args) {
NamedArgument[] nargs = new NamedArgument[args.length];
for (int i = 0; i < args.length; i++) {
nargs[i] = (NamedArgument) args[i];
}
return nargs;
} | java | private static NamedArgument[] toNamedArguments(Argument[] args) {
NamedArgument[] nargs = new NamedArgument[args.length];
for (int i = 0; i < args.length; i++) {
nargs[i] = (NamedArgument) args[i];
}
return nargs;
} | [
"private",
"static",
"NamedArgument",
"[",
"]",
"toNamedArguments",
"(",
"Argument",
"[",
"]",
"args",
")",
"{",
"NamedArgument",
"[",
"]",
"nargs",
"=",
"new",
"NamedArgument",
"[",
"args",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";... | translate a array of arguments to a araay of NamedArguments, attention no check if the elements
are really named arguments
@param args
@return | [
"translate",
"a",
"array",
"of",
"arguments",
"to",
"a",
"araay",
"of",
"NamedArguments",
"attention",
"no",
"check",
"if",
"the",
"elements",
"are",
"really",
"named",
"arguments"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/bytecode/expression/var/VariableImpl.java#L775-L782 |
30,504 | lucee/Lucee | core/src/main/java/lucee/transformer/bytecode/expression/var/VariableImpl.java | VariableImpl.isNamed | private static boolean isNamed(String funcName, Argument[] args) throws TransformerException {
if (ArrayUtil.isEmpty(args)) return false;
boolean named = false;
for (int i = 0; i < args.length; i++) {
if (args[i] instanceof NamedArgument) named = true;
else if (named) throw new TransformerException("invalid argument for function " + funcName + ", you can not mix named and unnamed arguments", args[i].getStart());
}
return named;
} | java | private static boolean isNamed(String funcName, Argument[] args) throws TransformerException {
if (ArrayUtil.isEmpty(args)) return false;
boolean named = false;
for (int i = 0; i < args.length; i++) {
if (args[i] instanceof NamedArgument) named = true;
else if (named) throw new TransformerException("invalid argument for function " + funcName + ", you can not mix named and unnamed arguments", args[i].getStart());
}
return named;
} | [
"private",
"static",
"boolean",
"isNamed",
"(",
"String",
"funcName",
",",
"Argument",
"[",
"]",
"args",
")",
"throws",
"TransformerException",
"{",
"if",
"(",
"ArrayUtil",
".",
"isEmpty",
"(",
"args",
")",
")",
"return",
"false",
";",
"boolean",
"named",
... | check if the arguments are named arguments or regular arguments, throws a exception when mixed
@param funcName
@param args
@param line
@return
@throws TransformerException | [
"check",
"if",
"the",
"arguments",
"are",
"named",
"arguments",
"or",
"regular",
"arguments",
"throws",
"a",
"exception",
"when",
"mixed"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/bytecode/expression/var/VariableImpl.java#L793-L802 |
30,505 | lucee/Lucee | core/src/main/java/lucee/transformer/library/tag/TagLibTag.java | TagLibTag.getFullName | public String getFullName() {
String fullName;
if (tagLib != null) {
fullName = tagLib.getNameSpaceAndSeparator() + name;
}
else {
fullName = name;
}
return fullName;
} | java | public String getFullName() {
String fullName;
if (tagLib != null) {
fullName = tagLib.getNameSpaceAndSeparator() + name;
}
else {
fullName = name;
}
return fullName;
} | [
"public",
"String",
"getFullName",
"(",
")",
"{",
"String",
"fullName",
";",
"if",
"(",
"tagLib",
"!=",
"null",
")",
"{",
"fullName",
"=",
"tagLib",
".",
"getNameSpaceAndSeparator",
"(",
")",
"+",
"name",
";",
"}",
"else",
"{",
"fullName",
"=",
"name",
... | Gibt den kompletten Namen des Tag zurueck, inkl. Name-Space und Trenner.
@return String Kompletter Name des Tag. | [
"Gibt",
"den",
"kompletten",
"Namen",
"des",
"Tag",
"zurueck",
"inkl",
".",
"Name",
"-",
"Space",
"und",
"Trenner",
"."
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/library/tag/TagLibTag.java#L273-L282 |
30,506 | lucee/Lucee | core/src/main/java/lucee/transformer/library/tag/TagLibTag.java | TagLibTag.getBodyTransformer | public TagDependentBodyTransformer getBodyTransformer() throws TagLibException {
if (!hasTDBTClassDefinition()) return null;
if (tdbt != null) return tdbt;
try {
tdbt = (TagDependentBodyTransformer) tdbtCD.getClazz().newInstance();
}
catch (Throwable t) {
ExceptionUtil.rethrowIfNecessary(t);
throw new TagLibException(t);
}
return tdbt;
} | java | public TagDependentBodyTransformer getBodyTransformer() throws TagLibException {
if (!hasTDBTClassDefinition()) return null;
if (tdbt != null) return tdbt;
try {
tdbt = (TagDependentBodyTransformer) tdbtCD.getClazz().newInstance();
}
catch (Throwable t) {
ExceptionUtil.rethrowIfNecessary(t);
throw new TagLibException(t);
}
return tdbt;
} | [
"public",
"TagDependentBodyTransformer",
"getBodyTransformer",
"(",
")",
"throws",
"TagLibException",
"{",
"if",
"(",
"!",
"hasTDBTClassDefinition",
"(",
")",
")",
"return",
"null",
";",
"if",
"(",
"tdbt",
"!=",
"null",
")",
"return",
"tdbt",
";",
"try",
"{",
... | Gibt den TagDependentBodyTransformer dieser Klasse zurueck. Falls kein
TagDependentBodyTransformer definiert ist, wird null zurueckgegeben.
@return Implementation des TagDependentBodyTransformer zu dieser Klasse.
@throws TagLibException Falls die TagDependentBodyTransformer-Klasse nicht geladen werden kann. | [
"Gibt",
"den",
"TagDependentBodyTransformer",
"dieser",
"Klasse",
"zurueck",
".",
"Falls",
"kein",
"TagDependentBodyTransformer",
"definiert",
"ist",
"wird",
"null",
"zurueckgegeben",
"."
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/library/tag/TagLibTag.java#L360-L371 |
30,507 | lucee/Lucee | core/src/main/java/lucee/transformer/library/tag/TagLibTag.java | TagLibTag.setBodyContent | public void setBodyContent(String value) {
// empty, free, must, tagdependent
value = value.toLowerCase().trim();
// if(value.equals("jsp")) value="free";
this.hasBody = !value.equals("empty");
this.isBodyReq = !value.equals("free");
this.isTagDependent = value.equals("tagdependent");
bodyFree = value.equals("free");
} | java | public void setBodyContent(String value) {
// empty, free, must, tagdependent
value = value.toLowerCase().trim();
// if(value.equals("jsp")) value="free";
this.hasBody = !value.equals("empty");
this.isBodyReq = !value.equals("free");
this.isTagDependent = value.equals("tagdependent");
bodyFree = value.equals("free");
} | [
"public",
"void",
"setBodyContent",
"(",
"String",
"value",
")",
"{",
"// empty, free, must, tagdependent",
"value",
"=",
"value",
".",
"toLowerCase",
"(",
")",
".",
"trim",
"(",
")",
";",
"// if(value.equals(\"jsp\")) value=\"free\";",
"this",
".",
"hasBody",
"=",
... | Setzt die Information, was fuer ein BodyContent das Tag haben kann. Diese Methode wird durch die
Klasse TagLibFactory verwendet.
@param value BodyContent Information. | [
"Setzt",
"die",
"Information",
"was",
"fuer",
"ein",
"BodyContent",
"das",
"Tag",
"haben",
"kann",
".",
"Diese",
"Methode",
"wird",
"durch",
"die",
"Klasse",
"TagLibFactory",
"verwendet",
"."
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/library/tag/TagLibTag.java#L529-L538 |
30,508 | lucee/Lucee | core/src/main/java/lucee/transformer/library/tag/TagLibTag.java | TagLibTag.setTDBTClassDefinition | public void setTDBTClassDefinition(String tdbtClass, Identification id, Attributes attr) {
this.tdbtCD = ClassDefinitionImpl.toClassDefinition(tdbtClass, id, attr);
this.tdbt = null;
} | java | public void setTDBTClassDefinition(String tdbtClass, Identification id, Attributes attr) {
this.tdbtCD = ClassDefinitionImpl.toClassDefinition(tdbtClass, id, attr);
this.tdbt = null;
} | [
"public",
"void",
"setTDBTClassDefinition",
"(",
"String",
"tdbtClass",
",",
"Identification",
"id",
",",
"Attributes",
"attr",
")",
"{",
"this",
".",
"tdbtCD",
"=",
"ClassDefinitionImpl",
".",
"toClassDefinition",
"(",
"tdbtClass",
",",
"id",
",",
"attr",
")",
... | Setzt die implementierende Klassendefinition des TagDependentBodyTransformer. Diese Methode wird
durch die Klasse TagLibFactory verwendet.
@param tdbtClass Klassendefinition der TagDependentBodyTransformer-Implementation. | [
"Setzt",
"die",
"implementierende",
"Klassendefinition",
"des",
"TagDependentBodyTransformer",
".",
"Diese",
"Methode",
"wird",
"durch",
"die",
"Klasse",
"TagLibFactory",
"verwendet",
"."
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/library/tag/TagLibTag.java#L609-L612 |
30,509 | lucee/Lucee | core/src/main/java/lucee/transformer/library/tag/TagLibTag.java | TagLibTag.setAttributeEvaluatorClassDefinition | public void setAttributeEvaluatorClassDefinition(String className, Identification id, Attributes attr) {
cdAttributeEvaluator = ClassDefinitionImpl.toClassDefinition(className, id, attr);
;
} | java | public void setAttributeEvaluatorClassDefinition(String className, Identification id, Attributes attr) {
cdAttributeEvaluator = ClassDefinitionImpl.toClassDefinition(className, id, attr);
;
} | [
"public",
"void",
"setAttributeEvaluatorClassDefinition",
"(",
"String",
"className",
",",
"Identification",
"id",
",",
"Attributes",
"attr",
")",
"{",
"cdAttributeEvaluator",
"=",
"ClassDefinitionImpl",
".",
"toClassDefinition",
"(",
"className",
",",
"id",
",",
"att... | Setzt den Namen der Klasse welche einen AttributeEvaluator implementiert.
@param value Name der AttributeEvaluator Klassse | [
"Setzt",
"den",
"Namen",
"der",
"Klasse",
"welche",
"einen",
"AttributeEvaluator",
"implementiert",
"."
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/library/tag/TagLibTag.java#L695-L699 |
30,510 | lucee/Lucee | core/src/main/java/lucee/transformer/library/tag/TagLibTag.java | TagLibTag.getTag | public Tag getTag(Factory f, Position start, Position end) throws TagLibException {
if (StringUtil.isEmpty(tttCD)) return new TagOther(f, start, end);
try {
return _getTag(f, start, end);
}
catch (ClassException e) {
throw new TagLibException(e.getMessage());
}
catch (NoSuchMethodException e) {
throw new TagLibException(e.getMessage());
}
catch (Throwable e) {
ExceptionUtil.rethrowIfNecessary(e);
throw new TagLibException(e);
}
} | java | public Tag getTag(Factory f, Position start, Position end) throws TagLibException {
if (StringUtil.isEmpty(tttCD)) return new TagOther(f, start, end);
try {
return _getTag(f, start, end);
}
catch (ClassException e) {
throw new TagLibException(e.getMessage());
}
catch (NoSuchMethodException e) {
throw new TagLibException(e.getMessage());
}
catch (Throwable e) {
ExceptionUtil.rethrowIfNecessary(e);
throw new TagLibException(e);
}
} | [
"public",
"Tag",
"getTag",
"(",
"Factory",
"f",
",",
"Position",
"start",
",",
"Position",
"end",
")",
"throws",
"TagLibException",
"{",
"if",
"(",
"StringUtil",
".",
"isEmpty",
"(",
"tttCD",
")",
")",
"return",
"new",
"TagOther",
"(",
"f",
",",
"start",... | return ASM Tag for this tag
@param line
@return | [
"return",
"ASM",
"Tag",
"for",
"this",
"tag"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/library/tag/TagLibTag.java#L731-L746 |
30,511 | lucee/Lucee | core/src/main/java/lucee/transformer/library/tag/TagLibTag.java | TagLibTag.getAttributeUndefinedValue | public Expression getAttributeUndefinedValue(Factory factory) {
if (attrUndefinedValue == null) return factory.TRUE();
return factory.createLiteral(attrUndefinedValue, factory.TRUE());
} | java | public Expression getAttributeUndefinedValue(Factory factory) {
if (attrUndefinedValue == null) return factory.TRUE();
return factory.createLiteral(attrUndefinedValue, factory.TRUE());
} | [
"public",
"Expression",
"getAttributeUndefinedValue",
"(",
"Factory",
"factory",
")",
"{",
"if",
"(",
"attrUndefinedValue",
"==",
"null",
")",
"return",
"factory",
".",
"TRUE",
"(",
")",
";",
"return",
"factory",
".",
"createLiteral",
"(",
"attrUndefinedValue",
... | attribute value set, if the attribute has no value defined
@return | [
"attribute",
"value",
"set",
"if",
"the",
"attribute",
"has",
"no",
"value",
"defined"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/library/tag/TagLibTag.java#L866-L869 |
30,512 | lucee/Lucee | core/src/main/java/lucee/runtime/PageContextImpl.java | PageContextImpl.initialize | public PageContextImpl initialize(HttpServlet servlet, HttpServletRequest req, HttpServletResponse rsp, String errorPageURL, boolean needsSession, int bufferSize,
boolean autoFlush, boolean isChild, boolean ignoreScopes) {
parent = null;
requestId = counter++;
appListenerType = ApplicationListener.TYPE_NONE;
this.ignoreScopes = ignoreScopes;
ReqRspUtil.setContentType(rsp, "text/html; charset=" + config.getWebCharset().name());
this.isChild = isChild;
applicationContext = defaultApplicationContext;
startTime = System.currentTimeMillis();
thread = Thread.currentThread();
this.req = new HTTPServletRequestWrap(req);
this.rsp = rsp;
this.servlet = servlet;
// Writers
if (config.debugLogOutput()) {
CFMLWriter w = config.getCFMLWriter(this, req, rsp);
w.setAllowCompression(false);
DebugCFMLWriter dcw = new DebugCFMLWriter(w);
bodyContentStack.init(dcw);
debugger.setOutputLog(dcw);
}
else {
bodyContentStack.init(config.getCFMLWriter(this, req, rsp));
}
writer = bodyContentStack.getWriter();
forceWriter = writer;
// Scopes
server = ScopeContext.getServerScope(this, ignoreScopes);
if (hasFamily) {
variablesRoot = new VariablesImpl();
variables = variablesRoot;
request = new RequestImpl();
_url = new URLImpl();
_form = new FormImpl();
urlForm = new UrlFormImpl(_form, _url);
undefined = new UndefinedImpl(this, getScopeCascadingType());
hasFamily = false;
}
else if (variables == null) {
variablesRoot = new VariablesImpl();
variables = variablesRoot;
}
request.initialize(this);
if (config.mergeFormAndURL()) {
url = urlForm;
form = urlForm;
}
else {
url = _url;
form = _form;
}
// url.initialize(this);
// form.initialize(this);
// undefined.initialize(this);
psq = config.getPSQL();
fdEnabled = !config.allowRequestTimeout();
if (config.getExecutionLogEnabled()) this.execLog = config.getExecutionLogFactory().getInstance(this);
if (debugger != null) debugger.init(config);
undefined.initialize(this);
timeoutStacktrace = null;
return this;
} | java | public PageContextImpl initialize(HttpServlet servlet, HttpServletRequest req, HttpServletResponse rsp, String errorPageURL, boolean needsSession, int bufferSize,
boolean autoFlush, boolean isChild, boolean ignoreScopes) {
parent = null;
requestId = counter++;
appListenerType = ApplicationListener.TYPE_NONE;
this.ignoreScopes = ignoreScopes;
ReqRspUtil.setContentType(rsp, "text/html; charset=" + config.getWebCharset().name());
this.isChild = isChild;
applicationContext = defaultApplicationContext;
startTime = System.currentTimeMillis();
thread = Thread.currentThread();
this.req = new HTTPServletRequestWrap(req);
this.rsp = rsp;
this.servlet = servlet;
// Writers
if (config.debugLogOutput()) {
CFMLWriter w = config.getCFMLWriter(this, req, rsp);
w.setAllowCompression(false);
DebugCFMLWriter dcw = new DebugCFMLWriter(w);
bodyContentStack.init(dcw);
debugger.setOutputLog(dcw);
}
else {
bodyContentStack.init(config.getCFMLWriter(this, req, rsp));
}
writer = bodyContentStack.getWriter();
forceWriter = writer;
// Scopes
server = ScopeContext.getServerScope(this, ignoreScopes);
if (hasFamily) {
variablesRoot = new VariablesImpl();
variables = variablesRoot;
request = new RequestImpl();
_url = new URLImpl();
_form = new FormImpl();
urlForm = new UrlFormImpl(_form, _url);
undefined = new UndefinedImpl(this, getScopeCascadingType());
hasFamily = false;
}
else if (variables == null) {
variablesRoot = new VariablesImpl();
variables = variablesRoot;
}
request.initialize(this);
if (config.mergeFormAndURL()) {
url = urlForm;
form = urlForm;
}
else {
url = _url;
form = _form;
}
// url.initialize(this);
// form.initialize(this);
// undefined.initialize(this);
psq = config.getPSQL();
fdEnabled = !config.allowRequestTimeout();
if (config.getExecutionLogEnabled()) this.execLog = config.getExecutionLogFactory().getInstance(this);
if (debugger != null) debugger.init(config);
undefined.initialize(this);
timeoutStacktrace = null;
return this;
} | [
"public",
"PageContextImpl",
"initialize",
"(",
"HttpServlet",
"servlet",
",",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"rsp",
",",
"String",
"errorPageURL",
",",
"boolean",
"needsSession",
",",
"int",
"bufferSize",
",",
"boolean",
"autoFlush",
",",
... | initialize a existing page context
@param servlet
@param req
@param rsp
@param errorPageURL
@param needsSession
@param bufferSize
@param autoFlush | [
"initialize",
"a",
"existing",
"page",
"context"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/PageContextImpl.java#L419-L495 |
30,513 | lucee/Lucee | core/src/main/java/lucee/runtime/PageContextImpl.java | PageContextImpl.writeEncodeFor | public void writeEncodeFor(String value, String encodeType) throws IOException, PageException { // FUTURE keyword:encodefore add to interface
write(ESAPIUtil.esapiEncode(this, encodeType, value));
} | java | public void writeEncodeFor(String value, String encodeType) throws IOException, PageException { // FUTURE keyword:encodefore add to interface
write(ESAPIUtil.esapiEncode(this, encodeType, value));
} | [
"public",
"void",
"writeEncodeFor",
"(",
"String",
"value",
",",
"String",
"encodeType",
")",
"throws",
"IOException",
",",
"PageException",
"{",
"// FUTURE keyword:encodefore add to interface",
"write",
"(",
"ESAPIUtil",
".",
"esapiEncode",
"(",
"this",
",",
"encodeT... | FUTURE add both method to interface | [
"FUTURE",
"add",
"both",
"method",
"to",
"interface"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/PageContextImpl.java#L672-L674 |
30,514 | lucee/Lucee | core/src/main/java/lucee/runtime/PageContextImpl.java | PageContextImpl.doInclude | public void doInclude(String realPath, boolean runOnce, Object cachedWithin) throws PageException {
if (cachedWithin == null) cachedWithin = getCachedWithin(ConfigWeb.CACHEDWITHIN_INCLUDE);
_doInclude(getRelativePageSources(realPath), runOnce, cachedWithin);
} | java | public void doInclude(String realPath, boolean runOnce, Object cachedWithin) throws PageException {
if (cachedWithin == null) cachedWithin = getCachedWithin(ConfigWeb.CACHEDWITHIN_INCLUDE);
_doInclude(getRelativePageSources(realPath), runOnce, cachedWithin);
} | [
"public",
"void",
"doInclude",
"(",
"String",
"realPath",
",",
"boolean",
"runOnce",
",",
"Object",
"cachedWithin",
")",
"throws",
"PageException",
"{",
"if",
"(",
"cachedWithin",
"==",
"null",
")",
"cachedWithin",
"=",
"getCachedWithin",
"(",
"ConfigWeb",
".",
... | used by the transformer | [
"used",
"by",
"the",
"transformer"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/PageContextImpl.java#L789-L792 |
30,515 | lucee/Lucee | core/src/main/java/lucee/runtime/PageContextImpl.java | PageContextImpl._doInclude | public void _doInclude(PageSource[] sources, boolean runOnce, Object cachedWithin) throws PageException {
if (cachedWithin == null) {
_doInclude(sources, runOnce);
return;
}
// ignore call when runonce an it is not first call
if (runOnce) {
Page currentPage = PageSourceImpl.loadPage(this, sources);
if (runOnce && includeOnce.contains(currentPage.getPageSource())) return;
}
// get cached data
String cacheId = CacheHandlerCollectionImpl.createId(sources);
CacheHandler cacheHandler = config.getCacheHandlerCollection(Config.CACHE_TYPE_INCLUDE, null).getInstanceMatchingObject(cachedWithin, null);
if (cacheHandler instanceof CacheHandlerPro) {
CacheItem cacheItem = ((CacheHandlerPro) cacheHandler).get(this, cacheId, cachedWithin);
if (cacheItem instanceof IncludeCacheItem) {
try {
write(((IncludeCacheItem) cacheItem).getOutput());
return;
}
catch (IOException e) {
throw Caster.toPageException(e);
}
}
}
else if (cacheHandler != null) { // TODO this else block can be removed when all cache handlers implement CacheHandlerPro
CacheItem cacheItem = cacheHandler.get(this, cacheId);
if (cacheItem instanceof IncludeCacheItem) {
try {
write(((IncludeCacheItem) cacheItem).getOutput());
return;
}
catch (IOException e) {
throw Caster.toPageException(e);
}
}
}
// cached item not found, process and cache result if needed
long start = System.nanoTime();
BodyContent bc = pushBody();
try {
_doInclude(sources, runOnce);
String out = bc.getString();
if (cacheHandler != null) {
CacheItem cacheItem = new IncludeCacheItem(out, ArrayUtil.isEmpty(sources) ? null : sources[0], System.nanoTime() - start);
cacheHandler.set(this, cacheId, cachedWithin, cacheItem);
return;
}
}
finally {
BodyContentUtil.flushAndPop(this, bc);
}
} | java | public void _doInclude(PageSource[] sources, boolean runOnce, Object cachedWithin) throws PageException {
if (cachedWithin == null) {
_doInclude(sources, runOnce);
return;
}
// ignore call when runonce an it is not first call
if (runOnce) {
Page currentPage = PageSourceImpl.loadPage(this, sources);
if (runOnce && includeOnce.contains(currentPage.getPageSource())) return;
}
// get cached data
String cacheId = CacheHandlerCollectionImpl.createId(sources);
CacheHandler cacheHandler = config.getCacheHandlerCollection(Config.CACHE_TYPE_INCLUDE, null).getInstanceMatchingObject(cachedWithin, null);
if (cacheHandler instanceof CacheHandlerPro) {
CacheItem cacheItem = ((CacheHandlerPro) cacheHandler).get(this, cacheId, cachedWithin);
if (cacheItem instanceof IncludeCacheItem) {
try {
write(((IncludeCacheItem) cacheItem).getOutput());
return;
}
catch (IOException e) {
throw Caster.toPageException(e);
}
}
}
else if (cacheHandler != null) { // TODO this else block can be removed when all cache handlers implement CacheHandlerPro
CacheItem cacheItem = cacheHandler.get(this, cacheId);
if (cacheItem instanceof IncludeCacheItem) {
try {
write(((IncludeCacheItem) cacheItem).getOutput());
return;
}
catch (IOException e) {
throw Caster.toPageException(e);
}
}
}
// cached item not found, process and cache result if needed
long start = System.nanoTime();
BodyContent bc = pushBody();
try {
_doInclude(sources, runOnce);
String out = bc.getString();
if (cacheHandler != null) {
CacheItem cacheItem = new IncludeCacheItem(out, ArrayUtil.isEmpty(sources) ? null : sources[0], System.nanoTime() - start);
cacheHandler.set(this, cacheId, cachedWithin, cacheItem);
return;
}
}
finally {
BodyContentUtil.flushAndPop(this, bc);
}
} | [
"public",
"void",
"_doInclude",
"(",
"PageSource",
"[",
"]",
"sources",
",",
"boolean",
"runOnce",
",",
"Object",
"cachedWithin",
")",
"throws",
"PageException",
"{",
"if",
"(",
"cachedWithin",
"==",
"null",
")",
"{",
"_doInclude",
"(",
"sources",
",",
"runO... | calling this method and in this case it should not be used | [
"calling",
"this",
"method",
"and",
"in",
"this",
"case",
"it",
"should",
"not",
"be",
"used"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/PageContextImpl.java#L801-L863 |
30,516 | lucee/Lucee | core/src/main/java/lucee/runtime/PageContextImpl.java | PageContextImpl.subparam | public void subparam(String type, String name, final Object value, double min, double max, String strPattern, int maxLength, final boolean isNew) throws PageException {
// check attributes type
if (type == null) type = "any";
else type = type.trim().toLowerCase();
// cast and set value
if (!"any".equals(type)) {
// range
if ("range".equals(type)) {
boolean hasMin = Decision.isValid(min);
boolean hasMax = Decision.isValid(max);
double number = Caster.toDoubleValue(value);
if (!hasMin && !hasMax) throw new ExpressionException("you need to define one of the following attributes [min,max], when type is set to [range]");
if (hasMin && number < min)
throw new ExpressionException("The number [" + Caster.toString(number) + "] is to small, the number must be at least [" + Caster.toString(min) + "]");
if (hasMax && number > max)
throw new ExpressionException("The number [" + Caster.toString(number) + "] is to big, the number cannot be bigger than [" + Caster.toString(max) + "]");
setVariable(name, Caster.toDouble(number));
}
// regex
else if ("regex".equals(type) || "regular_expression".equals(type)) {
String str = Caster.toString(value);
if (strPattern == null) throw new ExpressionException("Missing attribute [pattern]");
if (!Perl5Util.matches(strPattern, str)) throw new ExpressionException("The value [" + str + "] doesn't match the provided pattern [" + strPattern + "]");
setVariable(name, str);
}
else if (type.equals("int") || type.equals("integer")) {
if (!Decision.isInteger(value)) throw new ExpressionException("The value [" + value + "] is not a valid integer");
setVariable(name, value);
}
else {
if (!Decision.isCastableTo(type, value, true, true, maxLength)) {
if (maxLength > -1 && ("email".equalsIgnoreCase(type) || "url".equalsIgnoreCase(type) || "string".equalsIgnoreCase(type))) {
StringBuilder msg = new StringBuilder(CasterException.createMessage(value, type));
msg.append(" with a maximum length of " + maxLength + " characters");
throw new CasterException(msg.toString());
}
throw new CasterException(value, type);
}
setVariable(name, value);
// REALCAST setVariable(name,Caster.castTo(this,type,value,true));
}
}
else if (isNew) setVariable(name, value);
} | java | public void subparam(String type, String name, final Object value, double min, double max, String strPattern, int maxLength, final boolean isNew) throws PageException {
// check attributes type
if (type == null) type = "any";
else type = type.trim().toLowerCase();
// cast and set value
if (!"any".equals(type)) {
// range
if ("range".equals(type)) {
boolean hasMin = Decision.isValid(min);
boolean hasMax = Decision.isValid(max);
double number = Caster.toDoubleValue(value);
if (!hasMin && !hasMax) throw new ExpressionException("you need to define one of the following attributes [min,max], when type is set to [range]");
if (hasMin && number < min)
throw new ExpressionException("The number [" + Caster.toString(number) + "] is to small, the number must be at least [" + Caster.toString(min) + "]");
if (hasMax && number > max)
throw new ExpressionException("The number [" + Caster.toString(number) + "] is to big, the number cannot be bigger than [" + Caster.toString(max) + "]");
setVariable(name, Caster.toDouble(number));
}
// regex
else if ("regex".equals(type) || "regular_expression".equals(type)) {
String str = Caster.toString(value);
if (strPattern == null) throw new ExpressionException("Missing attribute [pattern]");
if (!Perl5Util.matches(strPattern, str)) throw new ExpressionException("The value [" + str + "] doesn't match the provided pattern [" + strPattern + "]");
setVariable(name, str);
}
else if (type.equals("int") || type.equals("integer")) {
if (!Decision.isInteger(value)) throw new ExpressionException("The value [" + value + "] is not a valid integer");
setVariable(name, value);
}
else {
if (!Decision.isCastableTo(type, value, true, true, maxLength)) {
if (maxLength > -1 && ("email".equalsIgnoreCase(type) || "url".equalsIgnoreCase(type) || "string".equalsIgnoreCase(type))) {
StringBuilder msg = new StringBuilder(CasterException.createMessage(value, type));
msg.append(" with a maximum length of " + maxLength + " characters");
throw new CasterException(msg.toString());
}
throw new CasterException(value, type);
}
setVariable(name, value);
// REALCAST setVariable(name,Caster.castTo(this,type,value,true));
}
}
else if (isNew) setVariable(name, value);
} | [
"public",
"void",
"subparam",
"(",
"String",
"type",
",",
"String",
"name",
",",
"final",
"Object",
"value",
",",
"double",
"min",
",",
"double",
"max",
",",
"String",
"strPattern",
",",
"int",
"maxLength",
",",
"final",
"boolean",
"isNew",
")",
"throws",
... | used by generated code FUTURE add to interface | [
"used",
"by",
"generated",
"code",
"FUTURE",
"add",
"to",
"interface"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/PageContextImpl.java#L1515-L1569 |
30,517 | lucee/Lucee | core/src/main/java/lucee/runtime/PageContextImpl.java | PageContextImpl.initIdAndToken | private void initIdAndToken() {
boolean setCookie = true;
// From URL
Object oCfid = urlScope().get(KeyConstants._cfid, null);
Object oCftoken = urlScope().get(KeyConstants._cftoken, null);
// if CFID comes from URL, we only accept if already exists
if (oCfid != null) {
if (Decision.isGUIdSimple(oCfid)) {
if (!scopeContext.hasExistingCFID(this, Caster.toString(oCfid, null))) {
oCfid = null;
oCftoken = null;
}
}
else {
oCfid = null;
oCftoken = null;
}
}
// Cookie
if (oCfid == null) {
setCookie = false;
oCfid = cookieScope().get(KeyConstants._cfid, null);
oCftoken = cookieScope().get(KeyConstants._cftoken, null);
}
// check cookie value
if (oCfid != null) {
// cookie value is invalid, maybe from ACF
if (!Decision.isGUIdSimple(oCfid)) {
oCfid = null;
oCftoken = null;
Charset charset = getWebCharset();
// check if we have multiple cookies with the name "cfid" and a other one is valid
javax.servlet.http.Cookie[] cookies = getHttpServletRequest().getCookies();
String name, value;
if (cookies != null) {
for (int i = 0; i < cookies.length; i++) {
name = ReqRspUtil.decode(cookies[i].getName(), charset.name(), false);
// CFID
if ("cfid".equalsIgnoreCase(name)) {
value = ReqRspUtil.decode(cookies[i].getValue(), charset.name(), false);
if (Decision.isGUIdSimple(value)) oCfid = value;
ReqRspUtil.removeCookie(getHttpServletResponse(), name);
}
// CFToken
else if ("cftoken".equalsIgnoreCase(name)) {
value = ReqRspUtil.decode(cookies[i].getValue(), charset.name(), false);
if (isValidCfToken(value)) oCftoken = value;
ReqRspUtil.removeCookie(getHttpServletResponse(), name);
}
}
}
if (oCfid != null) {
setCookie = true;
if (oCftoken == null) oCftoken = "0";
}
}
}
// New One
if (oCfid == null || oCftoken == null) {
setCookie = true;
cfid = ScopeContext.getNewCFId();
cftoken = ScopeContext.getNewCFToken();
}
else {
cfid = Caster.toString(oCfid, null);
cftoken = Caster.toString(oCftoken, "0");
}
if (setCookie && applicationContext.isSetClientCookies()) setClientCookies();
} | java | private void initIdAndToken() {
boolean setCookie = true;
// From URL
Object oCfid = urlScope().get(KeyConstants._cfid, null);
Object oCftoken = urlScope().get(KeyConstants._cftoken, null);
// if CFID comes from URL, we only accept if already exists
if (oCfid != null) {
if (Decision.isGUIdSimple(oCfid)) {
if (!scopeContext.hasExistingCFID(this, Caster.toString(oCfid, null))) {
oCfid = null;
oCftoken = null;
}
}
else {
oCfid = null;
oCftoken = null;
}
}
// Cookie
if (oCfid == null) {
setCookie = false;
oCfid = cookieScope().get(KeyConstants._cfid, null);
oCftoken = cookieScope().get(KeyConstants._cftoken, null);
}
// check cookie value
if (oCfid != null) {
// cookie value is invalid, maybe from ACF
if (!Decision.isGUIdSimple(oCfid)) {
oCfid = null;
oCftoken = null;
Charset charset = getWebCharset();
// check if we have multiple cookies with the name "cfid" and a other one is valid
javax.servlet.http.Cookie[] cookies = getHttpServletRequest().getCookies();
String name, value;
if (cookies != null) {
for (int i = 0; i < cookies.length; i++) {
name = ReqRspUtil.decode(cookies[i].getName(), charset.name(), false);
// CFID
if ("cfid".equalsIgnoreCase(name)) {
value = ReqRspUtil.decode(cookies[i].getValue(), charset.name(), false);
if (Decision.isGUIdSimple(value)) oCfid = value;
ReqRspUtil.removeCookie(getHttpServletResponse(), name);
}
// CFToken
else if ("cftoken".equalsIgnoreCase(name)) {
value = ReqRspUtil.decode(cookies[i].getValue(), charset.name(), false);
if (isValidCfToken(value)) oCftoken = value;
ReqRspUtil.removeCookie(getHttpServletResponse(), name);
}
}
}
if (oCfid != null) {
setCookie = true;
if (oCftoken == null) oCftoken = "0";
}
}
}
// New One
if (oCfid == null || oCftoken == null) {
setCookie = true;
cfid = ScopeContext.getNewCFId();
cftoken = ScopeContext.getNewCFToken();
}
else {
cfid = Caster.toString(oCfid, null);
cftoken = Caster.toString(oCftoken, "0");
}
if (setCookie && applicationContext.isSetClientCookies()) setClientCookies();
} | [
"private",
"void",
"initIdAndToken",
"(",
")",
"{",
"boolean",
"setCookie",
"=",
"true",
";",
"// From URL",
"Object",
"oCfid",
"=",
"urlScope",
"(",
")",
".",
"get",
"(",
"KeyConstants",
".",
"_cfid",
",",
"null",
")",
";",
"Object",
"oCftoken",
"=",
"u... | initialize the cfid and the cftoken | [
"initialize",
"the",
"cfid",
"and",
"the",
"cftoken"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/PageContextImpl.java#L2526-L2600 |
30,518 | lucee/Lucee | core/src/main/java/lucee/runtime/config/NullSupportHelper.java | NullSupportHelper._full | private static boolean _full(PageContext pc) {
pc = ThreadLocalPageContext.get(pc);
if (pc == null) return false;
return pc.getCurrentTemplateDialect() != CFMLEngine.DIALECT_CFML || ((PageContextImpl) pc).getFullNullSupport();
} | java | private static boolean _full(PageContext pc) {
pc = ThreadLocalPageContext.get(pc);
if (pc == null) return false;
return pc.getCurrentTemplateDialect() != CFMLEngine.DIALECT_CFML || ((PageContextImpl) pc).getFullNullSupport();
} | [
"private",
"static",
"boolean",
"_full",
"(",
"PageContext",
"pc",
")",
"{",
"pc",
"=",
"ThreadLocalPageContext",
".",
"get",
"(",
"pc",
")",
";",
"if",
"(",
"pc",
"==",
"null",
")",
"return",
"false",
";",
"return",
"pc",
".",
"getCurrentTemplateDialect",... | protected static boolean simpleMode; | [
"protected",
"static",
"boolean",
"simpleMode",
";"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/NullSupportHelper.java#L33-L37 |
30,519 | lucee/Lucee | core/src/main/java/lucee/runtime/engine/ThreadLocalPageContext.java | ThreadLocalPageContext.register | public static void register(PageContext pc) {// print.ds(Thread.currentThread().getName());
if (pc == null) return; // TODO happens with Gateway, but should not!
// TODO should i set the old one by "release"?
Thread t = Thread.currentThread();
t.setContextClassLoader(((ConfigImpl) pc.getConfig()).getClassLoaderEnv());
((PageContextImpl) pc).setThread(t);
pcThreadLocal.set(pc);
} | java | public static void register(PageContext pc) {// print.ds(Thread.currentThread().getName());
if (pc == null) return; // TODO happens with Gateway, but should not!
// TODO should i set the old one by "release"?
Thread t = Thread.currentThread();
t.setContextClassLoader(((ConfigImpl) pc.getConfig()).getClassLoaderEnv());
((PageContextImpl) pc).setThread(t);
pcThreadLocal.set(pc);
} | [
"public",
"static",
"void",
"register",
"(",
"PageContext",
"pc",
")",
"{",
"// print.ds(Thread.currentThread().getName());",
"if",
"(",
"pc",
"==",
"null",
")",
"return",
";",
"// TODO happens with Gateway, but should not!",
"// TODO should i set the old one by \"release\"?",
... | register a pagecontext for he current thread
@param pc PageContext to register | [
"register",
"a",
"pagecontext",
"for",
"he",
"current",
"thread"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/engine/ThreadLocalPageContext.java#L45-L52 |
30,520 | lucee/Lucee | core/src/main/java/lucee/runtime/type/ref/NativeReference.java | NativeReference.getInstance | public static Reference getInstance(Object o, String key) {
if (o instanceof Reference) {
return new ReferenceReference((Reference) o, key);
}
Collection coll = Caster.toCollection(o, null);
if (coll != null) return new VariableReference(coll, key);
return new NativeReference(o, key);
} | java | public static Reference getInstance(Object o, String key) {
if (o instanceof Reference) {
return new ReferenceReference((Reference) o, key);
}
Collection coll = Caster.toCollection(o, null);
if (coll != null) return new VariableReference(coll, key);
return new NativeReference(o, key);
} | [
"public",
"static",
"Reference",
"getInstance",
"(",
"Object",
"o",
",",
"String",
"key",
")",
"{",
"if",
"(",
"o",
"instanceof",
"Reference",
")",
"{",
"return",
"new",
"ReferenceReference",
"(",
"(",
"Reference",
")",
"o",
",",
"key",
")",
";",
"}",
... | returns a Reference Instance
@param o
@param key
@return Reference Instance | [
"returns",
"a",
"Reference",
"Instance"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/ref/NativeReference.java#L54-L61 |
30,521 | lucee/Lucee | core/src/main/java/lucee/runtime/type/scope/ScopeContext.java | ScopeContext.getSubMap | private Map<String, Scope> getSubMap(Map<String, Map<String, Scope>> parent, String key) {
Map<String, Scope> context = parent.get(key);
if (context != null) return context;
context = MapFactory.<String, Scope>getConcurrentMap();
parent.put(key, context);
return context;
} | java | private Map<String, Scope> getSubMap(Map<String, Map<String, Scope>> parent, String key) {
Map<String, Scope> context = parent.get(key);
if (context != null) return context;
context = MapFactory.<String, Scope>getConcurrentMap();
parent.put(key, context);
return context;
} | [
"private",
"Map",
"<",
"String",
",",
"Scope",
">",
"getSubMap",
"(",
"Map",
"<",
"String",
",",
"Map",
"<",
"String",
",",
"Scope",
">",
">",
"parent",
",",
"String",
"key",
")",
"{",
"Map",
"<",
"String",
",",
"Scope",
">",
"context",
"=",
"paren... | return a map matching key from given map
@param parent
@param key key of the map
@return matching map, if no map exist it willbe one created | [
"return",
"a",
"map",
"matching",
"key",
"from",
"given",
"map"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/scope/ScopeContext.java#L154-L163 |
30,522 | lucee/Lucee | core/src/main/java/lucee/runtime/type/scope/ScopeContext.java | ScopeContext.getServerScope | public static Server getServerScope(PageContext pc, boolean jsr223) {
if (server == null) {
server = new ServerImpl(pc, jsr223);
}
return server;
} | java | public static Server getServerScope(PageContext pc, boolean jsr223) {
if (server == null) {
server = new ServerImpl(pc, jsr223);
}
return server;
} | [
"public",
"static",
"Server",
"getServerScope",
"(",
"PageContext",
"pc",
",",
"boolean",
"jsr223",
")",
"{",
"if",
"(",
"server",
"==",
"null",
")",
"{",
"server",
"=",
"new",
"ServerImpl",
"(",
"pc",
",",
"jsr223",
")",
";",
"}",
"return",
"server",
... | return the server Scope for this context
@param pc
@return server scope | [
"return",
"the",
"server",
"Scope",
"for",
"this",
"context"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/scope/ScopeContext.java#L171-L176 |
30,523 | lucee/Lucee | core/src/main/java/lucee/runtime/type/scope/ScopeContext.java | ScopeContext.getClusterScope | public static Cluster getClusterScope(Config config, boolean create) throws PageException {
if (cluster == null && create) {
cluster = ((ConfigImpl) config).createClusterScope();
}
return cluster;
} | java | public static Cluster getClusterScope(Config config, boolean create) throws PageException {
if (cluster == null && create) {
cluster = ((ConfigImpl) config).createClusterScope();
}
return cluster;
} | [
"public",
"static",
"Cluster",
"getClusterScope",
"(",
"Config",
"config",
",",
"boolean",
"create",
")",
"throws",
"PageException",
"{",
"if",
"(",
"cluster",
"==",
"null",
"&&",
"create",
")",
"{",
"cluster",
"=",
"(",
"(",
"ConfigImpl",
")",
"config",
"... | Returns the current Cluster Scope, if there is no current Cluster Scope and create is true,
returns a new Cluster Scope. If create is false and the request has no valid Cluster Scope, this
method returns null.
@param config
@param create
@return
@throws PageException | [
"Returns",
"the",
"current",
"Cluster",
"Scope",
"if",
"there",
"is",
"no",
"current",
"Cluster",
"Scope",
"and",
"create",
"is",
"true",
"returns",
"a",
"new",
"Cluster",
"Scope",
".",
"If",
"create",
"is",
"false",
"and",
"the",
"request",
"has",
"no",
... | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/scope/ScopeContext.java#L201-L207 |
30,524 | lucee/Lucee | core/src/main/java/lucee/runtime/type/scope/ScopeContext.java | ScopeContext.getAppContextSessionCount | public int getAppContextSessionCount(PageContext pc) {
ApplicationContext appContext = pc.getApplicationContext();
if (pc.getSessionType() == Config.SESSION_TYPE_JEE) return 0;
Map<String, Scope> context = getSubMap(cfSessionContexts, appContext.getName());
return getCount(context);
} | java | public int getAppContextSessionCount(PageContext pc) {
ApplicationContext appContext = pc.getApplicationContext();
if (pc.getSessionType() == Config.SESSION_TYPE_JEE) return 0;
Map<String, Scope> context = getSubMap(cfSessionContexts, appContext.getName());
return getCount(context);
} | [
"public",
"int",
"getAppContextSessionCount",
"(",
"PageContext",
"pc",
")",
"{",
"ApplicationContext",
"appContext",
"=",
"pc",
".",
"getApplicationContext",
"(",
")",
";",
"if",
"(",
"pc",
".",
"getSessionType",
"(",
")",
"==",
"Config",
".",
"SESSION_TYPE_JEE... | return the session count of this application context
@return | [
"return",
"the",
"session",
"count",
"of",
"this",
"application",
"context"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/scope/ScopeContext.java#L378-L384 |
30,525 | lucee/Lucee | core/src/main/java/lucee/runtime/type/scope/ScopeContext.java | ScopeContext.getScopesSize | public long getScopesSize(int scope) throws ExpressionException {
if (scope == Scope.SCOPE_APPLICATION) return SizeOf.size(applicationContexts);
if (scope == Scope.SCOPE_CLUSTER) return SizeOf.size(cluster);
if (scope == Scope.SCOPE_SERVER) return SizeOf.size(server);
if (scope == Scope.SCOPE_SESSION) return SizeOf.size(this.cfSessionContexts);
if (scope == Scope.SCOPE_CLIENT) return SizeOf.size(this.cfClientContexts);
throw new ExpressionException("can only return information of scope that are not request dependent");
} | java | public long getScopesSize(int scope) throws ExpressionException {
if (scope == Scope.SCOPE_APPLICATION) return SizeOf.size(applicationContexts);
if (scope == Scope.SCOPE_CLUSTER) return SizeOf.size(cluster);
if (scope == Scope.SCOPE_SERVER) return SizeOf.size(server);
if (scope == Scope.SCOPE_SESSION) return SizeOf.size(this.cfSessionContexts);
if (scope == Scope.SCOPE_CLIENT) return SizeOf.size(this.cfClientContexts);
throw new ExpressionException("can only return information of scope that are not request dependent");
} | [
"public",
"long",
"getScopesSize",
"(",
"int",
"scope",
")",
"throws",
"ExpressionException",
"{",
"if",
"(",
"scope",
"==",
"Scope",
".",
"SCOPE_APPLICATION",
")",
"return",
"SizeOf",
".",
"size",
"(",
"applicationContexts",
")",
";",
"if",
"(",
"scope",
"=... | return the size in bytes of all session contexts
@return size in bytes
@throws ExpressionException | [
"return",
"the",
"size",
"in",
"bytes",
"of",
"all",
"session",
"contexts"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/scope/ScopeContext.java#L433-L441 |
30,526 | lucee/Lucee | core/src/main/java/lucee/runtime/type/scope/ScopeContext.java | ScopeContext.getJSessionScope | private Session getJSessionScope(PageContext pc, RefBoolean isNew) throws PageException {
HttpSession httpSession = pc.getSession();
ApplicationContext appContext = pc.getApplicationContext();
Object session = null;// this is from type object, because it is possible that httpSession return object from
// prior restart
int s = (int) appContext.getSessionTimeout().getSeconds();
if (maxSessionTimeout < s) maxSessionTimeout = s;
if (httpSession != null) {
httpSession.setMaxInactiveInterval(maxSessionTimeout + 60);
session = httpSession.getAttribute(appContext.getName());
}
else {
Map<String, Scope> context = getSubMap(cfSessionContexts, appContext.getName());
session = context.get(pc.getCFID());
}
JSession jSession = null;
if (session instanceof JSession) {
jSession = (JSession) session;
try {
if (jSession.isExpired()) {
jSession.touch();
}
info(getLog(), "use existing JSession for " + appContext.getName() + "/" + pc.getCFID());
}
catch (ClassCastException cce) {
error(getLog(), cce);
// if there is no HTTPSession
if (httpSession == null) return getCFSessionScope(pc, isNew);
jSession = new JSession();
httpSession.setAttribute(appContext.getName(), jSession);
isNew.setValue(true);
}
}
else {
// if there is no HTTPSession
if (httpSession == null) return getCFSessionScope(pc, isNew);
info(getLog(), "create new JSession for " + appContext.getName() + "/" + pc.getCFID());
jSession = new JSession();
httpSession.setAttribute(appContext.getName(), jSession);
isNew.setValue(true);
Map<String, Scope> context = getSubMap(cfSessionContexts, appContext.getName());
context.put(pc.getCFID(), jSession);
}
jSession.touchBeforeRequest(pc);
return jSession;
} | java | private Session getJSessionScope(PageContext pc, RefBoolean isNew) throws PageException {
HttpSession httpSession = pc.getSession();
ApplicationContext appContext = pc.getApplicationContext();
Object session = null;// this is from type object, because it is possible that httpSession return object from
// prior restart
int s = (int) appContext.getSessionTimeout().getSeconds();
if (maxSessionTimeout < s) maxSessionTimeout = s;
if (httpSession != null) {
httpSession.setMaxInactiveInterval(maxSessionTimeout + 60);
session = httpSession.getAttribute(appContext.getName());
}
else {
Map<String, Scope> context = getSubMap(cfSessionContexts, appContext.getName());
session = context.get(pc.getCFID());
}
JSession jSession = null;
if (session instanceof JSession) {
jSession = (JSession) session;
try {
if (jSession.isExpired()) {
jSession.touch();
}
info(getLog(), "use existing JSession for " + appContext.getName() + "/" + pc.getCFID());
}
catch (ClassCastException cce) {
error(getLog(), cce);
// if there is no HTTPSession
if (httpSession == null) return getCFSessionScope(pc, isNew);
jSession = new JSession();
httpSession.setAttribute(appContext.getName(), jSession);
isNew.setValue(true);
}
}
else {
// if there is no HTTPSession
if (httpSession == null) return getCFSessionScope(pc, isNew);
info(getLog(), "create new JSession for " + appContext.getName() + "/" + pc.getCFID());
jSession = new JSession();
httpSession.setAttribute(appContext.getName(), jSession);
isNew.setValue(true);
Map<String, Scope> context = getSubMap(cfSessionContexts, appContext.getName());
context.put(pc.getCFID(), jSession);
}
jSession.touchBeforeRequest(pc);
return jSession;
} | [
"private",
"Session",
"getJSessionScope",
"(",
"PageContext",
"pc",
",",
"RefBoolean",
"isNew",
")",
"throws",
"PageException",
"{",
"HttpSession",
"httpSession",
"=",
"pc",
".",
"getSession",
"(",
")",
";",
"ApplicationContext",
"appContext",
"=",
"pc",
".",
"g... | return j session scope
@param pc PageContext
@param isNew
@return j session matching the context
@throws PageException | [
"return",
"j",
"session",
"scope"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/scope/ScopeContext.java#L717-L768 |
30,527 | lucee/Lucee | core/src/main/java/lucee/runtime/type/scope/ScopeContext.java | ScopeContext.clearUnused | public void clearUnused() {
Log log = getLog();
try {
// create cleaner engine for session/client scope
if (session == null) session = new StorageScopeEngine(factory, log, new StorageScopeCleaner[] { new FileStorageScopeCleaner(Scope.SCOPE_SESSION, null)// new
// SessionEndListener())
, new DatasourceStorageScopeCleaner(Scope.SCOPE_SESSION, null)// new
// SessionEndListener())
// ,new CacheStorageScopeCleaner(Scope.SCOPE_SESSION, new SessionEndListener())
});
if (client == null) client = new StorageScopeEngine(factory, log,
new StorageScopeCleaner[] { new FileStorageScopeCleaner(Scope.SCOPE_CLIENT, null), new DatasourceStorageScopeCleaner(Scope.SCOPE_CLIENT, null)
// ,new CacheStorageScopeCleaner(Scope.SCOPE_CLIENT, null) //Cache storage need no control, if
// there is no listener
});
// store session/client scope and remove from memory
storeUnusedStorageScope(factory, Scope.SCOPE_CLIENT);
storeUnusedStorageScope(factory, Scope.SCOPE_SESSION);
// remove unused memory based client/session scope (invoke onSessonEnd)
clearUnusedMemoryScope(factory, Scope.SCOPE_CLIENT);
clearUnusedMemoryScope(factory, Scope.SCOPE_SESSION);
// session must be executed first, because session creates a reference from client scope
session.clean();
client.clean();
// clean all unused application scopes
clearUnusedApplications(factory);
}
catch (Exception t) {
error(t);
}
} | java | public void clearUnused() {
Log log = getLog();
try {
// create cleaner engine for session/client scope
if (session == null) session = new StorageScopeEngine(factory, log, new StorageScopeCleaner[] { new FileStorageScopeCleaner(Scope.SCOPE_SESSION, null)// new
// SessionEndListener())
, new DatasourceStorageScopeCleaner(Scope.SCOPE_SESSION, null)// new
// SessionEndListener())
// ,new CacheStorageScopeCleaner(Scope.SCOPE_SESSION, new SessionEndListener())
});
if (client == null) client = new StorageScopeEngine(factory, log,
new StorageScopeCleaner[] { new FileStorageScopeCleaner(Scope.SCOPE_CLIENT, null), new DatasourceStorageScopeCleaner(Scope.SCOPE_CLIENT, null)
// ,new CacheStorageScopeCleaner(Scope.SCOPE_CLIENT, null) //Cache storage need no control, if
// there is no listener
});
// store session/client scope and remove from memory
storeUnusedStorageScope(factory, Scope.SCOPE_CLIENT);
storeUnusedStorageScope(factory, Scope.SCOPE_SESSION);
// remove unused memory based client/session scope (invoke onSessonEnd)
clearUnusedMemoryScope(factory, Scope.SCOPE_CLIENT);
clearUnusedMemoryScope(factory, Scope.SCOPE_SESSION);
// session must be executed first, because session creates a reference from client scope
session.clean();
client.clean();
// clean all unused application scopes
clearUnusedApplications(factory);
}
catch (Exception t) {
error(t);
}
} | [
"public",
"void",
"clearUnused",
"(",
")",
"{",
"Log",
"log",
"=",
"getLog",
"(",
")",
";",
"try",
"{",
"// create cleaner engine for session/client scope",
"if",
"(",
"session",
"==",
"null",
")",
"session",
"=",
"new",
"StorageScopeEngine",
"(",
"factory",
"... | remove all unused scope objects | [
"remove",
"all",
"unused",
"scope",
"objects"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/scope/ScopeContext.java#L812-L845 |
30,528 | lucee/Lucee | core/src/main/java/lucee/runtime/type/scope/ScopeContext.java | ScopeContext.clear | public void clear() {
try {
Scope scope;
// Map.Entry entry,e;
// Map context;
// release all session scopes
Iterator<Entry<String, Map<String, Scope>>> sit = cfSessionContexts.entrySet().iterator();
Entry<String, Map<String, Scope>> sentry;
Map<String, Scope> context;
Iterator<Entry<String, Scope>> itt;
Entry<String, Scope> e;
PageContext pc = ThreadLocalPageContext.get();
while (sit.hasNext()) {
sentry = sit.next();
context = sentry.getValue();
itt = context.entrySet().iterator();
while (itt.hasNext()) {
e = itt.next();
scope = e.getValue();
scope.release(pc);
}
}
cfSessionContexts.clear();
// release all application scopes
Iterator<Entry<String, Application>> ait = applicationContexts.entrySet().iterator();
Entry<String, Application> aentry;
while (ait.hasNext()) {
aentry = ait.next();
scope = aentry.getValue();
scope.release(pc);
}
applicationContexts.clear();
// release server scope
if (server != null) {
server.release(pc);
server = null;
}
}
catch (Throwable t) {
ExceptionUtil.rethrowIfNecessary(t);
}
} | java | public void clear() {
try {
Scope scope;
// Map.Entry entry,e;
// Map context;
// release all session scopes
Iterator<Entry<String, Map<String, Scope>>> sit = cfSessionContexts.entrySet().iterator();
Entry<String, Map<String, Scope>> sentry;
Map<String, Scope> context;
Iterator<Entry<String, Scope>> itt;
Entry<String, Scope> e;
PageContext pc = ThreadLocalPageContext.get();
while (sit.hasNext()) {
sentry = sit.next();
context = sentry.getValue();
itt = context.entrySet().iterator();
while (itt.hasNext()) {
e = itt.next();
scope = e.getValue();
scope.release(pc);
}
}
cfSessionContexts.clear();
// release all application scopes
Iterator<Entry<String, Application>> ait = applicationContexts.entrySet().iterator();
Entry<String, Application> aentry;
while (ait.hasNext()) {
aentry = ait.next();
scope = aentry.getValue();
scope.release(pc);
}
applicationContexts.clear();
// release server scope
if (server != null) {
server.release(pc);
server = null;
}
}
catch (Throwable t) {
ExceptionUtil.rethrowIfNecessary(t);
}
} | [
"public",
"void",
"clear",
"(",
")",
"{",
"try",
"{",
"Scope",
"scope",
";",
"// Map.Entry entry,e;",
"// Map context;",
"// release all session scopes",
"Iterator",
"<",
"Entry",
"<",
"String",
",",
"Map",
"<",
"String",
",",
"Scope",
">",
">",
">",
"sit",
... | remove all scope objects | [
"remove",
"all",
"scope",
"objects"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/scope/ScopeContext.java#L850-L895 |
30,529 | lucee/Lucee | loader/src/main/java/lucee/loader/engine/CFMLEngineWrapper.java | CFMLEngineWrapper.equalTo | public boolean equalTo(CFMLEngine other, final boolean checkReferenceEqualityOnly) {
while (other instanceof CFMLEngineWrapper)
other = ((CFMLEngineWrapper) other).engine;
if (checkReferenceEqualityOnly) return engine == other;
return engine.equals(other);
} | java | public boolean equalTo(CFMLEngine other, final boolean checkReferenceEqualityOnly) {
while (other instanceof CFMLEngineWrapper)
other = ((CFMLEngineWrapper) other).engine;
if (checkReferenceEqualityOnly) return engine == other;
return engine.equals(other);
} | [
"public",
"boolean",
"equalTo",
"(",
"CFMLEngine",
"other",
",",
"final",
"boolean",
"checkReferenceEqualityOnly",
")",
"{",
"while",
"(",
"other",
"instanceof",
"CFMLEngineWrapper",
")",
"other",
"=",
"(",
"(",
"CFMLEngineWrapper",
")",
"other",
")",
".",
"engi... | this interface is new to this class and not officially part of Lucee 3.x, do not use outside the
loader
@param other
@param checkReferenceEqualityOnly
@return is equal to given engine | [
"this",
"interface",
"is",
"new",
"to",
"this",
"class",
"and",
"not",
"officially",
"part",
"of",
"Lucee",
"3",
".",
"x",
"do",
"not",
"use",
"outside",
"the",
"loader"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/loader/src/main/java/lucee/loader/engine/CFMLEngineWrapper.java#L259-L264 |
30,530 | lucee/Lucee | core/src/main/java/lucee/runtime/crypt/BlowfishECB.java | BlowfishECB.cleanUp | public void cleanUp() {
int nI;
for (nI = 0; nI < PBOX_ENTRIES; nI++)
m_pbox[nI] = 0;
for (nI = 0; nI < SBOX_ENTRIES; nI++)
m_sbox1[nI] = m_sbox2[nI] = m_sbox3[nI] = m_sbox4[nI] = 0;
} | java | public void cleanUp() {
int nI;
for (nI = 0; nI < PBOX_ENTRIES; nI++)
m_pbox[nI] = 0;
for (nI = 0; nI < SBOX_ENTRIES; nI++)
m_sbox1[nI] = m_sbox2[nI] = m_sbox3[nI] = m_sbox4[nI] = 0;
} | [
"public",
"void",
"cleanUp",
"(",
")",
"{",
"int",
"nI",
";",
"for",
"(",
"nI",
"=",
"0",
";",
"nI",
"<",
"PBOX_ENTRIES",
";",
"nI",
"++",
")",
"m_pbox",
"[",
"nI",
"]",
"=",
"0",
";",
"for",
"(",
"nI",
"=",
"0",
";",
"nI",
"<",
"SBOX_ENTRIES... | to clear data in the boxes before an instance is freed | [
"to",
"clear",
"data",
"in",
"the",
"boxes",
"before",
"an",
"instance",
"is",
"freed"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/crypt/BlowfishECB.java#L111-L117 |
30,531 | lucee/Lucee | core/src/main/java/lucee/intergral/fusiondebug/server/util/FDUtil.java | FDUtil.toVariableName | private static String toVariableName(String str) {
StringBuffer rtn = new StringBuffer();
char[] chars = str.toCharArray();
long changes = 0;
boolean doCorrect = true;
for (int i = 0; i < chars.length; i++) {
char c = chars[i];
if (i == 0 && (c >= '0' && c <= '9')) rtn.append("_" + c);
else if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '_' || c == '$') rtn.append(c);
else {
doCorrect = false;
rtn.append('_');
changes += (c * (i + 1));
}
}
if (changes > 0) rtn.append(changes);
if (doCorrect) return correctReservedWord(rtn.toString());
return rtn.toString();
} | java | private static String toVariableName(String str) {
StringBuffer rtn = new StringBuffer();
char[] chars = str.toCharArray();
long changes = 0;
boolean doCorrect = true;
for (int i = 0; i < chars.length; i++) {
char c = chars[i];
if (i == 0 && (c >= '0' && c <= '9')) rtn.append("_" + c);
else if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '_' || c == '$') rtn.append(c);
else {
doCorrect = false;
rtn.append('_');
changes += (c * (i + 1));
}
}
if (changes > 0) rtn.append(changes);
if (doCorrect) return correctReservedWord(rtn.toString());
return rtn.toString();
} | [
"private",
"static",
"String",
"toVariableName",
"(",
"String",
"str",
")",
"{",
"StringBuffer",
"rtn",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"char",
"[",
"]",
"chars",
"=",
"str",
".",
"toCharArray",
"(",
")",
";",
"long",
"changes",
"=",
"0",
";... | translate a string to a valid variable string
@param str string to translate
@return translated String | [
"translate",
"a",
"string",
"to",
"a",
"valid",
"variable",
"string"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/intergral/fusiondebug/server/util/FDUtil.java#L139-L160 |
30,532 | lucee/Lucee | core/src/main/java/lucee/intergral/fusiondebug/server/util/FDUtil.java | FDUtil.toClassName | public static String toClassName(String str) {
StringBuffer javaName = new StringBuffer();
String[] arr = lucee.runtime.type.util.ListUtil.listToStringArray(str, '/');
for (int i = 0; i < arr.length; i++) {
if (i == (arr.length - 1)) arr[i] = replaceLast(arr[i], '.', '$');
if (i != 0) javaName.append('.');
javaName.append(toVariableName(arr[i]));
}
return javaName.toString().toLowerCase();
} | java | public static String toClassName(String str) {
StringBuffer javaName = new StringBuffer();
String[] arr = lucee.runtime.type.util.ListUtil.listToStringArray(str, '/');
for (int i = 0; i < arr.length; i++) {
if (i == (arr.length - 1)) arr[i] = replaceLast(arr[i], '.', '$');
if (i != 0) javaName.append('.');
javaName.append(toVariableName(arr[i]));
}
return javaName.toString().toLowerCase();
} | [
"public",
"static",
"String",
"toClassName",
"(",
"String",
"str",
")",
"{",
"StringBuffer",
"javaName",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"String",
"[",
"]",
"arr",
"=",
"lucee",
".",
"runtime",
".",
"type",
".",
"util",
".",
"ListUtil",
".",
... | creates a classbane from give source path
@param str
@return | [
"creates",
"a",
"classbane",
"from",
"give",
"source",
"path"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/intergral/fusiondebug/server/util/FDUtil.java#L168-L178 |
30,533 | lucee/Lucee | core/src/main/java/lucee/runtime/tag/Property.java | Property.setType | public void setType(String type) {
property.setType(type);
setDynamicAttribute(null, KeyConstants._type, type);
} | java | public void setType(String type) {
property.setType(type);
setDynamicAttribute(null, KeyConstants._type, type);
} | [
"public",
"void",
"setType",
"(",
"String",
"type",
")",
"{",
"property",
".",
"setType",
"(",
"type",
")",
";",
"setDynamicAttribute",
"(",
"null",
",",
"KeyConstants",
".",
"_type",
",",
"type",
")",
";",
"}"
] | set the value type A string; a property type name; data type.
@param type value to set | [
"set",
"the",
"value",
"type",
"A",
"string",
";",
"a",
"property",
"type",
"name",
";",
"data",
"type",
"."
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/tag/Property.java#L68-L71 |
30,534 | lucee/Lucee | core/src/main/java/lucee/runtime/tag/Property.java | Property.setName | public void setName(String name) {
// Fix for axis 1.4, axis can not handle when first char is upper case
// name=StringUtil.lcFirst(name.toLowerCase());
property.setName(name);
setDynamicAttribute(null, KeyConstants._name, name);
} | java | public void setName(String name) {
// Fix for axis 1.4, axis can not handle when first char is upper case
// name=StringUtil.lcFirst(name.toLowerCase());
property.setName(name);
setDynamicAttribute(null, KeyConstants._name, name);
} | [
"public",
"void",
"setName",
"(",
"String",
"name",
")",
"{",
"// Fix for axis 1.4, axis can not handle when first char is upper case",
"// name=StringUtil.lcFirst(name.toLowerCase());",
"property",
".",
"setName",
"(",
"name",
")",
";",
"setDynamicAttribute",
"(",
"null",
",... | set the value name A string; a property name. Must be a static value.
@param name value to set | [
"set",
"the",
"value",
"name",
"A",
"string",
";",
"a",
"property",
"name",
".",
"Must",
"be",
"a",
"static",
"value",
"."
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/tag/Property.java#L78-L84 |
30,535 | lucee/Lucee | core/src/main/java/lucee/runtime/config/component/ComponentFactory.java | ComponentFactory.deploy | public static void deploy(Resource dir, boolean doNew) {
String path = "/resource/component/" + (Constants.DEFAULT_PACKAGE.replace('.', '/')) + "/";
deploy(dir, path, doNew, "Base");
deploy(dir, path, doNew, "Feed");
deploy(dir, path, doNew, "Ftp");
deploy(dir, path, doNew, "Http");
deploy(dir, path, doNew, "Mail");
deploy(dir, path, doNew, "Query");
deploy(dir, path, doNew, "Result");
deploy(dir, path, doNew, "Administrator");
// orm
{
Resource ormDir = dir.getRealResource("orm");
String ormPath = path + "orm/";
if (!ormDir.exists()) ormDir.mkdirs();
deploy(ormDir, ormPath, doNew, "IEventHandler");
deploy(ormDir, ormPath, doNew, "INamingStrategy");
}
// test
{
Resource testDir = dir.getRealResource("test");
String testPath = path + "test/";
if (!testDir.exists()) testDir.mkdirs();
deploy(testDir, testPath, doNew, "LuceeTestSuite");
deploy(testDir, testPath, doNew, "LuceeTestSuiteRunner");
deploy(testDir, testPath, doNew, "LuceeTestCase");
}
} | java | public static void deploy(Resource dir, boolean doNew) {
String path = "/resource/component/" + (Constants.DEFAULT_PACKAGE.replace('.', '/')) + "/";
deploy(dir, path, doNew, "Base");
deploy(dir, path, doNew, "Feed");
deploy(dir, path, doNew, "Ftp");
deploy(dir, path, doNew, "Http");
deploy(dir, path, doNew, "Mail");
deploy(dir, path, doNew, "Query");
deploy(dir, path, doNew, "Result");
deploy(dir, path, doNew, "Administrator");
// orm
{
Resource ormDir = dir.getRealResource("orm");
String ormPath = path + "orm/";
if (!ormDir.exists()) ormDir.mkdirs();
deploy(ormDir, ormPath, doNew, "IEventHandler");
deploy(ormDir, ormPath, doNew, "INamingStrategy");
}
// test
{
Resource testDir = dir.getRealResource("test");
String testPath = path + "test/";
if (!testDir.exists()) testDir.mkdirs();
deploy(testDir, testPath, doNew, "LuceeTestSuite");
deploy(testDir, testPath, doNew, "LuceeTestSuiteRunner");
deploy(testDir, testPath, doNew, "LuceeTestCase");
}
} | [
"public",
"static",
"void",
"deploy",
"(",
"Resource",
"dir",
",",
"boolean",
"doNew",
")",
"{",
"String",
"path",
"=",
"\"/resource/component/\"",
"+",
"(",
"Constants",
".",
"DEFAULT_PACKAGE",
".",
"replace",
"(",
"'",
"'",
",",
"'",
"'",
")",
")",
"+"... | this method deploy all components for org.lucee.cfml
@param dir components directory
@param doNew redeploy even the file exist, this is set to true when a new version is started | [
"this",
"method",
"deploy",
"all",
"components",
"for",
"org",
".",
"lucee",
".",
"cfml"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/component/ComponentFactory.java#L33-L64 |
30,536 | lucee/Lucee | core/src/main/java/lucee/commons/io/FileUtil.java | FileUtil.URLToFile | public static final File URLToFile(URL url) throws MalformedURLException {
if (!"file".equals(url.getProtocol())) throw new MalformedURLException("URL protocol must be 'file'.");
return new File(URIToFilename(url.getFile()));
} | java | public static final File URLToFile(URL url) throws MalformedURLException {
if (!"file".equals(url.getProtocol())) throw new MalformedURLException("URL protocol must be 'file'.");
return new File(URIToFilename(url.getFile()));
} | [
"public",
"static",
"final",
"File",
"URLToFile",
"(",
"URL",
"url",
")",
"throws",
"MalformedURLException",
"{",
"if",
"(",
"!",
"\"file\"",
".",
"equals",
"(",
"url",
".",
"getProtocol",
"(",
")",
")",
")",
"throw",
"new",
"MalformedURLException",
"(",
"... | translate a URL to a File Object
@param url
@return matching file object
@throws MalformedURLException | [
"translate",
"a",
"URL",
"to",
"a",
"File",
"Object"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/io/FileUtil.java#L117-L120 |
30,537 | lucee/Lucee | core/src/main/java/lucee/commons/io/FileUtil.java | FileUtil.URIToFilename | public static final String URIToFilename(String str) {
// Windows fix
if (str.length() >= 3) {
if (str.charAt(0) == '/' && str.charAt(2) == ':') {
char ch1 = Character.toUpperCase(str.charAt(1));
if (ch1 >= 'A' && ch1 <= 'Z') str = str.substring(1);
}
}
// handle platform dependent strings
str = str.replace('/', java.io.File.separatorChar);
return str;
} | java | public static final String URIToFilename(String str) {
// Windows fix
if (str.length() >= 3) {
if (str.charAt(0) == '/' && str.charAt(2) == ':') {
char ch1 = Character.toUpperCase(str.charAt(1));
if (ch1 >= 'A' && ch1 <= 'Z') str = str.substring(1);
}
}
// handle platform dependent strings
str = str.replace('/', java.io.File.separatorChar);
return str;
} | [
"public",
"static",
"final",
"String",
"URIToFilename",
"(",
"String",
"str",
")",
"{",
"// Windows fix",
"if",
"(",
"str",
".",
"length",
"(",
")",
">=",
"3",
")",
"{",
"if",
"(",
"str",
".",
"charAt",
"(",
"0",
")",
"==",
"'",
"'",
"&&",
"str",
... | Fixes a platform dependent filename to standard URI form.
@param str The string to fix.
@return Returns the fixed URI string. | [
"Fixes",
"a",
"platform",
"dependent",
"filename",
"to",
"standard",
"URI",
"form",
"."
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/io/FileUtil.java#L128-L139 |
30,538 | lucee/Lucee | core/src/main/java/lucee/runtime/net/ftp/FTPWrap.java | FTPWrap.connect | private void connect() throws IOException {
client = AFTPClient.getInstance(conn.secure(), address, conn.getPort(), conn.getUsername(), conn.getPassword(), conn.getFingerprint(), conn.getStopOnError());
if (client instanceof SFTPClientImpl && conn.getKey() != null) {
((SFTPClientImpl) client).setSshKey(conn.getKey(), conn.getPassphrase());
}
setConnectionSettings(client, conn);
// transfer mode
if (conn.getTransferMode() == FTPConstant.TRANSFER_MODE_ASCCI) getClient().setFileType(FTP.ASCII_FILE_TYPE);
else if (conn.getTransferMode() == FTPConstant.TRANSFER_MODE_BINARY) getClient().setFileType(FTP.BINARY_FILE_TYPE);
// Connect
try {
Proxy.start(conn.getProxyServer(), conn.getProxyPort(), conn.getProxyUser(), conn.getProxyPassword());
client.connect();
}
finally {
Proxy.end();
}
} | java | private void connect() throws IOException {
client = AFTPClient.getInstance(conn.secure(), address, conn.getPort(), conn.getUsername(), conn.getPassword(), conn.getFingerprint(), conn.getStopOnError());
if (client instanceof SFTPClientImpl && conn.getKey() != null) {
((SFTPClientImpl) client).setSshKey(conn.getKey(), conn.getPassphrase());
}
setConnectionSettings(client, conn);
// transfer mode
if (conn.getTransferMode() == FTPConstant.TRANSFER_MODE_ASCCI) getClient().setFileType(FTP.ASCII_FILE_TYPE);
else if (conn.getTransferMode() == FTPConstant.TRANSFER_MODE_BINARY) getClient().setFileType(FTP.BINARY_FILE_TYPE);
// Connect
try {
Proxy.start(conn.getProxyServer(), conn.getProxyPort(), conn.getProxyUser(), conn.getProxyPassword());
client.connect();
}
finally {
Proxy.end();
}
} | [
"private",
"void",
"connect",
"(",
")",
"throws",
"IOException",
"{",
"client",
"=",
"AFTPClient",
".",
"getInstance",
"(",
"conn",
".",
"secure",
"(",
")",
",",
"address",
",",
"conn",
".",
"getPort",
"(",
")",
",",
"conn",
".",
"getUsername",
"(",
")... | connects the client
@throws IOException | [
"connects",
"the",
"client"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/net/ftp/FTPWrap.java#L100-L122 |
30,539 | lucee/Lucee | core/src/main/java/lucee/runtime/type/scope/session/SessionMemory.java | SessionMemory.getInstance | public static Session getInstance(PageContext pc, RefBoolean isNew, Log log) {
isNew.setValue(true);
return new SessionMemory(pc, log);
} | java | public static Session getInstance(PageContext pc, RefBoolean isNew, Log log) {
isNew.setValue(true);
return new SessionMemory(pc, log);
} | [
"public",
"static",
"Session",
"getInstance",
"(",
"PageContext",
"pc",
",",
"RefBoolean",
"isNew",
",",
"Log",
"log",
")",
"{",
"isNew",
".",
"setValue",
"(",
"true",
")",
";",
"return",
"new",
"SessionMemory",
"(",
"pc",
",",
"log",
")",
";",
"}"
] | load a new instance of the class
@param pc
@param isNew
@return | [
"load",
"a",
"new",
"instance",
"of",
"the",
"class"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/scope/session/SessionMemory.java#L62-L65 |
30,540 | lucee/Lucee | core/src/main/java/lucee/runtime/security/CredentialImpl.java | CredentialImpl.toRole | public static String[] toRole(Object oRoles) throws PageException {
if (oRoles instanceof String) {
oRoles = ListUtil.listToArrayRemoveEmpty(oRoles.toString(), ",");
}
if (oRoles instanceof Array) {
Array arrRoles = (Array) oRoles;
String[] roles = new String[arrRoles.size()];
for (int i = 0; i < roles.length; i++) {
roles[i] = Caster.toString(arrRoles.get(i + 1, ""));
}
return roles;
}
throw new ApplicationException("invalid roles definition for tag loginuser");
} | java | public static String[] toRole(Object oRoles) throws PageException {
if (oRoles instanceof String) {
oRoles = ListUtil.listToArrayRemoveEmpty(oRoles.toString(), ",");
}
if (oRoles instanceof Array) {
Array arrRoles = (Array) oRoles;
String[] roles = new String[arrRoles.size()];
for (int i = 0; i < roles.length; i++) {
roles[i] = Caster.toString(arrRoles.get(i + 1, ""));
}
return roles;
}
throw new ApplicationException("invalid roles definition for tag loginuser");
} | [
"public",
"static",
"String",
"[",
"]",
"toRole",
"(",
"Object",
"oRoles",
")",
"throws",
"PageException",
"{",
"if",
"(",
"oRoles",
"instanceof",
"String",
")",
"{",
"oRoles",
"=",
"ListUtil",
".",
"listToArrayRemoveEmpty",
"(",
"oRoles",
".",
"toString",
"... | convert a Object to a String Array of Roles
@param oRoles
@return roles
@throws PageException | [
"convert",
"a",
"Object",
"to",
"a",
"String",
"Array",
"of",
"Roles"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/security/CredentialImpl.java#L123-L137 |
30,541 | lucee/Lucee | core/src/main/java/lucee/runtime/security/CredentialImpl.java | CredentialImpl.decode | public static Credential decode(Object encoded, Resource rolesDir) throws PageException {
String dec;
try {
dec = Base64Coder.decodeToString(Caster.toString(encoded), "UTF-8");
}
catch (Exception e) {
throw Caster.toPageException(e);
}
Array arr = ListUtil.listToArray(dec, "" + ONE);
int len = arr.size();
if (len == 3) {
String str = Caster.toString(arr.get(3, ""));
if (str.startsWith("md5:")) {
if (!rolesDir.exists()) rolesDir.mkdirs();
str = str.substring(4);
Resource md5 = rolesDir.getRealResource(str);
try {
str = IOUtil.toString(md5, "utf-8");
}
catch (IOException e) {
str = "";
}
}
return new CredentialImpl(Caster.toString(arr.get(1, "")), Caster.toString(arr.get(2, "")), str, rolesDir);
}
if (len == 2) return new CredentialImpl(Caster.toString(arr.get(1, "")), Caster.toString(arr.get(2, "")), rolesDir);
if (len == 1) return new CredentialImpl(Caster.toString(arr.get(1, "")), rolesDir);
return null;
} | java | public static Credential decode(Object encoded, Resource rolesDir) throws PageException {
String dec;
try {
dec = Base64Coder.decodeToString(Caster.toString(encoded), "UTF-8");
}
catch (Exception e) {
throw Caster.toPageException(e);
}
Array arr = ListUtil.listToArray(dec, "" + ONE);
int len = arr.size();
if (len == 3) {
String str = Caster.toString(arr.get(3, ""));
if (str.startsWith("md5:")) {
if (!rolesDir.exists()) rolesDir.mkdirs();
str = str.substring(4);
Resource md5 = rolesDir.getRealResource(str);
try {
str = IOUtil.toString(md5, "utf-8");
}
catch (IOException e) {
str = "";
}
}
return new CredentialImpl(Caster.toString(arr.get(1, "")), Caster.toString(arr.get(2, "")), str, rolesDir);
}
if (len == 2) return new CredentialImpl(Caster.toString(arr.get(1, "")), Caster.toString(arr.get(2, "")), rolesDir);
if (len == 1) return new CredentialImpl(Caster.toString(arr.get(1, "")), rolesDir);
return null;
} | [
"public",
"static",
"Credential",
"decode",
"(",
"Object",
"encoded",
",",
"Resource",
"rolesDir",
")",
"throws",
"PageException",
"{",
"String",
"dec",
";",
"try",
"{",
"dec",
"=",
"Base64Coder",
".",
"decodeToString",
"(",
"Caster",
".",
"toString",
"(",
"... | decode the Credential form a Base64 String value
@param encoded
@return Credential from decoded string
@throws PageException | [
"decode",
"the",
"Credential",
"form",
"a",
"Base64",
"String",
"value"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/security/CredentialImpl.java#L176-L207 |
30,542 | lucee/Lucee | core/src/main/java/lucee/runtime/coder/Base64Coder.java | Base64Coder.decodeToString | public static String decodeToString(String encoded, String charset) throws CoderException, UnsupportedEncodingException {
byte[] dec = decode(Caster.toString(encoded, null));
return new String(dec, charset);
} | java | public static String decodeToString(String encoded, String charset) throws CoderException, UnsupportedEncodingException {
byte[] dec = decode(Caster.toString(encoded, null));
return new String(dec, charset);
} | [
"public",
"static",
"String",
"decodeToString",
"(",
"String",
"encoded",
",",
"String",
"charset",
")",
"throws",
"CoderException",
",",
"UnsupportedEncodingException",
"{",
"byte",
"[",
"]",
"dec",
"=",
"decode",
"(",
"Caster",
".",
"toString",
"(",
"encoded",... | decodes a Base64 String to a Plain String
@param encoded
@return
@throws ExpressionException | [
"decodes",
"a",
"Base64",
"String",
"to",
"a",
"Plain",
"String"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/coder/Base64Coder.java#L39-L42 |
30,543 | lucee/Lucee | core/src/main/java/lucee/runtime/coder/Base64Coder.java | Base64Coder.encodeFromString | public static String encodeFromString(String plain, String charset) throws CoderException, UnsupportedEncodingException {
return encode(plain.getBytes(charset));
} | java | public static String encodeFromString(String plain, String charset) throws CoderException, UnsupportedEncodingException {
return encode(plain.getBytes(charset));
} | [
"public",
"static",
"String",
"encodeFromString",
"(",
"String",
"plain",
",",
"String",
"charset",
")",
"throws",
"CoderException",
",",
"UnsupportedEncodingException",
"{",
"return",
"encode",
"(",
"plain",
".",
"getBytes",
"(",
"charset",
")",
")",
";",
"}"
] | encodes a String to Base64 String
@param plain String to encode
@return encoded String
@throws CoderException
@throws UnsupportedEncodingException | [
"encodes",
"a",
"String",
"to",
"Base64",
"String"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/coder/Base64Coder.java#L52-L54 |
30,544 | lucee/Lucee | core/src/main/java/lucee/runtime/op/Duplicator.java | Duplicator.duplicate | public static Object duplicate(Object object, boolean deepCopy) {
if (object == null) return null;
if (object instanceof Number) return object;
if (object instanceof String) return object;
if (object instanceof Date) return ((Date) object).clone();
if (object instanceof Boolean) return object;
RefBoolean before = new RefBooleanImpl();
try {
Object copy = ThreadLocalDuplication.get(object, before);
if (copy != null) {
return copy;
}
if (object instanceof Collection) return ((Collection) object).duplicate(deepCopy);
if (object instanceof Duplicable) return ((Duplicable) object).duplicate(deepCopy);
if (object instanceof UDF) return ((UDF) object).duplicate();
if (object instanceof List) return duplicateList((List) object, deepCopy);
if (object instanceof Map) return duplicateMap((Map) object, deepCopy);
if (object instanceof Serializable) {
try {
String ser = JavaConverter.serialize((Serializable) object);
return JavaConverter.deserialize(ser);
}
catch (Throwable t) {
ExceptionUtil.rethrowIfNecessary(t);
}
}
}
finally {
if (!before.toBooleanValue()) ThreadLocalDuplication.reset();
}
return object;
} | java | public static Object duplicate(Object object, boolean deepCopy) {
if (object == null) return null;
if (object instanceof Number) return object;
if (object instanceof String) return object;
if (object instanceof Date) return ((Date) object).clone();
if (object instanceof Boolean) return object;
RefBoolean before = new RefBooleanImpl();
try {
Object copy = ThreadLocalDuplication.get(object, before);
if (copy != null) {
return copy;
}
if (object instanceof Collection) return ((Collection) object).duplicate(deepCopy);
if (object instanceof Duplicable) return ((Duplicable) object).duplicate(deepCopy);
if (object instanceof UDF) return ((UDF) object).duplicate();
if (object instanceof List) return duplicateList((List) object, deepCopy);
if (object instanceof Map) return duplicateMap((Map) object, deepCopy);
if (object instanceof Serializable) {
try {
String ser = JavaConverter.serialize((Serializable) object);
return JavaConverter.deserialize(ser);
}
catch (Throwable t) {
ExceptionUtil.rethrowIfNecessary(t);
}
}
}
finally {
if (!before.toBooleanValue()) ThreadLocalDuplication.reset();
}
return object;
} | [
"public",
"static",
"Object",
"duplicate",
"(",
"Object",
"object",
",",
"boolean",
"deepCopy",
")",
"{",
"if",
"(",
"object",
"==",
"null",
")",
"return",
"null",
";",
"if",
"(",
"object",
"instanceof",
"Number",
")",
"return",
"object",
";",
"if",
"(",... | reference type value duplication
@param object object to duplicate
@return duplicated value | [
"reference",
"type",
"value",
"duplication"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/op/Duplicator.java#L117-L152 |
30,545 | lucee/Lucee | core/src/main/java/lucee/runtime/op/Duplicator.java | Duplicator.duplicateMap | public static Map duplicateMap(Map map, boolean doKeysLower, boolean deepCopy) throws PageException {
if (doKeysLower) {
Map newMap;
try {
newMap = (Map) ClassUtil.loadInstance(map.getClass());
}
catch (ClassException e) {
newMap = new HashMap();
}
boolean inside = ThreadLocalDuplication.set(map, newMap);
try {
Iterator it = map.keySet().iterator();
while (it.hasNext()) {
Object key = it.next();
if (deepCopy) newMap.put(StringUtil.toLowerCase(Caster.toString(key)), duplicate(map.get(key), deepCopy));
else newMap.put(StringUtil.toLowerCase(Caster.toString(key)), map.get(key));
}
}
finally {
if (!inside) ThreadLocalDuplication.reset();
}
//
return newMap;
}
return duplicateMap(map, deepCopy);
} | java | public static Map duplicateMap(Map map, boolean doKeysLower, boolean deepCopy) throws PageException {
if (doKeysLower) {
Map newMap;
try {
newMap = (Map) ClassUtil.loadInstance(map.getClass());
}
catch (ClassException e) {
newMap = new HashMap();
}
boolean inside = ThreadLocalDuplication.set(map, newMap);
try {
Iterator it = map.keySet().iterator();
while (it.hasNext()) {
Object key = it.next();
if (deepCopy) newMap.put(StringUtil.toLowerCase(Caster.toString(key)), duplicate(map.get(key), deepCopy));
else newMap.put(StringUtil.toLowerCase(Caster.toString(key)), map.get(key));
}
}
finally {
if (!inside) ThreadLocalDuplication.reset();
}
//
return newMap;
}
return duplicateMap(map, deepCopy);
} | [
"public",
"static",
"Map",
"duplicateMap",
"(",
"Map",
"map",
",",
"boolean",
"doKeysLower",
",",
"boolean",
"deepCopy",
")",
"throws",
"PageException",
"{",
"if",
"(",
"doKeysLower",
")",
"{",
"Map",
"newMap",
";",
"try",
"{",
"newMap",
"=",
"(",
"Map",
... | duplicate a map
@param map
@param doKeysLower
@return duplicated Map
@throws PageException | [
"duplicate",
"a",
"map"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/op/Duplicator.java#L182-L207 |
30,546 | lucee/Lucee | core/src/main/java/lucee/runtime/tag/Error.java | Error.setType | public void setType(String type) throws ExpressionException {
type = type.toLowerCase().trim();
if (type.equals("exception")) {
errorPage.setType(ErrorPage.TYPE_EXCEPTION);
}
else if (type.equals("request")) {
errorPage.setType(ErrorPage.TYPE_REQUEST);
}
// else if(type.equals("validation")) this.type=VALIDATION;
else throw new ExpressionException("invalid type [" + type + "] for tag error, use one of the following types [exception,request]");
} | java | public void setType(String type) throws ExpressionException {
type = type.toLowerCase().trim();
if (type.equals("exception")) {
errorPage.setType(ErrorPage.TYPE_EXCEPTION);
}
else if (type.equals("request")) {
errorPage.setType(ErrorPage.TYPE_REQUEST);
}
// else if(type.equals("validation")) this.type=VALIDATION;
else throw new ExpressionException("invalid type [" + type + "] for tag error, use one of the following types [exception,request]");
} | [
"public",
"void",
"setType",
"(",
"String",
"type",
")",
"throws",
"ExpressionException",
"{",
"type",
"=",
"type",
".",
"toLowerCase",
"(",
")",
".",
"trim",
"(",
")",
";",
"if",
"(",
"type",
".",
"equals",
"(",
"\"exception\"",
")",
")",
"{",
"errorP... | set the value type The type of error that the custom error page handles.
@param type value to set
@throws ExpressionException | [
"set",
"the",
"value",
"type",
"The",
"type",
"of",
"error",
"that",
"the",
"custom",
"error",
"page",
"handles",
"."
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/tag/Error.java#L65-L75 |
30,547 | lucee/Lucee | core/src/main/java/lucee/runtime/tag/Error.java | Error.setTemplate | public void setTemplate(String template) throws MissingIncludeException {
PageSource ps = pageContext.getCurrentPageSource().getRealPage(template);
if (!ps.exists()) throw new MissingIncludeException(ps);
errorPage.setTemplate(ps);
} | java | public void setTemplate(String template) throws MissingIncludeException {
PageSource ps = pageContext.getCurrentPageSource().getRealPage(template);
if (!ps.exists()) throw new MissingIncludeException(ps);
errorPage.setTemplate(ps);
} | [
"public",
"void",
"setTemplate",
"(",
"String",
"template",
")",
"throws",
"MissingIncludeException",
"{",
"PageSource",
"ps",
"=",
"pageContext",
".",
"getCurrentPageSource",
"(",
")",
".",
"getRealPage",
"(",
"template",
")",
";",
"if",
"(",
"!",
"ps",
".",
... | set the value template The relative path to the custom error page.
@param template value to set
@throws MissingIncludeException | [
"set",
"the",
"value",
"template",
"The",
"relative",
"path",
"to",
"the",
"custom",
"error",
"page",
"."
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/tag/Error.java#L83-L87 |
30,548 | lucee/Lucee | core/src/main/java/lucee/commons/activation/ResourceDataSource.java | ResourceDataSource.getOutputStream | @Override
public OutputStream getOutputStream() throws IOException {
if (!_file.isWriteable()) {
throw new IOException("Cannot write");
}
return IOUtil.toBufferedOutputStream(_file.getOutputStream());
} | java | @Override
public OutputStream getOutputStream() throws IOException {
if (!_file.isWriteable()) {
throw new IOException("Cannot write");
}
return IOUtil.toBufferedOutputStream(_file.getOutputStream());
} | [
"@",
"Override",
"public",
"OutputStream",
"getOutputStream",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"_file",
".",
"isWriteable",
"(",
")",
")",
"{",
"throw",
"new",
"IOException",
"(",
"\"Cannot write\"",
")",
";",
"}",
"return",
"IOUtil",
... | Get output stream.
@returns Output stream
@throws IOException IO exception occurred | [
"Get",
"output",
"stream",
"."
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/activation/ResourceDataSource.java#L96-L102 |
30,549 | lucee/Lucee | core/src/main/java/lucee/transformer/bytecode/statement/StatementBase.java | StatementBase.writeOut | @Override
public final void writeOut(Context c) throws TransformerException {
BytecodeContext bc = (BytecodeContext) c;
ExpressionUtil.visitLine(bc, start);
_writeOut(bc);
ExpressionUtil.visitLine(bc, end);
} | java | @Override
public final void writeOut(Context c) throws TransformerException {
BytecodeContext bc = (BytecodeContext) c;
ExpressionUtil.visitLine(bc, start);
_writeOut(bc);
ExpressionUtil.visitLine(bc, end);
} | [
"@",
"Override",
"public",
"final",
"void",
"writeOut",
"(",
"Context",
"c",
")",
"throws",
"TransformerException",
"{",
"BytecodeContext",
"bc",
"=",
"(",
"BytecodeContext",
")",
"c",
";",
"ExpressionUtil",
".",
"visitLine",
"(",
"bc",
",",
"start",
")",
";... | write out the statement to adapter
@param adapter
@throws TemplateException | [
"write",
"out",
"the",
"statement",
"to",
"adapter"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/bytecode/statement/StatementBase.java#L77-L84 |
30,550 | lucee/Lucee | core/src/main/java/lucee/transformer/util/SourceCode.java | SourceCode.forwardIfCurrent | public boolean forwardIfCurrent(String first, char second) {
int start = pos;
if (!forwardIfCurrent(first)) return false;
removeSpace();
boolean rtn = forwardIfCurrent(second);
if (!rtn) pos = start;
return rtn;
} | java | public boolean forwardIfCurrent(String first, char second) {
int start = pos;
if (!forwardIfCurrent(first)) return false;
removeSpace();
boolean rtn = forwardIfCurrent(second);
if (!rtn) pos = start;
return rtn;
} | [
"public",
"boolean",
"forwardIfCurrent",
"(",
"String",
"first",
",",
"char",
"second",
")",
"{",
"int",
"start",
"=",
"pos",
";",
"if",
"(",
"!",
"forwardIfCurrent",
"(",
"first",
")",
")",
"return",
"false",
";",
"removeSpace",
"(",
")",
";",
"boolean"... | Gibt zurueck ob first den folgenden Zeichen entspricht, gefolgt von Leerzeichen und second, wenn
ja wird der Zeiger um die Laenge der uebereinstimmung nach vorne gestellt.
@param first Erste Zeichen zum Vergleich (Vor den Leerzeichen).
@param second Zweite Zeichen zum Vergleich (Nach den Leerzeichen).
@return Gibt zurueck ob der Zeiger vorwaerts geschoben wurde oder nicht. | [
"Gibt",
"zurueck",
"ob",
"first",
"den",
"folgenden",
"Zeichen",
"entspricht",
"gefolgt",
"von",
"Leerzeichen",
"und",
"second",
"wenn",
"ja",
"wird",
"der",
"Zeiger",
"um",
"die",
"Laenge",
"der",
"uebereinstimmung",
"nach",
"vorne",
"gestellt",
"."
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/util/SourceCode.java#L350-L357 |
30,551 | lucee/Lucee | core/src/main/java/lucee/transformer/util/SourceCode.java | SourceCode.forwardIfCurrent | public boolean forwardIfCurrent(short before, String val, short after) {
int start = pos;
// space before
if (before == AT_LEAST_ONE_SPACE) {
if (!removeSpace()) return false;
}
else removeSpace();
// value
if (!forwardIfCurrent(val)) {
setPos(start);
return false;
}
// space after
if (after == AT_LEAST_ONE_SPACE) {
if (!removeSpace()) {
setPos(start);
return false;
}
}
else removeSpace();
return true;
} | java | public boolean forwardIfCurrent(short before, String val, short after) {
int start = pos;
// space before
if (before == AT_LEAST_ONE_SPACE) {
if (!removeSpace()) return false;
}
else removeSpace();
// value
if (!forwardIfCurrent(val)) {
setPos(start);
return false;
}
// space after
if (after == AT_LEAST_ONE_SPACE) {
if (!removeSpace()) {
setPos(start);
return false;
}
}
else removeSpace();
return true;
} | [
"public",
"boolean",
"forwardIfCurrent",
"(",
"short",
"before",
",",
"String",
"val",
",",
"short",
"after",
")",
"{",
"int",
"start",
"=",
"pos",
";",
"// space before",
"if",
"(",
"before",
"==",
"AT_LEAST_ONE_SPACE",
")",
"{",
"if",
"(",
"!",
"removeSp... | Gibt zurueck ob ein Wert folgt und vor und hinterher Leerzeichen folgen.
@param before Definition der Leerzeichen vorher.
@param val Gefolgter Wert der erartet wird.
@param after Definition der Leerzeichen nach dem Wert.
@return Gibt zurueck ob der Zeiger vorwaerts geschoben wurde oder nicht. | [
"Gibt",
"zurueck",
"ob",
"ein",
"Wert",
"folgt",
"und",
"vor",
"und",
"hinterher",
"Leerzeichen",
"folgen",
"."
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/util/SourceCode.java#L367-L390 |
30,552 | lucee/Lucee | core/src/main/java/lucee/transformer/util/SourceCode.java | SourceCode.subCFMLString | public SourceCode subCFMLString(int start, int count) {
return new SourceCode(String.valueOf(text, start, count), writeLog, dialect);
} | java | public SourceCode subCFMLString(int start, int count) {
return new SourceCode(String.valueOf(text, start, count), writeLog, dialect);
} | [
"public",
"SourceCode",
"subCFMLString",
"(",
"int",
"start",
",",
"int",
"count",
")",
"{",
"return",
"new",
"SourceCode",
"(",
"String",
".",
"valueOf",
"(",
"text",
",",
"start",
",",
"count",
")",
",",
"writeLog",
",",
"dialect",
")",
";",
"}"
] | return a subset of the current SourceCode
@param start start position of the new subset.
@param count length of the new subset.
@return subset of the SourceCode as new SourcCode | [
"return",
"a",
"subset",
"of",
"the",
"current",
"SourceCode"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/util/SourceCode.java#L687-L690 |
30,553 | lucee/Lucee | core/src/main/java/lucee/transformer/util/SourceCode.java | SourceCode.getLine | public int getLine(int pos) {
for (int i = 0; i < lines.length; i++) {
if (pos <= lines[i].intValue()) return i + 1;
}
return lines.length;
} | java | public int getLine(int pos) {
for (int i = 0; i < lines.length; i++) {
if (pos <= lines[i].intValue()) return i + 1;
}
return lines.length;
} | [
"public",
"int",
"getLine",
"(",
"int",
"pos",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"lines",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"pos",
"<=",
"lines",
"[",
"i",
"]",
".",
"intValue",
"(",
")",
")",
"ret... | Gibt zurueck in welcher Zeile die angegebene Position ist.
@param pos Position von welcher die Zeile erfragt wird
@return Zeilennummer | [
"Gibt",
"zurueck",
"in",
"welcher",
"Zeile",
"die",
"angegebene",
"Position",
"ist",
"."
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/util/SourceCode.java#L756-L761 |
30,554 | lucee/Lucee | core/src/main/java/lucee/transformer/util/SourceCode.java | SourceCode.getColumn | public int getColumn(int pos) {
int line = getLine(pos) - 1;
if (line == 0) return pos + 1;
return pos - lines[line - 1].intValue();
} | java | public int getColumn(int pos) {
int line = getLine(pos) - 1;
if (line == 0) return pos + 1;
return pos - lines[line - 1].intValue();
} | [
"public",
"int",
"getColumn",
"(",
"int",
"pos",
")",
"{",
"int",
"line",
"=",
"getLine",
"(",
"pos",
")",
"-",
"1",
";",
"if",
"(",
"line",
"==",
"0",
")",
"return",
"pos",
"+",
"1",
";",
"return",
"pos",
"-",
"lines",
"[",
"line",
"-",
"1",
... | Gibt die Stelle in der Zeile auf die pos zeigt zurueck.
@param pos Position von welcher die Zeile erfragt wird
@return Position innerhalb der Zeile. | [
"Gibt",
"die",
"Stelle",
"in",
"der",
"Zeile",
"auf",
"die",
"pos",
"zeigt",
"zurueck",
"."
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/util/SourceCode.java#L778-L782 |
30,555 | lucee/Lucee | core/src/main/java/lucee/transformer/util/SourceCode.java | SourceCode.getLineAsString | public String getLineAsString(int line) {
int index = line - 1;
if (lines.length <= index) return null;
int max = lines[index].intValue();
int min = 0;
if (index != 0) min = lines[index - 1].intValue() + 1;
if (min < max && max - 1 < lcText.length) return this.substring(min, max - min);
return "";
} | java | public String getLineAsString(int line) {
int index = line - 1;
if (lines.length <= index) return null;
int max = lines[index].intValue();
int min = 0;
if (index != 0) min = lines[index - 1].intValue() + 1;
if (min < max && max - 1 < lcText.length) return this.substring(min, max - min);
return "";
} | [
"public",
"String",
"getLineAsString",
"(",
"int",
"line",
")",
"{",
"int",
"index",
"=",
"line",
"-",
"1",
";",
"if",
"(",
"lines",
".",
"length",
"<=",
"index",
")",
"return",
"null",
";",
"int",
"max",
"=",
"lines",
"[",
"index",
"]",
".",
"intV... | Gibt die angegebene Zeile als String zurueck.
@param line Zeile die zurueck gegeben werden soll
@return Zeile als Zeichenkette | [
"Gibt",
"die",
"angegebene",
"Zeile",
"als",
"String",
"zurueck",
"."
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/util/SourceCode.java#L799-L808 |
30,556 | lucee/Lucee | core/src/main/java/lucee/transformer/util/SourceCode.java | SourceCode.indexOfNext | public int indexOfNext(char c) {
for (int i = pos; i < lcText.length; i++) {
if (lcText[i] == c) return i;
}
return -1;
} | java | public int indexOfNext(char c) {
for (int i = pos; i < lcText.length; i++) {
if (lcText[i] == c) return i;
}
return -1;
} | [
"public",
"int",
"indexOfNext",
"(",
"char",
"c",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"pos",
";",
"i",
"<",
"lcText",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"lcText",
"[",
"i",
"]",
"==",
"c",
")",
"return",
"i",
";",
"}",
"... | Gibt zurueck, ausgehend von der aktuellen Position, wann das naechste Zeichen folgt das gleich
ist wie die Eingabe, falls keines folgt wird -1 zurueck gegeben. Gross- und Kleinschreibung der
Zeichen werden igoriert.
@param c gesuchtes Zeichen
@return Zeichen das gesucht werden soll. | [
"Gibt",
"zurueck",
"ausgehend",
"von",
"der",
"aktuellen",
"Position",
"wann",
"das",
"naechste",
"Zeichen",
"folgt",
"das",
"gleich",
"ist",
"wie",
"die",
"Eingabe",
"falls",
"keines",
"folgt",
"wird",
"-",
"1",
"zurueck",
"gegeben",
".",
"Gross",
"-",
"und... | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/util/SourceCode.java#L845-L850 |
30,557 | lucee/Lucee | core/src/main/java/lucee/transformer/util/SourceCode.java | SourceCode.lastWord | public String lastWord() {
int size = 1;
while (pos - size > 0 && lcText[pos - size] == ' ') {
size++;
}
while (pos - size > 0 && lcText[pos - size] != ' ' && lcText[pos - size] != ';') {
size++;
}
return this.substring((pos - size + 1), (pos - 1));
} | java | public String lastWord() {
int size = 1;
while (pos - size > 0 && lcText[pos - size] == ' ') {
size++;
}
while (pos - size > 0 && lcText[pos - size] != ' ' && lcText[pos - size] != ';') {
size++;
}
return this.substring((pos - size + 1), (pos - 1));
} | [
"public",
"String",
"lastWord",
"(",
")",
"{",
"int",
"size",
"=",
"1",
";",
"while",
"(",
"pos",
"-",
"size",
">",
"0",
"&&",
"lcText",
"[",
"pos",
"-",
"size",
"]",
"==",
"'",
"'",
")",
"{",
"size",
"++",
";",
"}",
"while",
"(",
"pos",
"-",... | Gibt das letzte Wort das sich vor dem aktuellen Zeigerstand befindet zurueck, falls keines
existiert wird null zurueck gegeben.
@return Word vor dem aktuellen Zeigerstand. | [
"Gibt",
"das",
"letzte",
"Wort",
"das",
"sich",
"vor",
"dem",
"aktuellen",
"Zeigerstand",
"befindet",
"zurueck",
"falls",
"keines",
"existiert",
"wird",
"null",
"zurueck",
"gegeben",
"."
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/util/SourceCode.java#L876-L885 |
30,558 | lucee/Lucee | core/src/main/java/lucee/commons/io/log/log4j/appender/ResourceAppender.java | ResourceAppender.closeFile | protected void closeFile() {
if (this.qw != null) {
try {
this.qw.close();
}
catch (java.io.IOException e) {
// Exceptionally, it does not make sense to delegate to an
// ErrorHandler. Since a closed appender is basically dead.
LogLog.error("Could not close " + qw, e);
}
}
} | java | protected void closeFile() {
if (this.qw != null) {
try {
this.qw.close();
}
catch (java.io.IOException e) {
// Exceptionally, it does not make sense to delegate to an
// ErrorHandler. Since a closed appender is basically dead.
LogLog.error("Could not close " + qw, e);
}
}
} | [
"protected",
"void",
"closeFile",
"(",
")",
"{",
"if",
"(",
"this",
".",
"qw",
"!=",
"null",
")",
"{",
"try",
"{",
"this",
".",
"qw",
".",
"close",
"(",
")",
";",
"}",
"catch",
"(",
"java",
".",
"io",
".",
"IOException",
"e",
")",
"{",
"// Exce... | Closes the previously opened file. | [
"Closes",
"the",
"previously",
"opened",
"file",
"."
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/io/log/log4j/appender/ResourceAppender.java#L146-L157 |
30,559 | lucee/Lucee | core/src/main/java/lucee/runtime/db/HSQLDBHandler.java | HSQLDBHandler.removeTable | private static void removeTable(Connection conn, String name) throws SQLException {
name = name.replace('.', '_');
Statement stat = conn.createStatement();
stat.execute("DROP TABLE " + name);
DBUtil.commitEL(conn);
} | java | private static void removeTable(Connection conn, String name) throws SQLException {
name = name.replace('.', '_');
Statement stat = conn.createStatement();
stat.execute("DROP TABLE " + name);
DBUtil.commitEL(conn);
} | [
"private",
"static",
"void",
"removeTable",
"(",
"Connection",
"conn",
",",
"String",
"name",
")",
"throws",
"SQLException",
"{",
"name",
"=",
"name",
".",
"replace",
"(",
"'",
"'",
",",
"'",
"'",
")",
";",
"Statement",
"stat",
"=",
"conn",
".",
"creat... | remove a table from the memory database
@param conn
@param name
@throws DatabaseException | [
"remove",
"a",
"table",
"from",
"the",
"memory",
"database"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/db/HSQLDBHandler.java#L200-L205 |
30,560 | lucee/Lucee | core/src/main/java/lucee/runtime/db/HSQLDBHandler.java | HSQLDBHandler.removeAll | private static void removeAll(Connection conn, ArrayList<String> usedTables) {
int len = usedTables.size();
for (int i = 0; i < len; i++) {
String tableName = usedTables.get(i).toString();
// print.out("remove:"+tableName);
try {
removeTable(conn, tableName);
}
catch (Throwable t) {
ExceptionUtil.rethrowIfNecessary(t);
}
}
} | java | private static void removeAll(Connection conn, ArrayList<String> usedTables) {
int len = usedTables.size();
for (int i = 0; i < len; i++) {
String tableName = usedTables.get(i).toString();
// print.out("remove:"+tableName);
try {
removeTable(conn, tableName);
}
catch (Throwable t) {
ExceptionUtil.rethrowIfNecessary(t);
}
}
} | [
"private",
"static",
"void",
"removeAll",
"(",
"Connection",
"conn",
",",
"ArrayList",
"<",
"String",
">",
"usedTables",
")",
"{",
"int",
"len",
"=",
"usedTables",
".",
"size",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"len",
... | remove all table inside the memory database
@param conn | [
"remove",
"all",
"table",
"inside",
"the",
"memory",
"database"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/db/HSQLDBHandler.java#L212-L226 |
30,561 | lucee/Lucee | core/src/main/java/lucee/runtime/db/HSQLDBHandler.java | HSQLDBHandler.execute | public Query execute(PageContext pc, SQL sql, int maxrows, int fetchsize, TimeSpan timeout) throws PageException {
Stopwatch stopwatch = new Stopwatch(Stopwatch.UNIT_NANO);
stopwatch.start();
String prettySQL = null;
Selects selects = null;
// First Chance
try {
SelectParser parser = new SelectParser();
selects = parser.parse(sql.getSQLString());
Query q = qoq.execute(pc, sql, selects, maxrows);
q.setExecutionTime(stopwatch.time());
return q;
}
catch (SQLParserException spe) {
// lucee.print.printST(spe);
// sp
// lucee.print.out("sql parser crash at:");
// lucee.print.out("--------------------------------");
// lucee.print.out(sql.getSQLString().trim());
// lucee.print.out("--------------------------------");
// print.e("1:"+sql.getSQLString());
prettySQL = SQLPrettyfier.prettyfie(sql.getSQLString());
// print.e("2:"+prettySQL);
try {
Query query = executer.execute(pc, sql, prettySQL, maxrows);
query.setExecutionTime(stopwatch.time());
return query;
}
catch (PageException ex) {
// lucee.print.printST(ex);
// lucee.print.out("old executor/zql crash at:");
// lucee.print.out("--------------------------------");
// lucee.print.out(sql.getSQLString().trim());
// lucee.print.out("--------------------------------");
}
}
catch (PageException e) {
// throw e;
// print.out("new executor crash at:");
// print.out("--------------------------------");
// print.out(sql.getSQLString().trim());
// print.out("--------------------------------");
}
// if(true) throw new RuntimeException();
// SECOND Chance with hsqldb
try {
boolean isUnion = false;
Set<String> tables = null;
if (selects != null) {
HSQLUtil2 hsql2 = new HSQLUtil2(selects);
isUnion = hsql2.isUnion();
tables = hsql2.getInvokedTables();
}
else {
if (prettySQL == null) prettySQL = SQLPrettyfier.prettyfie(sql.getSQLString());
HSQLUtil hsql = new HSQLUtil(prettySQL);
tables = hsql.getInvokedTables();
isUnion = hsql.isUnion();
}
String strSQL = StringUtil.replace(sql.getSQLString(), "[", "", false);
strSQL = StringUtil.replace(strSQL, "]", "", false);
sql.setSQLString(strSQL);
return _execute(pc, sql, maxrows, fetchsize, timeout, stopwatch, tables, isUnion);
}
catch (ParseException e) {
throw new DatabaseException(e.getMessage(), null, sql, null);
}
} | java | public Query execute(PageContext pc, SQL sql, int maxrows, int fetchsize, TimeSpan timeout) throws PageException {
Stopwatch stopwatch = new Stopwatch(Stopwatch.UNIT_NANO);
stopwatch.start();
String prettySQL = null;
Selects selects = null;
// First Chance
try {
SelectParser parser = new SelectParser();
selects = parser.parse(sql.getSQLString());
Query q = qoq.execute(pc, sql, selects, maxrows);
q.setExecutionTime(stopwatch.time());
return q;
}
catch (SQLParserException spe) {
// lucee.print.printST(spe);
// sp
// lucee.print.out("sql parser crash at:");
// lucee.print.out("--------------------------------");
// lucee.print.out(sql.getSQLString().trim());
// lucee.print.out("--------------------------------");
// print.e("1:"+sql.getSQLString());
prettySQL = SQLPrettyfier.prettyfie(sql.getSQLString());
// print.e("2:"+prettySQL);
try {
Query query = executer.execute(pc, sql, prettySQL, maxrows);
query.setExecutionTime(stopwatch.time());
return query;
}
catch (PageException ex) {
// lucee.print.printST(ex);
// lucee.print.out("old executor/zql crash at:");
// lucee.print.out("--------------------------------");
// lucee.print.out(sql.getSQLString().trim());
// lucee.print.out("--------------------------------");
}
}
catch (PageException e) {
// throw e;
// print.out("new executor crash at:");
// print.out("--------------------------------");
// print.out(sql.getSQLString().trim());
// print.out("--------------------------------");
}
// if(true) throw new RuntimeException();
// SECOND Chance with hsqldb
try {
boolean isUnion = false;
Set<String> tables = null;
if (selects != null) {
HSQLUtil2 hsql2 = new HSQLUtil2(selects);
isUnion = hsql2.isUnion();
tables = hsql2.getInvokedTables();
}
else {
if (prettySQL == null) prettySQL = SQLPrettyfier.prettyfie(sql.getSQLString());
HSQLUtil hsql = new HSQLUtil(prettySQL);
tables = hsql.getInvokedTables();
isUnion = hsql.isUnion();
}
String strSQL = StringUtil.replace(sql.getSQLString(), "[", "", false);
strSQL = StringUtil.replace(strSQL, "]", "", false);
sql.setSQLString(strSQL);
return _execute(pc, sql, maxrows, fetchsize, timeout, stopwatch, tables, isUnion);
}
catch (ParseException e) {
throw new DatabaseException(e.getMessage(), null, sql, null);
}
} | [
"public",
"Query",
"execute",
"(",
"PageContext",
"pc",
",",
"SQL",
"sql",
",",
"int",
"maxrows",
",",
"int",
"fetchsize",
",",
"TimeSpan",
"timeout",
")",
"throws",
"PageException",
"{",
"Stopwatch",
"stopwatch",
"=",
"new",
"Stopwatch",
"(",
"Stopwatch",
"... | executes a query on the queries inside the cld fusion enviroment
@param pc Page Context
@param sql
@param maxrows
@return result as Query
@throws PageException
@throws PageException | [
"executes",
"a",
"query",
"on",
"the",
"queries",
"inside",
"the",
"cld",
"fusion",
"enviroment"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/db/HSQLDBHandler.java#L238-L314 |
30,562 | lucee/Lucee | core/src/main/java/lucee/commons/collection/HashMapPro.java | HashMapPro.getEntry | final Entry<K, V> getEntry(Object key) {
int hash = (key == null) ? 0 : hash(key);
for (Entry<K, V> e = table[indexFor(hash, table.length)]; e != null; e = e.next) {
if (e.hash == hash && ((e.key) == key || (key != null && key.equals(e.key)))) return e;
}
return null;
} | java | final Entry<K, V> getEntry(Object key) {
int hash = (key == null) ? 0 : hash(key);
for (Entry<K, V> e = table[indexFor(hash, table.length)]; e != null; e = e.next) {
if (e.hash == hash && ((e.key) == key || (key != null && key.equals(e.key)))) return e;
}
return null;
} | [
"final",
"Entry",
"<",
"K",
",",
"V",
">",
"getEntry",
"(",
"Object",
"key",
")",
"{",
"int",
"hash",
"=",
"(",
"key",
"==",
"null",
")",
"?",
"0",
":",
"hash",
"(",
"key",
")",
";",
"for",
"(",
"Entry",
"<",
"K",
",",
"V",
">",
"e",
"=",
... | Returns the entry associated with the specified key in the HashMap. Returns null if the HashMap
contains no mapping for the key. | [
"Returns",
"the",
"entry",
"associated",
"with",
"the",
"specified",
"key",
"in",
"the",
"HashMap",
".",
"Returns",
"null",
"if",
"the",
"HashMap",
"contains",
"no",
"mapping",
"for",
"the",
"key",
"."
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/collection/HashMapPro.java#L442-L448 |
30,563 | lucee/Lucee | core/src/main/java/lucee/commons/collection/HashMapPro.java | HashMapPro.putForNullKey | private V putForNullKey(V value) {
for (Entry<K, V> e = table[0]; e != null; e = e.next) {
if (e.key == null) {
V oldValue = e.value;
e.value = value;
e.recordAccess(this);
return oldValue;
}
}
modCount++;
addEntry(0, null, value, 0);
return null;
} | java | private V putForNullKey(V value) {
for (Entry<K, V> e = table[0]; e != null; e = e.next) {
if (e.key == null) {
V oldValue = e.value;
e.value = value;
e.recordAccess(this);
return oldValue;
}
}
modCount++;
addEntry(0, null, value, 0);
return null;
} | [
"private",
"V",
"putForNullKey",
"(",
"V",
"value",
")",
"{",
"for",
"(",
"Entry",
"<",
"K",
",",
"V",
">",
"e",
"=",
"table",
"[",
"0",
"]",
";",
"e",
"!=",
"null",
";",
"e",
"=",
"e",
".",
"next",
")",
"{",
"if",
"(",
"e",
".",
"key",
"... | Offloaded version of put for null keys | [
"Offloaded",
"version",
"of",
"put",
"for",
"null",
"keys"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/collection/HashMapPro.java#L483-L495 |
30,564 | lucee/Lucee | core/src/main/java/lucee/runtime/type/scope/storage/StorageScopeFile.java | StorageScopeFile.getFolderName | public static String getFolderName(String name, String cfid, boolean addExtension) {
if (addExtension) return getFolderName(name, cfid, false) + ".scpt";
if (!StringUtil.isEmpty(name)) name = encode(name);// StringUtil.toVariableName(StringUtil.toLowerCase(name));
else name = "__empty__";
return name + "/" + cfid.substring(0, 2) + "/" + cfid.substring(2);
} | java | public static String getFolderName(String name, String cfid, boolean addExtension) {
if (addExtension) return getFolderName(name, cfid, false) + ".scpt";
if (!StringUtil.isEmpty(name)) name = encode(name);// StringUtil.toVariableName(StringUtil.toLowerCase(name));
else name = "__empty__";
return name + "/" + cfid.substring(0, 2) + "/" + cfid.substring(2);
} | [
"public",
"static",
"String",
"getFolderName",
"(",
"String",
"name",
",",
"String",
"cfid",
",",
"boolean",
"addExtension",
")",
"{",
"if",
"(",
"addExtension",
")",
"return",
"getFolderName",
"(",
"name",
",",
"cfid",
",",
"false",
")",
"+",
"\".scpt\"",
... | return a folder name that match given input
@param name
@param cfid
@param addExtension
@return | [
"return",
"a",
"folder",
"name",
"that",
"match",
"given",
"input"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/scope/storage/StorageScopeFile.java#L164-L169 |
30,565 | lucee/Lucee | core/src/main/java/lucee/runtime/type/sql/ClobImpl.java | ClobImpl.toClob | public static Clob toClob(Object value) throws PageException {
if (value instanceof Clob) return (Clob) value;
else if (value instanceof char[]) return toClob(new String((char[]) value));
else if (value instanceof Reader) {
StringWriter sw = new StringWriter();
try {
IOUtil.copy((Reader) value, sw, false, true);
}
catch (IOException e) {
throw ExpressionException.newInstance(e);
}
return toClob(sw.toString());
}
return toClob(Caster.toString(value));
} | java | public static Clob toClob(Object value) throws PageException {
if (value instanceof Clob) return (Clob) value;
else if (value instanceof char[]) return toClob(new String((char[]) value));
else if (value instanceof Reader) {
StringWriter sw = new StringWriter();
try {
IOUtil.copy((Reader) value, sw, false, true);
}
catch (IOException e) {
throw ExpressionException.newInstance(e);
}
return toClob(sw.toString());
}
return toClob(Caster.toString(value));
} | [
"public",
"static",
"Clob",
"toClob",
"(",
"Object",
"value",
")",
"throws",
"PageException",
"{",
"if",
"(",
"value",
"instanceof",
"Clob",
")",
"return",
"(",
"Clob",
")",
"value",
";",
"else",
"if",
"(",
"value",
"instanceof",
"char",
"[",
"]",
")",
... | cast given value to a clob
@param value
@return clob
@throws PageException | [
"cast",
"given",
"value",
"to",
"a",
"clob"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/sql/ClobImpl.java#L65-L79 |
30,566 | lucee/Lucee | core/src/main/java/lucee/runtime/crypt/UnixCrypt.java | UnixCrypt.crypt | public static final String crypt(String original) {
java.util.Random randomGenerator = new java.util.Random();
int numSaltChars = saltChars.length;
String salt;
salt = (new StringBuffer()).append(saltChars[Math.abs(randomGenerator.nextInt()) % numSaltChars]).append(saltChars[Math.abs(randomGenerator.nextInt()) % numSaltChars])
.toString();
return crypt(salt, original);
} | java | public static final String crypt(String original) {
java.util.Random randomGenerator = new java.util.Random();
int numSaltChars = saltChars.length;
String salt;
salt = (new StringBuffer()).append(saltChars[Math.abs(randomGenerator.nextInt()) % numSaltChars]).append(saltChars[Math.abs(randomGenerator.nextInt()) % numSaltChars])
.toString();
return crypt(salt, original);
} | [
"public",
"static",
"final",
"String",
"crypt",
"(",
"String",
"original",
")",
"{",
"java",
".",
"util",
".",
"Random",
"randomGenerator",
"=",
"new",
"java",
".",
"util",
".",
"Random",
"(",
")",
";",
"int",
"numSaltChars",
"=",
"saltChars",
".",
"leng... | Encrypt a password given the cleartext password. This method generates a random salt using the
'java.util.Random' class.
@param original The password to be encrypted.
@return A string consisting of the 2-character salt followed by the encrypted password. | [
"Encrypt",
"a",
"password",
"given",
"the",
"cleartext",
"password",
".",
"This",
"method",
"generates",
"a",
"random",
"salt",
"using",
"the",
"java",
".",
"util",
".",
"Random",
"class",
"."
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/crypt/UnixCrypt.java#L314-L321 |
30,567 | lucee/Lucee | core/src/main/java/lucee/commons/io/ini/IniFile.java | IniFile.setKeyValue | public void setKeyValue(String strSection, String key, String value) {
Map section = getSectionEL(strSection);
if (section == null) {
section = newMap();
sections.put(strSection.toLowerCase(), section);
}
section.put(key.toLowerCase(), value);
} | java | public void setKeyValue(String strSection, String key, String value) {
Map section = getSectionEL(strSection);
if (section == null) {
section = newMap();
sections.put(strSection.toLowerCase(), section);
}
section.put(key.toLowerCase(), value);
} | [
"public",
"void",
"setKeyValue",
"(",
"String",
"strSection",
",",
"String",
"key",
",",
"String",
"value",
")",
"{",
"Map",
"section",
"=",
"getSectionEL",
"(",
"strSection",
")",
";",
"if",
"(",
"section",
"==",
"null",
")",
"{",
"section",
"=",
"newMa... | Sets the KeyValue attribute of the IniFile object
@param strSection the section to set
@param key the key of the new value
@param value the value to set | [
"Sets",
"the",
"KeyValue",
"attribute",
"of",
"the",
"IniFile",
"object"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/io/ini/IniFile.java#L80-L87 |
30,568 | lucee/Lucee | core/src/main/java/lucee/commons/io/ini/IniFile.java | IniFile.getSection | public Map getSection(String strSection) throws IOException {
Object o = sections.get(strSection.toLowerCase());
if (o == null) throw new IOException("section with name " + strSection + " does not exist");
return (Map) o;
} | java | public Map getSection(String strSection) throws IOException {
Object o = sections.get(strSection.toLowerCase());
if (o == null) throw new IOException("section with name " + strSection + " does not exist");
return (Map) o;
} | [
"public",
"Map",
"getSection",
"(",
"String",
"strSection",
")",
"throws",
"IOException",
"{",
"Object",
"o",
"=",
"sections",
".",
"get",
"(",
"strSection",
".",
"toLowerCase",
"(",
")",
")",
";",
"if",
"(",
"o",
"==",
"null",
")",
"throw",
"new",
"IO... | Gets the Section attribute of the IniFile object
@param strSection section name to get
@return The Section value
@throws IOException | [
"Gets",
"the",
"Section",
"attribute",
"of",
"the",
"IniFile",
"object"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/io/ini/IniFile.java#L105-L109 |
30,569 | lucee/Lucee | core/src/main/java/lucee/commons/io/ini/IniFile.java | IniFile.getSectionEL | public Map getSectionEL(String strSection) {
Object o = sections.get(strSection.toLowerCase());
if (o == null) return null;
return (Map) o;
} | java | public Map getSectionEL(String strSection) {
Object o = sections.get(strSection.toLowerCase());
if (o == null) return null;
return (Map) o;
} | [
"public",
"Map",
"getSectionEL",
"(",
"String",
"strSection",
")",
"{",
"Object",
"o",
"=",
"sections",
".",
"get",
"(",
"strSection",
".",
"toLowerCase",
"(",
")",
")",
";",
"if",
"(",
"o",
"==",
"null",
")",
"return",
"null",
";",
"return",
"(",
"M... | Gets the Section attribute of the IniFile object, return null if section not exist
@param strSection section name to get
@return The Section value | [
"Gets",
"the",
"Section",
"attribute",
"of",
"the",
"IniFile",
"object",
"return",
"null",
"if",
"section",
"not",
"exist"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/io/ini/IniFile.java#L117-L121 |
30,570 | lucee/Lucee | core/src/main/java/lucee/commons/io/ini/IniFile.java | IniFile.isNullOrEmpty | public boolean isNullOrEmpty(String section, String key) {
String value = getKeyValueEL(section, key);
return (value == null || value.length() == 0);
} | java | public boolean isNullOrEmpty(String section, String key) {
String value = getKeyValueEL(section, key);
return (value == null || value.length() == 0);
} | [
"public",
"boolean",
"isNullOrEmpty",
"(",
"String",
"section",
",",
"String",
"key",
")",
"{",
"String",
"value",
"=",
"getKeyValueEL",
"(",
"section",
",",
"key",
")",
";",
"return",
"(",
"value",
"==",
"null",
"||",
"value",
".",
"length",
"(",
")",
... | Gets the NullOrEmpty attribute of the IniFile object
@param section section to check
@param key key to check
@return is empty or not | [
"Gets",
"the",
"NullOrEmpty",
"attribute",
"of",
"the",
"IniFile",
"object"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/io/ini/IniFile.java#L130-L133 |
30,571 | lucee/Lucee | core/src/main/java/lucee/commons/io/ini/IniFile.java | IniFile.getKeyValue | public String getKeyValue(String strSection, String key) throws IOException {
Object o = getSection(strSection).get(key.toLowerCase());
if (o == null) throw new IOException("key " + key + " doesn't exist in section " + strSection);
return (String) o;
} | java | public String getKeyValue(String strSection, String key) throws IOException {
Object o = getSection(strSection).get(key.toLowerCase());
if (o == null) throw new IOException("key " + key + " doesn't exist in section " + strSection);
return (String) o;
} | [
"public",
"String",
"getKeyValue",
"(",
"String",
"strSection",
",",
"String",
"key",
")",
"throws",
"IOException",
"{",
"Object",
"o",
"=",
"getSection",
"(",
"strSection",
")",
".",
"get",
"(",
"key",
".",
"toLowerCase",
"(",
")",
")",
";",
"if",
"(",
... | Gets the KeyValue attribute of the IniFile object
@param strSection section to get
@param key key to get
@return matching alue
@throws IOException | [
"Gets",
"the",
"KeyValue",
"attribute",
"of",
"the",
"IniFile",
"object"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/io/ini/IniFile.java#L143-L148 |
30,572 | lucee/Lucee | core/src/main/java/lucee/commons/io/ini/IniFile.java | IniFile.getKeyValueEL | public String getKeyValueEL(String strSection, String key) {
Map map = getSectionEL(strSection);
if (map == null) return null;
Object o = map.get(key.toLowerCase());
if (o == null) return null;
return (String) o;
} | java | public String getKeyValueEL(String strSection, String key) {
Map map = getSectionEL(strSection);
if (map == null) return null;
Object o = map.get(key.toLowerCase());
if (o == null) return null;
return (String) o;
} | [
"public",
"String",
"getKeyValueEL",
"(",
"String",
"strSection",
",",
"String",
"key",
")",
"{",
"Map",
"map",
"=",
"getSectionEL",
"(",
"strSection",
")",
";",
"if",
"(",
"map",
"==",
"null",
")",
"return",
"null",
";",
"Object",
"o",
"=",
"map",
"."... | Gets the KeyValue attribute of the IniFile object, if not exist return null
@param strSection section to get
@param key key to get
@return matching alue | [
"Gets",
"the",
"KeyValue",
"attribute",
"of",
"the",
"IniFile",
"object",
"if",
"not",
"exist",
"return",
"null"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/io/ini/IniFile.java#L157-L164 |
30,573 | lucee/Lucee | core/src/main/java/lucee/commons/io/ini/IniFile.java | IniFile.load | public void load(InputStream in) throws IOException {
BufferedReader input = IOUtil.toBufferedReader(new InputStreamReader(in));
String read;
Map section = null;
String sectionName;
while ((read = input.readLine()) != null) {
if (read.startsWith(";") || read.startsWith("#")) {
continue;
}
else if (read.startsWith("[")) {
// new section
sectionName = read.substring(1, read.indexOf("]")).trim().toLowerCase();
section = getSectionEL(sectionName);
if (section == null) {
section = newMap();
sections.put(sectionName, section);
}
}
else if (read.indexOf("=") != -1 && section != null) {
// new key
String key = read.substring(0, read.indexOf("=")).trim().toLowerCase();
String value = read.substring(read.indexOf("=") + 1).trim();
section.put(key, value);
}
}
} | java | public void load(InputStream in) throws IOException {
BufferedReader input = IOUtil.toBufferedReader(new InputStreamReader(in));
String read;
Map section = null;
String sectionName;
while ((read = input.readLine()) != null) {
if (read.startsWith(";") || read.startsWith("#")) {
continue;
}
else if (read.startsWith("[")) {
// new section
sectionName = read.substring(1, read.indexOf("]")).trim().toLowerCase();
section = getSectionEL(sectionName);
if (section == null) {
section = newMap();
sections.put(sectionName, section);
}
}
else if (read.indexOf("=") != -1 && section != null) {
// new key
String key = read.substring(0, read.indexOf("=")).trim().toLowerCase();
String value = read.substring(read.indexOf("=") + 1).trim();
section.put(key, value);
}
}
} | [
"public",
"void",
"load",
"(",
"InputStream",
"in",
")",
"throws",
"IOException",
"{",
"BufferedReader",
"input",
"=",
"IOUtil",
".",
"toBufferedReader",
"(",
"new",
"InputStreamReader",
"(",
"in",
")",
")",
";",
"String",
"read",
";",
"Map",
"section",
"=",... | loads the ini file
@param in inputstream to read
@throws IOException | [
"loads",
"the",
"ini",
"file"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/io/ini/IniFile.java#L172-L199 |
30,574 | lucee/Lucee | core/src/main/java/lucee/commons/io/ini/IniFile.java | IniFile.save | public void save() throws IOException {
if (!file.exists()) file.createFile(true);
OutputStream out = IOUtil.toBufferedOutputStream(file.getOutputStream());
Iterator it = sections.keySet().iterator();
PrintWriter output = new PrintWriter(out);
try {
while (it.hasNext()) {
String strSection = (String) it.next();
output.println("[" + strSection + "]");
Map section = getSectionEL(strSection);
Iterator iit = section.keySet().iterator();
while (iit.hasNext()) {
String key = (String) iit.next();
output.println(key + "=" + section.get(key));
}
}
}
finally {
IOUtil.flushEL(output);
IOUtil.closeEL(output);
IOUtil.flushEL(out);
IOUtil.closeEL(out);
}
} | java | public void save() throws IOException {
if (!file.exists()) file.createFile(true);
OutputStream out = IOUtil.toBufferedOutputStream(file.getOutputStream());
Iterator it = sections.keySet().iterator();
PrintWriter output = new PrintWriter(out);
try {
while (it.hasNext()) {
String strSection = (String) it.next();
output.println("[" + strSection + "]");
Map section = getSectionEL(strSection);
Iterator iit = section.keySet().iterator();
while (iit.hasNext()) {
String key = (String) iit.next();
output.println(key + "=" + section.get(key));
}
}
}
finally {
IOUtil.flushEL(output);
IOUtil.closeEL(output);
IOUtil.flushEL(out);
IOUtil.closeEL(out);
}
} | [
"public",
"void",
"save",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"file",
".",
"exists",
"(",
")",
")",
"file",
".",
"createFile",
"(",
"true",
")",
";",
"OutputStream",
"out",
"=",
"IOUtil",
".",
"toBufferedOutputStream",
"(",
"file",
... | save back content to ini file
@throws IOException | [
"save",
"back",
"content",
"to",
"ini",
"file"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/io/ini/IniFile.java#L206-L229 |
30,575 | lucee/Lucee | core/src/main/java/lucee/transformer/cfml/script/AbstrCFMLScriptTransformer.java | AbstrCFMLScriptTransformer.switchStatement | private final Switch switchStatement(Data data) throws TemplateException {
if (!data.srcCode.forwardIfCurrent("switch", '(')) return null;
Position line = data.srcCode.getPosition();
comments(data);
Expression expr = super.expression(data);
comments(data);
// end )
if (!data.srcCode.forwardIfCurrent(')')) throw new TemplateException(data.srcCode, "switch statement must end with a [)]");
comments(data);
if (!data.srcCode.forwardIfCurrent('{')) throw new TemplateException(data.srcCode, "switch statement must have a starting [{]");
Switch swit = new Switch(expr, line, null);
// cases
// Node child=null;
comments(data);
while (caseStatement(data, swit)) {
comments(data);
}
// default
if (defaultStatement(data, swit)) {
comments(data);
}
while (caseStatement(data, swit)) {
comments(data);
}
// }
if (!data.srcCode.forwardIfCurrent('}')) throw new TemplateException(data.srcCode, "invalid construct in switch statement");
swit.setEnd(data.srcCode.getPosition());
return swit;
} | java | private final Switch switchStatement(Data data) throws TemplateException {
if (!data.srcCode.forwardIfCurrent("switch", '(')) return null;
Position line = data.srcCode.getPosition();
comments(data);
Expression expr = super.expression(data);
comments(data);
// end )
if (!data.srcCode.forwardIfCurrent(')')) throw new TemplateException(data.srcCode, "switch statement must end with a [)]");
comments(data);
if (!data.srcCode.forwardIfCurrent('{')) throw new TemplateException(data.srcCode, "switch statement must have a starting [{]");
Switch swit = new Switch(expr, line, null);
// cases
// Node child=null;
comments(data);
while (caseStatement(data, swit)) {
comments(data);
}
// default
if (defaultStatement(data, swit)) {
comments(data);
}
while (caseStatement(data, swit)) {
comments(data);
}
// }
if (!data.srcCode.forwardIfCurrent('}')) throw new TemplateException(data.srcCode, "invalid construct in switch statement");
swit.setEnd(data.srcCode.getPosition());
return swit;
} | [
"private",
"final",
"Switch",
"switchStatement",
"(",
"Data",
"data",
")",
"throws",
"TemplateException",
"{",
"if",
"(",
"!",
"data",
".",
"srcCode",
".",
"forwardIfCurrent",
"(",
"\"switch\"",
",",
"'",
"'",
")",
")",
"return",
"null",
";",
"Position",
"... | Liest ein switch Statment ein
@return switch Statement
@throws TemplateException | [
"Liest",
"ein",
"switch",
"Statment",
"ein"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/cfml/script/AbstrCFMLScriptTransformer.java#L416-L451 |
30,576 | lucee/Lucee | core/src/main/java/lucee/transformer/cfml/script/AbstrCFMLScriptTransformer.java | AbstrCFMLScriptTransformer.caseStatement | private final boolean caseStatement(Data data, Switch swit) throws TemplateException {
if (!data.srcCode.forwardIfCurrentAndNoWordAfter("case")) return false;
// int line=data.srcCode.getLine();
comments(data);
Expression expr = super.expression(data);
comments(data);
if (!data.srcCode.forwardIfCurrent(':')) throw new TemplateException(data.srcCode, "case body must start with [:]");
Body body = new BodyBase(data.factory);
switchBlock(data, body);
swit.addCase(expr, body);
return true;
} | java | private final boolean caseStatement(Data data, Switch swit) throws TemplateException {
if (!data.srcCode.forwardIfCurrentAndNoWordAfter("case")) return false;
// int line=data.srcCode.getLine();
comments(data);
Expression expr = super.expression(data);
comments(data);
if (!data.srcCode.forwardIfCurrent(':')) throw new TemplateException(data.srcCode, "case body must start with [:]");
Body body = new BodyBase(data.factory);
switchBlock(data, body);
swit.addCase(expr, body);
return true;
} | [
"private",
"final",
"boolean",
"caseStatement",
"(",
"Data",
"data",
",",
"Switch",
"swit",
")",
"throws",
"TemplateException",
"{",
"if",
"(",
"!",
"data",
".",
"srcCode",
".",
"forwardIfCurrentAndNoWordAfter",
"(",
"\"case\"",
")",
")",
"return",
"false",
";... | Liest ein Case Statement ein
@return case Statement
@throws TemplateException | [
"Liest",
"ein",
"Case",
"Statement",
"ein"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/cfml/script/AbstrCFMLScriptTransformer.java#L495-L509 |
30,577 | lucee/Lucee | core/src/main/java/lucee/transformer/cfml/script/AbstrCFMLScriptTransformer.java | AbstrCFMLScriptTransformer.defaultStatement | private final boolean defaultStatement(Data data, Switch swit) throws TemplateException {
if (!data.srcCode.forwardIfCurrent("default", ':')) return false;
// int line=data.srcCode.getLine();
Body body = new BodyBase(data.factory);
swit.setDefaultCase(body);
switchBlock(data, body);
return true;
} | java | private final boolean defaultStatement(Data data, Switch swit) throws TemplateException {
if (!data.srcCode.forwardIfCurrent("default", ':')) return false;
// int line=data.srcCode.getLine();
Body body = new BodyBase(data.factory);
swit.setDefaultCase(body);
switchBlock(data, body);
return true;
} | [
"private",
"final",
"boolean",
"defaultStatement",
"(",
"Data",
"data",
",",
"Switch",
"swit",
")",
"throws",
"TemplateException",
"{",
"if",
"(",
"!",
"data",
".",
"srcCode",
".",
"forwardIfCurrent",
"(",
"\"default\"",
",",
"'",
"'",
")",
")",
"return",
... | Liest ein default Statement ein
@return default Statement
@throws TemplateException | [
"Liest",
"ein",
"default",
"Statement",
"ein"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/cfml/script/AbstrCFMLScriptTransformer.java#L517-L526 |
30,578 | lucee/Lucee | core/src/main/java/lucee/transformer/cfml/script/AbstrCFMLScriptTransformer.java | AbstrCFMLScriptTransformer.switchBlock | private final void switchBlock(Data data, Body body) throws TemplateException {
while (data.srcCode.isValidIndex()) {
comments(data);
if (data.srcCode.isCurrent("case ") || data.srcCode.isCurrent("default", ':') || data.srcCode.isCurrent('}')) return;
Body prior = data.setParent(body);
statement(data, body, CTX_SWITCH);
data.setParent(prior);
}
} | java | private final void switchBlock(Data data, Body body) throws TemplateException {
while (data.srcCode.isValidIndex()) {
comments(data);
if (data.srcCode.isCurrent("case ") || data.srcCode.isCurrent("default", ':') || data.srcCode.isCurrent('}')) return;
Body prior = data.setParent(body);
statement(data, body, CTX_SWITCH);
data.setParent(prior);
}
} | [
"private",
"final",
"void",
"switchBlock",
"(",
"Data",
"data",
",",
"Body",
"body",
")",
"throws",
"TemplateException",
"{",
"while",
"(",
"data",
".",
"srcCode",
".",
"isValidIndex",
"(",
")",
")",
"{",
"comments",
"(",
"data",
")",
";",
"if",
"(",
"... | Liest ein Switch Block ein
@param block
@throws TemplateException | [
"Liest",
"ein",
"Switch",
"Block",
"ein"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/cfml/script/AbstrCFMLScriptTransformer.java#L534-L543 |
30,579 | lucee/Lucee | core/src/main/java/lucee/transformer/cfml/script/AbstrCFMLScriptTransformer.java | AbstrCFMLScriptTransformer.isFinish | private final boolean isFinish(Data data) throws TemplateException {
comments(data);
if (data.tagName == null) return false;
return data.srcCode.isCurrent("</", data.tagName);
} | java | private final boolean isFinish(Data data) throws TemplateException {
comments(data);
if (data.tagName == null) return false;
return data.srcCode.isCurrent("</", data.tagName);
} | [
"private",
"final",
"boolean",
"isFinish",
"(",
"Data",
"data",
")",
"throws",
"TemplateException",
"{",
"comments",
"(",
"data",
")",
";",
"if",
"(",
"data",
".",
"tagName",
"==",
"null",
")",
"return",
"false",
";",
"return",
"data",
".",
"srcCode",
".... | Prueft ob sich der Zeiger am Ende eines Script Blockes befindet
@return Ende ScriptBlock?
@throws TemplateException | [
"Prueft",
"ob",
"sich",
"der",
"Zeiger",
"am",
"Ende",
"eines",
"Script",
"Blockes",
"befindet"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/cfml/script/AbstrCFMLScriptTransformer.java#L2177-L2181 |
30,580 | lucee/Lucee | core/src/main/java/lucee/commons/lang/HTMLUtil.java | HTMLUtil.getURLS | public List<URL> getURLS(String html, URL url) {
List<URL> urls = new ArrayList<URL>();
SourceCode cfml = new SourceCode(html, false, CFMLEngine.DIALECT_CFML);
while (!cfml.isAfterLast()) {
if (cfml.forwardIfCurrent('<')) {
for (int i = 0; i < tags.length; i++) {
if (cfml.forwardIfCurrent(tags[i].tag + " ")) {
getSingleUrl(urls, cfml, tags[i], url);
}
}
}
else {
cfml.next();
}
}
return urls;
} | java | public List<URL> getURLS(String html, URL url) {
List<URL> urls = new ArrayList<URL>();
SourceCode cfml = new SourceCode(html, false, CFMLEngine.DIALECT_CFML);
while (!cfml.isAfterLast()) {
if (cfml.forwardIfCurrent('<')) {
for (int i = 0; i < tags.length; i++) {
if (cfml.forwardIfCurrent(tags[i].tag + " ")) {
getSingleUrl(urls, cfml, tags[i], url);
}
}
}
else {
cfml.next();
}
}
return urls;
} | [
"public",
"List",
"<",
"URL",
">",
"getURLS",
"(",
"String",
"html",
",",
"URL",
"url",
")",
"{",
"List",
"<",
"URL",
">",
"urls",
"=",
"new",
"ArrayList",
"<",
"URL",
">",
"(",
")",
";",
"SourceCode",
"cfml",
"=",
"new",
"SourceCode",
"(",
"html",... | returns all urls in a html String
@param html HTML String to search urls
@param url Absolute URL path to set
@return urls found in html String | [
"returns",
"all",
"urls",
"in",
"a",
"html",
"String"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/lang/HTMLUtil.java#L50-L67 |
30,581 | lucee/Lucee | core/src/main/java/lucee/runtime/crypt/CFMXCompat.java | CFMXCompat.isCfmxCompat | public static boolean isCfmxCompat(String algorithm) {
if (StringUtil.isEmpty(algorithm, true)) return true;
return algorithm.equalsIgnoreCase(CFMXCompat.ALGORITHM_NAME);
} | java | public static boolean isCfmxCompat(String algorithm) {
if (StringUtil.isEmpty(algorithm, true)) return true;
return algorithm.equalsIgnoreCase(CFMXCompat.ALGORITHM_NAME);
} | [
"public",
"static",
"boolean",
"isCfmxCompat",
"(",
"String",
"algorithm",
")",
"{",
"if",
"(",
"StringUtil",
".",
"isEmpty",
"(",
"algorithm",
",",
"true",
")",
")",
"return",
"true",
";",
"return",
"algorithm",
".",
"equalsIgnoreCase",
"(",
"CFMXCompat",
"... | returns true if the passed value is empty or is CFMX_COMPAT | [
"returns",
"true",
"if",
"the",
"passed",
"value",
"is",
"empty",
"or",
"is",
"CFMX_COMPAT"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/crypt/CFMXCompat.java#L107-L112 |
30,582 | lucee/Lucee | core/src/main/java/lucee/transformer/library/tag/TagLibFactory.java | TagLibFactory.loadFromDirectory | public static TagLib[] loadFromDirectory(Resource dir, Identification id) throws TagLibException {
if (!dir.isDirectory()) return new TagLib[0];
ArrayList<TagLib> arr = new ArrayList<TagLib>();
Resource[] files = dir.listResources(new ExtensionResourceFilter(new String[] { "tld", "tldx" }));
for (int i = 0; i < files.length; i++) {
if (files[i].isFile()) arr.add(TagLibFactory.loadFromFile(files[i], id));
}
return arr.toArray(new TagLib[arr.size()]);
} | java | public static TagLib[] loadFromDirectory(Resource dir, Identification id) throws TagLibException {
if (!dir.isDirectory()) return new TagLib[0];
ArrayList<TagLib> arr = new ArrayList<TagLib>();
Resource[] files = dir.listResources(new ExtensionResourceFilter(new String[] { "tld", "tldx" }));
for (int i = 0; i < files.length; i++) {
if (files[i].isFile()) arr.add(TagLibFactory.loadFromFile(files[i], id));
}
return arr.toArray(new TagLib[arr.size()]);
} | [
"public",
"static",
"TagLib",
"[",
"]",
"loadFromDirectory",
"(",
"Resource",
"dir",
",",
"Identification",
"id",
")",
"throws",
"TagLibException",
"{",
"if",
"(",
"!",
"dir",
".",
"isDirectory",
"(",
")",
")",
"return",
"new",
"TagLib",
"[",
"0",
"]",
"... | Laedt mehrere TagLib's die innerhalb eines Verzeichnisses liegen.
@param dir Verzeichnis im dem die TagLib's liegen.
@param saxParser Definition des Sax Parser mit dem die TagLib's eingelesen werden sollen.
@return TagLib's als Array
@throws TagLibException | [
"Laedt",
"mehrere",
"TagLib",
"s",
"die",
"innerhalb",
"eines",
"Verzeichnisses",
"liegen",
"."
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/library/tag/TagLibFactory.java#L469-L479 |
30,583 | lucee/Lucee | core/src/main/java/lucee/transformer/library/tag/TagLibFactory.java | TagLibFactory.loadFromSystem | private static TagLib[] loadFromSystem(Identification id) throws TagLibException {
if (systemTLDs[CFMLEngine.DIALECT_CFML] == null) {
TagLib cfml = new TagLibFactory(null, TLD_BASE, id).getLib();
TagLib lucee = cfml.duplicate(false);
systemTLDs[CFMLEngine.DIALECT_CFML] = new TagLibFactory(cfml, TLD_CFML, id).getLib();
systemTLDs[CFMLEngine.DIALECT_LUCEE] = new TagLibFactory(lucee, TLD_LUCEE, id).getLib();
}
return systemTLDs;
} | java | private static TagLib[] loadFromSystem(Identification id) throws TagLibException {
if (systemTLDs[CFMLEngine.DIALECT_CFML] == null) {
TagLib cfml = new TagLibFactory(null, TLD_BASE, id).getLib();
TagLib lucee = cfml.duplicate(false);
systemTLDs[CFMLEngine.DIALECT_CFML] = new TagLibFactory(cfml, TLD_CFML, id).getLib();
systemTLDs[CFMLEngine.DIALECT_LUCEE] = new TagLibFactory(lucee, TLD_LUCEE, id).getLib();
}
return systemTLDs;
} | [
"private",
"static",
"TagLib",
"[",
"]",
"loadFromSystem",
"(",
"Identification",
"id",
")",
"throws",
"TagLibException",
"{",
"if",
"(",
"systemTLDs",
"[",
"CFMLEngine",
".",
"DIALECT_CFML",
"]",
"==",
"null",
")",
"{",
"TagLib",
"cfml",
"=",
"new",
"TagLib... | Laedt die Systeminterne TLD.
@param saxParser Definition des Sax Parser mit dem die FunctionLib eingelsesen werden soll.
@return FunctionLib
@throws TagLibException | [
"Laedt",
"die",
"Systeminterne",
"TLD",
"."
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/library/tag/TagLibFactory.java#L520-L529 |
30,584 | lucee/Lucee | core/src/main/java/lucee/runtime/tag/Mail.java | Mail.setProxyport | public void setProxyport(double proxyport) throws ApplicationException {
try {
smtp.getProxyData().setPort((int) proxyport);
}
catch (Exception e) {
throw new ApplicationException("attribute [proxyport] of the tag [mail] is invalid", e.getMessage());
}
} | java | public void setProxyport(double proxyport) throws ApplicationException {
try {
smtp.getProxyData().setPort((int) proxyport);
}
catch (Exception e) {
throw new ApplicationException("attribute [proxyport] of the tag [mail] is invalid", e.getMessage());
}
} | [
"public",
"void",
"setProxyport",
"(",
"double",
"proxyport",
")",
"throws",
"ApplicationException",
"{",
"try",
"{",
"smtp",
".",
"getProxyData",
"(",
")",
".",
"setPort",
"(",
"(",
"int",
")",
"proxyport",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
... | set the value proxyport The port number on the proxy server from which the object is requested.
Default is 80. When used with resolveURL, the URLs of retrieved documents that specify a port
number are automatically resolved to preserve links in the retrieved document.
@param proxyport value to set
@throws ApplicationException | [
"set",
"the",
"value",
"proxyport",
"The",
"port",
"number",
"on",
"the",
"proxy",
"server",
"from",
"which",
"the",
"object",
"is",
"requested",
".",
"Default",
"is",
"80",
".",
"When",
"used",
"with",
"resolveURL",
"the",
"URLs",
"of",
"retrieved",
"docu... | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/tag/Mail.java#L140-L147 |
30,585 | lucee/Lucee | core/src/main/java/lucee/runtime/tag/Mail.java | Mail.setProxyuser | public void setProxyuser(String proxyuser) throws ApplicationException {
try {
smtp.getProxyData().setUsername(proxyuser);
}
catch (Exception e) {
throw new ApplicationException("attribute [proxyuser] of the tag [mail] is invalid", e.getMessage());
}
} | java | public void setProxyuser(String proxyuser) throws ApplicationException {
try {
smtp.getProxyData().setUsername(proxyuser);
}
catch (Exception e) {
throw new ApplicationException("attribute [proxyuser] of the tag [mail] is invalid", e.getMessage());
}
} | [
"public",
"void",
"setProxyuser",
"(",
"String",
"proxyuser",
")",
"throws",
"ApplicationException",
"{",
"try",
"{",
"smtp",
".",
"getProxyData",
"(",
")",
".",
"setUsername",
"(",
"proxyuser",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"thr... | set the value username When required by a proxy server, a valid username.
@param proxyuser value to set
@throws ApplicationException | [
"set",
"the",
"value",
"username",
"When",
"required",
"by",
"a",
"proxy",
"server",
"a",
"valid",
"username",
"."
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/tag/Mail.java#L155-L162 |
30,586 | lucee/Lucee | core/src/main/java/lucee/runtime/tag/Mail.java | Mail.setProxypassword | public void setProxypassword(String proxypassword) throws ApplicationException {
try {
smtp.getProxyData().setPassword(proxypassword);
}
catch (Exception e) {
throw new ApplicationException("attribute [proxypassword] of the tag [mail] is invalid", e.getMessage());
}
} | java | public void setProxypassword(String proxypassword) throws ApplicationException {
try {
smtp.getProxyData().setPassword(proxypassword);
}
catch (Exception e) {
throw new ApplicationException("attribute [proxypassword] of the tag [mail] is invalid", e.getMessage());
}
} | [
"public",
"void",
"setProxypassword",
"(",
"String",
"proxypassword",
")",
"throws",
"ApplicationException",
"{",
"try",
"{",
"smtp",
".",
"getProxyData",
"(",
")",
".",
"setPassword",
"(",
"proxypassword",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
... | set the value password When required by a proxy server, a valid password.
@param proxypassword value to set
@throws ApplicationException | [
"set",
"the",
"value",
"password",
"When",
"required",
"by",
"a",
"proxy",
"server",
"a",
"valid",
"password",
"."
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/tag/Mail.java#L170-L177 |
30,587 | lucee/Lucee | core/src/main/java/lucee/runtime/tag/Mail.java | Mail.setFrom | public void setFrom(Object from) throws PageException {
if (StringUtil.isEmpty(from, true)) throw new ApplicationException("attribute [from] cannot be empty");
try {
smtp.setFrom(from);
}
catch (Exception e) {
throw Caster.toPageException(e);
}
} | java | public void setFrom(Object from) throws PageException {
if (StringUtil.isEmpty(from, true)) throw new ApplicationException("attribute [from] cannot be empty");
try {
smtp.setFrom(from);
}
catch (Exception e) {
throw Caster.toPageException(e);
}
} | [
"public",
"void",
"setFrom",
"(",
"Object",
"from",
")",
"throws",
"PageException",
"{",
"if",
"(",
"StringUtil",
".",
"isEmpty",
"(",
"from",
",",
"true",
")",
")",
"throw",
"new",
"ApplicationException",
"(",
"\"attribute [from] cannot be empty\"",
")",
";",
... | set the value from The sender of the e-mail message.
@param strForm value to set
@throws PageException | [
"set",
"the",
"value",
"from",
"The",
"sender",
"of",
"the",
"e",
"-",
"mail",
"message",
"."
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/tag/Mail.java#L185-L193 |
30,588 | lucee/Lucee | core/src/main/java/lucee/runtime/tag/Mail.java | Mail.setTo | public void setTo(Object to) throws ApplicationException {
if (StringUtil.isEmpty(to)) return;
try {
smtp.addTo(to);
}
catch (Exception e) {
throw new ApplicationException("attribute [to] of the tag [mail] is invalid", e.getMessage());
}
} | java | public void setTo(Object to) throws ApplicationException {
if (StringUtil.isEmpty(to)) return;
try {
smtp.addTo(to);
}
catch (Exception e) {
throw new ApplicationException("attribute [to] of the tag [mail] is invalid", e.getMessage());
}
} | [
"public",
"void",
"setTo",
"(",
"Object",
"to",
")",
"throws",
"ApplicationException",
"{",
"if",
"(",
"StringUtil",
".",
"isEmpty",
"(",
"to",
")",
")",
"return",
";",
"try",
"{",
"smtp",
".",
"addTo",
"(",
"to",
")",
";",
"}",
"catch",
"(",
"Except... | set the value to The name of the e-mail message recipient.
@param strTo value to set
@throws ApplicationException | [
"set",
"the",
"value",
"to",
"The",
"name",
"of",
"the",
"e",
"-",
"mail",
"message",
"recipient",
"."
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/tag/Mail.java#L201-L209 |
30,589 | lucee/Lucee | core/src/main/java/lucee/runtime/tag/Mail.java | Mail.setCc | public void setCc(Object cc) throws ApplicationException {
if (StringUtil.isEmpty(cc)) return;
try {
smtp.addCC(cc);
}
catch (Exception e) {
throw new ApplicationException("attribute [cc] of the tag [mail] is invalid", e.getMessage());
}
} | java | public void setCc(Object cc) throws ApplicationException {
if (StringUtil.isEmpty(cc)) return;
try {
smtp.addCC(cc);
}
catch (Exception e) {
throw new ApplicationException("attribute [cc] of the tag [mail] is invalid", e.getMessage());
}
} | [
"public",
"void",
"setCc",
"(",
"Object",
"cc",
")",
"throws",
"ApplicationException",
"{",
"if",
"(",
"StringUtil",
".",
"isEmpty",
"(",
"cc",
")",
")",
"return",
";",
"try",
"{",
"smtp",
".",
"addCC",
"(",
"cc",
")",
";",
"}",
"catch",
"(",
"Except... | set the value cc Indicates addresses to copy the e-mail message to; "cc" stands for "carbon
copy."
@param strCc value to set
@throws ApplicationException | [
"set",
"the",
"value",
"cc",
"Indicates",
"addresses",
"to",
"copy",
"the",
"e",
"-",
"mail",
"message",
"to",
";",
"cc",
"stands",
"for",
"carbon",
"copy",
"."
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/tag/Mail.java#L218-L226 |
30,590 | lucee/Lucee | core/src/main/java/lucee/runtime/tag/Mail.java | Mail.setBcc | public void setBcc(Object bcc) throws ApplicationException {
if (StringUtil.isEmpty(bcc)) return;
try {
smtp.addBCC(bcc);
}
catch (Exception e) {
throw new ApplicationException("attribute [bcc] of the tag [mail] is invalid", e.getMessage());
}
} | java | public void setBcc(Object bcc) throws ApplicationException {
if (StringUtil.isEmpty(bcc)) return;
try {
smtp.addBCC(bcc);
}
catch (Exception e) {
throw new ApplicationException("attribute [bcc] of the tag [mail] is invalid", e.getMessage());
}
} | [
"public",
"void",
"setBcc",
"(",
"Object",
"bcc",
")",
"throws",
"ApplicationException",
"{",
"if",
"(",
"StringUtil",
".",
"isEmpty",
"(",
"bcc",
")",
")",
"return",
";",
"try",
"{",
"smtp",
".",
"addBCC",
"(",
"bcc",
")",
";",
"}",
"catch",
"(",
"E... | set the value bcc Indicates addresses to copy the e-mail message to, without listing them in the
message header. "bcc" stands for "blind carbon copy."
@param strBcc value to set
@throws ApplicationException | [
"set",
"the",
"value",
"bcc",
"Indicates",
"addresses",
"to",
"copy",
"the",
"e",
"-",
"mail",
"message",
"to",
"without",
"listing",
"them",
"in",
"the",
"message",
"header",
".",
"bcc",
"stands",
"for",
"blind",
"carbon",
"copy",
"."
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/tag/Mail.java#L235-L243 |
30,591 | lucee/Lucee | core/src/main/java/lucee/runtime/tag/Mail.java | Mail.setType | public void setType(String type) throws ApplicationException {
type = type.toLowerCase().trim();
if (type.equals("text/plain") || type.equals("plain") || type.equals("text")) getPart().isHTML(false);
// mail.setType(lucee.runtime.mail.Mail.TYPE_TEXT);
else if (type.equals("text/html") || type.equals("html") || type.equals("htm")) getPart().isHTML(true);
else throw new ApplicationException("attribute type of tag mail has an invalid values", "valid values are [plain,text,html] but value is now [" + type + "]");
// throw new ApplicationException(("invalid type "+type);
} | java | public void setType(String type) throws ApplicationException {
type = type.toLowerCase().trim();
if (type.equals("text/plain") || type.equals("plain") || type.equals("text")) getPart().isHTML(false);
// mail.setType(lucee.runtime.mail.Mail.TYPE_TEXT);
else if (type.equals("text/html") || type.equals("html") || type.equals("htm")) getPart().isHTML(true);
else throw new ApplicationException("attribute type of tag mail has an invalid values", "valid values are [plain,text,html] but value is now [" + type + "]");
// throw new ApplicationException(("invalid type "+type);
} | [
"public",
"void",
"setType",
"(",
"String",
"type",
")",
"throws",
"ApplicationException",
"{",
"type",
"=",
"type",
".",
"toLowerCase",
"(",
")",
".",
"trim",
"(",
")",
";",
"if",
"(",
"type",
".",
"equals",
"(",
"\"text/plain\"",
")",
"||",
"type",
"... | set the value type Specifies extended type attributes for the message.
@param type value to set
@throws ApplicationException | [
"set",
"the",
"value",
"type",
"Specifies",
"extended",
"type",
"attributes",
"for",
"the",
"message",
"."
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/tag/Mail.java#L279-L286 |
30,592 | lucee/Lucee | core/src/main/java/lucee/runtime/tag/Mail.java | Mail.setMimeattach | public void setMimeattach(String strMimeattach, String fileName, String type, String disposition, String contentID, boolean removeAfterSend) throws PageException {
Resource file = ResourceUtil.toResourceNotExisting(pageContext, strMimeattach);
pageContext.getConfig().getSecurityManager().checkFileLocation(file);
if (!file.exists()) throw new ApplicationException("can't attach file " + strMimeattach + ", this file doesn't exist");
smtp.addAttachment(file, fileName, type, disposition, contentID, removeAfterSend);
} | java | public void setMimeattach(String strMimeattach, String fileName, String type, String disposition, String contentID, boolean removeAfterSend) throws PageException {
Resource file = ResourceUtil.toResourceNotExisting(pageContext, strMimeattach);
pageContext.getConfig().getSecurityManager().checkFileLocation(file);
if (!file.exists()) throw new ApplicationException("can't attach file " + strMimeattach + ", this file doesn't exist");
smtp.addAttachment(file, fileName, type, disposition, contentID, removeAfterSend);
} | [
"public",
"void",
"setMimeattach",
"(",
"String",
"strMimeattach",
",",
"String",
"fileName",
",",
"String",
"type",
",",
"String",
"disposition",
",",
"String",
"contentID",
",",
"boolean",
"removeAfterSend",
")",
"throws",
"PageException",
"{",
"Resource",
"file... | set the value mimeattach Specifies the path of the file to be attached to the e-mail message. An
attached file is MIME-encoded.
@param strMimeattach value to set
@param type mimetype of the file
@param contentID
@param disposition
@throws PageException | [
"set",
"the",
"value",
"mimeattach",
"Specifies",
"the",
"path",
"of",
"the",
"file",
"to",
"be",
"attached",
"to",
"the",
"e",
"-",
"mail",
"message",
".",
"An",
"attached",
"file",
"is",
"MIME",
"-",
"encoded",
"."
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/tag/Mail.java#L322-L329 |
30,593 | lucee/Lucee | core/src/main/java/lucee/runtime/tag/Mail.java | Mail.setParam | public void setParam(String type, String file, String fileName, String name, String value, String disposition, String contentID, Boolean oRemoveAfterSend)
throws PageException {
if (file != null) {
boolean removeAfterSend = (oRemoveAfterSend == null) ? remove : oRemoveAfterSend.booleanValue();
setMimeattach(file, fileName, type, disposition, contentID, removeAfterSend);
}
else {
if (name.equalsIgnoreCase("bcc")) setBcc(value);
else if (name.equalsIgnoreCase("cc")) setCc(value);
else if (name.equalsIgnoreCase("charset")) setCharset(CharsetUtil.toCharset(value, null));
else if (name.equalsIgnoreCase("failto")) setFailto(value);
else if (name.equalsIgnoreCase("from")) setFrom(value);
else if (name.equalsIgnoreCase("mailerid")) setMailerid(value);
else if (name.equalsIgnoreCase("mimeattach")) setMimeattach(value);
else if (name.equalsIgnoreCase("priority")) setPriority(value);
else if (name.equalsIgnoreCase("replyto")) setReplyto(value);
else if (name.equalsIgnoreCase("subject")) setSubject(value);
else if (name.equalsIgnoreCase("to")) setTo(value);
else smtp.addHeader(name, value);
}
} | java | public void setParam(String type, String file, String fileName, String name, String value, String disposition, String contentID, Boolean oRemoveAfterSend)
throws PageException {
if (file != null) {
boolean removeAfterSend = (oRemoveAfterSend == null) ? remove : oRemoveAfterSend.booleanValue();
setMimeattach(file, fileName, type, disposition, contentID, removeAfterSend);
}
else {
if (name.equalsIgnoreCase("bcc")) setBcc(value);
else if (name.equalsIgnoreCase("cc")) setCc(value);
else if (name.equalsIgnoreCase("charset")) setCharset(CharsetUtil.toCharset(value, null));
else if (name.equalsIgnoreCase("failto")) setFailto(value);
else if (name.equalsIgnoreCase("from")) setFrom(value);
else if (name.equalsIgnoreCase("mailerid")) setMailerid(value);
else if (name.equalsIgnoreCase("mimeattach")) setMimeattach(value);
else if (name.equalsIgnoreCase("priority")) setPriority(value);
else if (name.equalsIgnoreCase("replyto")) setReplyto(value);
else if (name.equalsIgnoreCase("subject")) setSubject(value);
else if (name.equalsIgnoreCase("to")) setTo(value);
else smtp.addHeader(name, value);
}
} | [
"public",
"void",
"setParam",
"(",
"String",
"type",
",",
"String",
"file",
",",
"String",
"fileName",
",",
"String",
"name",
",",
"String",
"value",
",",
"String",
"disposition",
",",
"String",
"contentID",
",",
"Boolean",
"oRemoveAfterSend",
")",
"throws",
... | sets a mail param
@param type
@param file
@param name
@param value
@param contentID
@param disposition
@throws PageException | [
"sets",
"a",
"mail",
"param"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/tag/Mail.java#L601-L623 |
30,594 | lucee/Lucee | core/src/main/java/lucee/runtime/reflection/storage/SoftMethodStorage.java | SoftMethodStorage.getMethods | public Method[] getMethods(Class clazz, Collection.Key methodName, int count) {
Map<Key, Array> methodsMap = map.get(clazz);
if (methodsMap == null) methodsMap = store(clazz);
Array methods = methodsMap.get(methodName);
if (methods == null) return null;
Object o = methods.get(count + 1, null);
if (o == null) return null;
return (Method[]) o;
} | java | public Method[] getMethods(Class clazz, Collection.Key methodName, int count) {
Map<Key, Array> methodsMap = map.get(clazz);
if (methodsMap == null) methodsMap = store(clazz);
Array methods = methodsMap.get(methodName);
if (methods == null) return null;
Object o = methods.get(count + 1, null);
if (o == null) return null;
return (Method[]) o;
} | [
"public",
"Method",
"[",
"]",
"getMethods",
"(",
"Class",
"clazz",
",",
"Collection",
".",
"Key",
"methodName",
",",
"int",
"count",
")",
"{",
"Map",
"<",
"Key",
",",
"Array",
">",
"methodsMap",
"=",
"map",
".",
"get",
"(",
"clazz",
")",
";",
"if",
... | returns a methods matching given criteria or null if method doesn't exist
@param clazz clazz to get methods from
@param methodName Name of the Method to get
@param count wished count of arguments
@return matching Methods as Array | [
"returns",
"a",
"methods",
"matching",
"given",
"criteria",
"or",
"null",
"if",
"method",
"doesn",
"t",
"exist"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/reflection/storage/SoftMethodStorage.java#L49-L59 |
30,595 | lucee/Lucee | core/src/main/java/lucee/runtime/reflection/storage/SoftMethodStorage.java | SoftMethodStorage.storeArgs | private void storeArgs(Method method, Array methodArgs) {
Class[] pmt = method.getParameterTypes();
Method[] args;
synchronized (methodArgs) {
Object o = methodArgs.get(pmt.length + 1, null);
if (o == null) {
args = new Method[1];
methodArgs.setEL(pmt.length + 1, args);
}
else {
Method[] ms = (Method[]) o;
args = new Method[ms.length + 1];
for (int i = 0; i < ms.length; i++) {
args[i] = ms[i];
}
methodArgs.setEL(pmt.length + 1, args);
}
}
args[args.length - 1] = method;
} | java | private void storeArgs(Method method, Array methodArgs) {
Class[] pmt = method.getParameterTypes();
Method[] args;
synchronized (methodArgs) {
Object o = methodArgs.get(pmt.length + 1, null);
if (o == null) {
args = new Method[1];
methodArgs.setEL(pmt.length + 1, args);
}
else {
Method[] ms = (Method[]) o;
args = new Method[ms.length + 1];
for (int i = 0; i < ms.length; i++) {
args[i] = ms[i];
}
methodArgs.setEL(pmt.length + 1, args);
}
}
args[args.length - 1] = method;
} | [
"private",
"void",
"storeArgs",
"(",
"Method",
"method",
",",
"Array",
"methodArgs",
")",
"{",
"Class",
"[",
"]",
"pmt",
"=",
"method",
".",
"getParameterTypes",
"(",
")",
";",
"Method",
"[",
"]",
"args",
";",
"synchronized",
"(",
"methodArgs",
")",
"{",... | stores arguments of a method
@param method
@param methodArgs | [
"stores",
"arguments",
"of",
"a",
"method"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/reflection/storage/SoftMethodStorage.java#L106-L126 |
30,596 | lucee/Lucee | core/src/main/java/lucee/runtime/config/ConfigWebImpl.java | ConfigWebImpl.getApplicationMapping | public Mapping getApplicationMapping(String virtual, String physical) {
return getApplicationMapping("application", virtual, physical, null, true, false);
} | java | public Mapping getApplicationMapping(String virtual, String physical) {
return getApplicationMapping("application", virtual, physical, null, true, false);
} | [
"public",
"Mapping",
"getApplicationMapping",
"(",
"String",
"virtual",
",",
"String",
"physical",
")",
"{",
"return",
"getApplicationMapping",
"(",
"\"application\"",
",",
"virtual",
",",
"physical",
",",
"null",
",",
"true",
",",
"false",
")",
";",
"}"
] | FYI used by Extensions, do not remove | [
"FYI",
"used",
"by",
"Extensions",
"do",
"not",
"remove"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/ConfigWebImpl.java#L324-L326 |
30,597 | lucee/Lucee | core/src/main/java/lucee/runtime/text/csv/CSVString.java | CSVString.fwdQuote | StringBuilder fwdQuote(char q) {
StringBuilder sb = new StringBuilder();
while (hasNext()) {
next();
sb.append(buffer[pos]);
if (isCurr(q)) {
if (isNext(q)) { // consecutive quote sign
next();
}
else {
break;
}
}
}
if (sb.length() > 0) sb.setLength(sb.length() - 1); // remove closing quote sign
return sb;
} | java | StringBuilder fwdQuote(char q) {
StringBuilder sb = new StringBuilder();
while (hasNext()) {
next();
sb.append(buffer[pos]);
if (isCurr(q)) {
if (isNext(q)) { // consecutive quote sign
next();
}
else {
break;
}
}
}
if (sb.length() > 0) sb.setLength(sb.length() - 1); // remove closing quote sign
return sb;
} | [
"StringBuilder",
"fwdQuote",
"(",
"char",
"q",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"while",
"(",
"hasNext",
"(",
")",
")",
"{",
"next",
"(",
")",
";",
"sb",
".",
"append",
"(",
"buffer",
"[",
"pos",
"]",
")"... | forward pos until the end of quote | [
"forward",
"pos",
"until",
"the",
"end",
"of",
"quote"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/text/csv/CSVString.java#L81-L103 |
30,598 | lucee/Lucee | core/src/main/java/lucee/commons/digest/MD5Checksum.java | MD5Checksum.getMD5Checksum | public static String getMD5Checksum(Resource res) throws Exception {
byte[] b = createChecksum(res);
String result = "";
for (int i = 0; i < b.length; i++) {
result += Integer.toString((b[i] & 0xff) + 0x100, 16).substring(1);
}
return result;
} | java | public static String getMD5Checksum(Resource res) throws Exception {
byte[] b = createChecksum(res);
String result = "";
for (int i = 0; i < b.length; i++) {
result += Integer.toString((b[i] & 0xff) + 0x100, 16).substring(1);
}
return result;
} | [
"public",
"static",
"String",
"getMD5Checksum",
"(",
"Resource",
"res",
")",
"throws",
"Exception",
"{",
"byte",
"[",
"]",
"b",
"=",
"createChecksum",
"(",
"res",
")",
";",
"String",
"result",
"=",
"\"\"",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
... | a byte array to a HEX string | [
"a",
"byte",
"array",
"to",
"a",
"HEX",
"string"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/digest/MD5Checksum.java#L53-L60 |
30,599 | lucee/Lucee | core/src/main/java/lucee/runtime/net/ftp/FTPPoolImpl.java | FTPPoolImpl._get | protected FTPWrap _get(FTPConnection conn) throws IOException, ApplicationException {
FTPWrap wrap = null;
if (!conn.hasLoginData()) {
if (StringUtil.isEmpty(conn.getName())) {
throw new ApplicationException("can't connect ftp server, missing connection definition");
}
wrap = wraps.get(conn.getName());
if (wrap == null) {
throw new ApplicationException("can't connect ftp server, missing connection [" + conn.getName() + "]");
}
else if (!wrap.getClient().isConnected() || wrap.getConnection().getTransferMode() != conn.getTransferMode()) {
wrap.reConnect(conn.getTransferMode());
}
return wrap;
}
String name = conn.hasName() ? conn.getName() : "__noname__";
wrap = wraps.get(name);
if (wrap != null) {
if (conn.loginEquals(wrap.getConnection())) {
return _get(new FTPConnectionImpl(name, null, null, null, conn.getPort(), conn.getTimeout(), conn.getTransferMode(), conn.isPassive(), conn.getProxyServer(),
conn.getProxyPort(), conn.getProxyUser(), conn.getProxyPassword(), conn.getFingerprint(), conn.getStopOnError(), conn.secure()));
}
disconnect(wrap.getClient());
}
wrap = new FTPWrap(conn);
wraps.put(name, wrap);
return wrap;
} | java | protected FTPWrap _get(FTPConnection conn) throws IOException, ApplicationException {
FTPWrap wrap = null;
if (!conn.hasLoginData()) {
if (StringUtil.isEmpty(conn.getName())) {
throw new ApplicationException("can't connect ftp server, missing connection definition");
}
wrap = wraps.get(conn.getName());
if (wrap == null) {
throw new ApplicationException("can't connect ftp server, missing connection [" + conn.getName() + "]");
}
else if (!wrap.getClient().isConnected() || wrap.getConnection().getTransferMode() != conn.getTransferMode()) {
wrap.reConnect(conn.getTransferMode());
}
return wrap;
}
String name = conn.hasName() ? conn.getName() : "__noname__";
wrap = wraps.get(name);
if (wrap != null) {
if (conn.loginEquals(wrap.getConnection())) {
return _get(new FTPConnectionImpl(name, null, null, null, conn.getPort(), conn.getTimeout(), conn.getTransferMode(), conn.isPassive(), conn.getProxyServer(),
conn.getProxyPort(), conn.getProxyUser(), conn.getProxyPassword(), conn.getFingerprint(), conn.getStopOnError(), conn.secure()));
}
disconnect(wrap.getClient());
}
wrap = new FTPWrap(conn);
wraps.put(name, wrap);
return wrap;
} | [
"protected",
"FTPWrap",
"_get",
"(",
"FTPConnection",
"conn",
")",
"throws",
"IOException",
",",
"ApplicationException",
"{",
"FTPWrap",
"wrap",
"=",
"null",
";",
"if",
"(",
"!",
"conn",
".",
"hasLoginData",
"(",
")",
")",
"{",
"if",
"(",
"StringUtil",
"."... | returns a client from given connection
@param conn
@return
@return matching wrap
@throws IOException
@throws ApplicationException | [
"returns",
"a",
"client",
"from",
"given",
"connection"
] | 29b153fc4e126e5edb97da937f2ee2e231b87593 | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/net/ftp/FTPPoolImpl.java#L55-L87 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.