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,200
RobotiumTech/robotium
robotium-solo/src/main/java/com/robotium/solo/Solo.java
Solo.waitForFragmentByTag
public boolean waitForFragmentByTag(String tag){ if(config.commandLogging){ Log.d(config.commandLoggingTag, "waitForFragmentByTag(\""+tag+"\")"); } return waiter.waitForFragment(tag, 0, Timeout.getLargeTimeout()); }
java
public boolean waitForFragmentByTag(String tag){ if(config.commandLogging){ Log.d(config.commandLoggingTag, "waitForFragmentByTag(\""+tag+"\")"); } return waiter.waitForFragment(tag, 0, Timeout.getLargeTimeout()); }
[ "public", "boolean", "waitForFragmentByTag", "(", "String", "tag", ")", "{", "if", "(", "config", ".", "commandLogging", ")", "{", "Log", ".", "d", "(", "config", ".", "commandLoggingTag", ",", "\"waitForFragmentByTag(\\\"\"", "+", "tag", "+", "\"\\\")\"", ")"...
Waits for a Fragment matching the specified tag. Default timeout is 20 seconds. @param tag the name of the tag @return {@code true} if fragment appears and {@code false} if it does not appear before the timeout
[ "Waits", "for", "a", "Fragment", "matching", "the", "specified", "tag", ".", "Default", "timeout", "is", "20", "seconds", "." ]
75e567c38f26a6a87dc8bef90b3886a20e28d291
https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Solo.java#L3662-L3668
30,201
RobotiumTech/robotium
robotium-solo/src/main/java/com/robotium/solo/Solo.java
Solo.waitForFragmentByTag
public boolean waitForFragmentByTag(String tag, int timeout){ if(config.commandLogging){ Log.d(config.commandLoggingTag, "waitForFragmentByTag(\""+tag+"\", "+timeout+")"); } return waiter.waitForFragment(tag, 0, timeout); }
java
public boolean waitForFragmentByTag(String tag, int timeout){ if(config.commandLogging){ Log.d(config.commandLoggingTag, "waitForFragmentByTag(\""+tag+"\", "+timeout+")"); } return waiter.waitForFragment(tag, 0, timeout); }
[ "public", "boolean", "waitForFragmentByTag", "(", "String", "tag", ",", "int", "timeout", ")", "{", "if", "(", "config", ".", "commandLogging", ")", "{", "Log", ".", "d", "(", "config", ".", "commandLoggingTag", ",", "\"waitForFragmentByTag(\\\"\"", "+", "tag"...
Waits for a Fragment matching the specified tag. @param tag the name of the tag @param timeout the amount of time in milliseconds to wait @return {@code true} if fragment appears and {@code false} if it does not appear before the timeout
[ "Waits", "for", "a", "Fragment", "matching", "the", "specified", "tag", "." ]
75e567c38f26a6a87dc8bef90b3886a20e28d291
https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Solo.java#L3678-L3684
30,202
RobotiumTech/robotium
robotium-solo/src/main/java/com/robotium/solo/Solo.java
Solo.waitForFragmentById
public boolean waitForFragmentById(int id){ if(config.commandLogging){ Log.d(config.commandLoggingTag, "waitForFragmentById("+id+")"); } return waiter.waitForFragment(null, id, Timeout.getLargeTimeout()); }
java
public boolean waitForFragmentById(int id){ if(config.commandLogging){ Log.d(config.commandLoggingTag, "waitForFragmentById("+id+")"); } return waiter.waitForFragment(null, id, Timeout.getLargeTimeout()); }
[ "public", "boolean", "waitForFragmentById", "(", "int", "id", ")", "{", "if", "(", "config", ".", "commandLogging", ")", "{", "Log", ".", "d", "(", "config", ".", "commandLoggingTag", ",", "\"waitForFragmentById(\"", "+", "id", "+", "\")\"", ")", ";", "}",...
Waits for a Fragment matching the specified resource id. Default timeout is 20 seconds. @param id the R.id of the fragment @return {@code true} if fragment appears and {@code false} if it does not appear before the timeout
[ "Waits", "for", "a", "Fragment", "matching", "the", "specified", "resource", "id", ".", "Default", "timeout", "is", "20", "seconds", "." ]
75e567c38f26a6a87dc8bef90b3886a20e28d291
https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Solo.java#L3693-L3699
30,203
RobotiumTech/robotium
robotium-solo/src/main/java/com/robotium/solo/Solo.java
Solo.waitForFragmentById
public boolean waitForFragmentById(int id, int timeout){ if(config.commandLogging){ Log.d(config.commandLoggingTag, "waitForFragmentById("+id+", "+timeout+")"); } return waiter.waitForFragment(null, id, timeout); }
java
public boolean waitForFragmentById(int id, int timeout){ if(config.commandLogging){ Log.d(config.commandLoggingTag, "waitForFragmentById("+id+", "+timeout+")"); } return waiter.waitForFragment(null, id, timeout); }
[ "public", "boolean", "waitForFragmentById", "(", "int", "id", ",", "int", "timeout", ")", "{", "if", "(", "config", ".", "commandLogging", ")", "{", "Log", ".", "d", "(", "config", ".", "commandLoggingTag", ",", "\"waitForFragmentById(\"", "+", "id", "+", ...
Waits for a Fragment matching the specified resource id. @param id the R.id of the fragment @param timeout the amount of time in milliseconds to wait @return {@code true} if fragment appears and {@code false} if it does not appear before the timeout
[ "Waits", "for", "a", "Fragment", "matching", "the", "specified", "resource", "id", "." ]
75e567c38f26a6a87dc8bef90b3886a20e28d291
https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Solo.java#L3709-L3715
30,204
RobotiumTech/robotium
robotium-solo/src/main/java/com/robotium/solo/Solo.java
Solo.getString
public String getString(int id) { if(config.commandLogging){ Log.d(config.commandLoggingTag, "getString("+id+")"); } return getter.getString(id); }
java
public String getString(int id) { if(config.commandLogging){ Log.d(config.commandLoggingTag, "getString("+id+")"); } return getter.getString(id); }
[ "public", "String", "getString", "(", "int", "id", ")", "{", "if", "(", "config", ".", "commandLogging", ")", "{", "Log", ".", "d", "(", "config", ".", "commandLoggingTag", ",", "\"getString(\"", "+", "id", "+", "\")\"", ")", ";", "}", "return", "gette...
Returns a localized String matching the specified resource id. @param id the R.id of the String @return the localized String
[ "Returns", "a", "localized", "String", "matching", "the", "specified", "resource", "id", "." ]
75e567c38f26a6a87dc8bef90b3886a20e28d291
https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Solo.java#L3773-L3780
30,205
RobotiumTech/robotium
robotium-solo/src/main/java/com/robotium/solo/Solo.java
Solo.sleep
public void sleep(int time) { if(config.commandLogging){ Log.d(config.commandLoggingTag, "sleep("+time+")"); } sleeper.sleep(time); }
java
public void sleep(int time) { if(config.commandLogging){ Log.d(config.commandLoggingTag, "sleep("+time+")"); } sleeper.sleep(time); }
[ "public", "void", "sleep", "(", "int", "time", ")", "{", "if", "(", "config", ".", "commandLogging", ")", "{", "Log", ".", "d", "(", "config", ".", "commandLoggingTag", ",", "\"sleep(\"", "+", "time", "+", "\")\"", ")", ";", "}", "sleeper", ".", "sle...
Robotium will sleep for the specified time. @param time the time in milliseconds that Robotium should sleep
[ "Robotium", "will", "sleep", "for", "the", "specified", "time", "." ]
75e567c38f26a6a87dc8bef90b3886a20e28d291
https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Solo.java#L3804-L3811
30,206
RobotiumTech/robotium
robotium-solo/src/main/java/com/robotium/solo/Solo.java
Solo.initializeTimeout
@SuppressWarnings({ "rawtypes", "unchecked" }) private static int initializeTimeout(String property, int defaultValue) { try { Class clazz = Class.forName("android.os.SystemProperties"); Method method = clazz.getDeclaredMethod("get", String.class); String value = (String) method.invoke(null, property); return Integer.parseInt(value); } catch (Exception e) { return defaultValue; } }
java
@SuppressWarnings({ "rawtypes", "unchecked" }) private static int initializeTimeout(String property, int defaultValue) { try { Class clazz = Class.forName("android.os.SystemProperties"); Method method = clazz.getDeclaredMethod("get", String.class); String value = (String) method.invoke(null, property); return Integer.parseInt(value); } catch (Exception e) { return defaultValue; } }
[ "@", "SuppressWarnings", "(", "{", "\"rawtypes\"", ",", "\"unchecked\"", "}", ")", "private", "static", "int", "initializeTimeout", "(", "String", "property", ",", "int", "defaultValue", ")", "{", "try", "{", "Class", "clazz", "=", "Class", ".", "forName", "...
Parse a timeout value set using adb shell. There are two options to set the timeout. Set it using adb shell (requires root access): <br><br> 'adb shell setprop solo_large_timeout milliseconds' <br> 'adb shell setprop solo_small_timeout milliseconds' <br> Example: adb shell setprop solo_small_timeout 10000 <br><br> Set the values directly using setLargeTimeout() and setSmallTimeout @param property name of the property to read the timeout from @param defaultValue default value for the timeout @return timeout in milliseconds
[ "Parse", "a", "timeout", "value", "set", "using", "adb", "shell", "." ]
75e567c38f26a6a87dc8bef90b3886a20e28d291
https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Solo.java#L3989-L4000
30,207
lucee/Lucee
core/src/main/java/lucee/runtime/tag/Index.java
Index.setUrlpath
public void setUrlpath(String urlpath) { if (StringUtil.isEmpty(urlpath)) return; this.urlpath = urlpath.toLowerCase().trim(); }
java
public void setUrlpath(String urlpath) { if (StringUtil.isEmpty(urlpath)) return; this.urlpath = urlpath.toLowerCase().trim(); }
[ "public", "void", "setUrlpath", "(", "String", "urlpath", ")", "{", "if", "(", "StringUtil", ".", "isEmpty", "(", "urlpath", ")", ")", "return", ";", "this", ".", "urlpath", "=", "urlpath", ".", "toLowerCase", "(", ")", ".", "trim", "(", ")", ";", "}...
set the value urlpath Specifies the URL path for files if type = "file" and type = "path". When the collection is searched with cfsearch, the pathname is automatically be prepended to filenames and returned as the url attribute. @param urlpath value to set
[ "set", "the", "value", "urlpath", "Specifies", "the", "URL", "path", "for", "files", "if", "type", "=", "file", "and", "type", "=", "path", ".", "When", "the", "collection", "is", "searched", "with", "cfsearch", "the", "pathname", "is", "automatically", "b...
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/tag/Index.java#L180-L183
30,208
lucee/Lucee
core/src/main/java/lucee/runtime/tag/Index.java
Index.setType
public void setType(String type) throws PageException { if (type == null) return; try { this.type = toType(type); } catch (SearchException e) { throw Caster.toPageException(e); } }
java
public void setType(String type) throws PageException { if (type == null) return; try { this.type = toType(type); } catch (SearchException e) { throw Caster.toPageException(e); } }
[ "public", "void", "setType", "(", "String", "type", ")", "throws", "PageException", "{", "if", "(", "type", "==", "null", ")", "return", ";", "try", "{", "this", ".", "type", "=", "toType", "(", "type", ")", ";", "}", "catch", "(", "SearchException", ...
set the value type Specifies the type of entity being indexed. Default is CUSTOM. @param type value to set @throws PageException
[ "set", "the", "value", "type", "Specifies", "the", "type", "of", "entity", "being", "indexed", ".", "Default", "is", "CUSTOM", "." ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/tag/Index.java#L191-L199
30,209
lucee/Lucee
core/src/main/java/lucee/runtime/tag/Index.java
Index.setLanguage
public void setLanguage(String language) { if (StringUtil.isEmpty(language)) return; this.language = Collection.validateLanguage(language); }
java
public void setLanguage(String language) { if (StringUtil.isEmpty(language)) return; this.language = Collection.validateLanguage(language); }
[ "public", "void", "setLanguage", "(", "String", "language", ")", "{", "if", "(", "StringUtil", ".", "isEmpty", "(", "language", ")", ")", "return", ";", "this", ".", "language", "=", "Collection", ".", "validateLanguage", "(", "language", ")", ";", "}" ]
set the value language @param language value to set
[ "set", "the", "value", "language" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/tag/Index.java#L262-L265
30,210
lucee/Lucee
core/src/main/java/lucee/runtime/tag/Index.java
Index.setExtensions
public void setExtensions(String extensions) throws PageException { if (extensions == null) return; this.extensions = ListUtil.toStringArrayTrim(ListUtil.listToArray(extensions, ',')); }
java
public void setExtensions(String extensions) throws PageException { if (extensions == null) return; this.extensions = ListUtil.toStringArrayTrim(ListUtil.listToArray(extensions, ',')); }
[ "public", "void", "setExtensions", "(", "String", "extensions", ")", "throws", "PageException", "{", "if", "(", "extensions", "==", "null", ")", "return", ";", "this", ".", "extensions", "=", "ListUtil", ".", "toStringArrayTrim", "(", "ListUtil", ".", "listToA...
set the value extensions @param extensions value to set @throws PageException
[ "set", "the", "value", "extensions" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/tag/Index.java#L283-L286
30,211
lucee/Lucee
core/src/main/java/lucee/runtime/tag/Index.java
Index.setCollection
public void setCollection(String collection) throws PageException { try { this.collection = pageContext.getConfig().getSearchEngine(pageContext).getCollectionByName(collection.toLowerCase().trim()); } catch (SearchException e) { throw Caster.toPageException(e); } }
java
public void setCollection(String collection) throws PageException { try { this.collection = pageContext.getConfig().getSearchEngine(pageContext).getCollectionByName(collection.toLowerCase().trim()); } catch (SearchException e) { throw Caster.toPageException(e); } }
[ "public", "void", "setCollection", "(", "String", "collection", ")", "throws", "PageException", "{", "try", "{", "this", ".", "collection", "=", "pageContext", ".", "getConfig", "(", ")", ".", "getSearchEngine", "(", "pageContext", ")", ".", "getCollectionByName...
set the value collection Specifies a collection name. If you are indexing an external collection external = "Yes", specify the collection name, including fully qualified path. @param collection value to set @throws PageException
[ "set", "the", "value", "collection", "Specifies", "a", "collection", "name", ".", "If", "you", "are", "indexing", "an", "external", "collection", "external", "=", "Yes", "specify", "the", "collection", "name", "including", "fully", "qualified", "path", "." ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/tag/Index.java#L337-L345
30,212
lucee/Lucee
core/src/main/java/lucee/runtime/tag/Index.java
Index.doDelete
private void doDelete() throws PageException, SearchException { required("index", action, "collection", collection); if (type != SearchIndex.TYPE_CUSTOM) required("index", action, "key", key); // no type defined if (type == -1) { if (query != null) { type = SearchIndex.TYPE_CUSTOM; } else { Resource file = null; try { file = ResourceUtil.toResourceExisting(pageContext, key); pageContext.getConfig().getSecurityManager().checkFileLocation(file); } catch (ExpressionException e) {} if (file != null && file.exists() && file.isFile()) type = SearchIndex.TYPE_FILE; else if (file != null && file.exists() && file.isDirectory()) type = SearchIndex.TYPE_PATH; else { try { new URL(key); type = SearchIndex.TYPE_URL; } catch (MalformedURLException e) {} } } } collection.deleteIndex(pageContext, key, type, query); }
java
private void doDelete() throws PageException, SearchException { required("index", action, "collection", collection); if (type != SearchIndex.TYPE_CUSTOM) required("index", action, "key", key); // no type defined if (type == -1) { if (query != null) { type = SearchIndex.TYPE_CUSTOM; } else { Resource file = null; try { file = ResourceUtil.toResourceExisting(pageContext, key); pageContext.getConfig().getSecurityManager().checkFileLocation(file); } catch (ExpressionException e) {} if (file != null && file.exists() && file.isFile()) type = SearchIndex.TYPE_FILE; else if (file != null && file.exists() && file.isDirectory()) type = SearchIndex.TYPE_PATH; else { try { new URL(key); type = SearchIndex.TYPE_URL; } catch (MalformedURLException e) {} } } } collection.deleteIndex(pageContext, key, type, query); }
[ "private", "void", "doDelete", "(", ")", "throws", "PageException", ",", "SearchException", "{", "required", "(", "\"index\"", ",", "action", ",", "\"collection\"", ",", "collection", ")", ";", "if", "(", "type", "!=", "SearchIndex", ".", "TYPE_CUSTOM", ")", ...
delete a collection @throws PageException @throws SearchException
[ "delete", "a", "collection" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/tag/Index.java#L446-L476
30,213
lucee/Lucee
core/src/main/java/lucee/runtime/tag/Index.java
Index.doUpdate
private void doUpdate() throws PageException, SearchException, IOException { // check attributes required("index", action, "collection", collection); required("index", action, "key", key); if (type == -1) type = (query == null) ? SearchIndex.TYPE_FILE : SearchIndex.TYPE_CUSTOM; if (type == SearchIndex.TYPE_CUSTOM) { required("index", action, "body", body); // required("index",action,"query",query); } IndexResult result; result = collection.index(pageContext, key, type, urlpath, title, body, language, extensions, query, recurse, categoryTree, category, timeout, custom1, custom2, custom3, custom4); if (!StringUtil.isEmpty(status)) pageContext.setVariable(status, toStruct(result)); }
java
private void doUpdate() throws PageException, SearchException, IOException { // check attributes required("index", action, "collection", collection); required("index", action, "key", key); if (type == -1) type = (query == null) ? SearchIndex.TYPE_FILE : SearchIndex.TYPE_CUSTOM; if (type == SearchIndex.TYPE_CUSTOM) { required("index", action, "body", body); // required("index",action,"query",query); } IndexResult result; result = collection.index(pageContext, key, type, urlpath, title, body, language, extensions, query, recurse, categoryTree, category, timeout, custom1, custom2, custom3, custom4); if (!StringUtil.isEmpty(status)) pageContext.setVariable(status, toStruct(result)); }
[ "private", "void", "doUpdate", "(", ")", "throws", "PageException", ",", "SearchException", ",", "IOException", "{", "// check attributes", "required", "(", "\"index\"", ",", "action", ",", "\"collection\"", ",", "collection", ")", ";", "required", "(", "\"index\"...
update a collection @throws PageException @throws SearchException @throws IOException
[ "update", "a", "collection" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/tag/Index.java#L496-L512
30,214
lucee/Lucee
core/src/main/java/lucee/commons/lang/PClassLoader.java
PClassLoader._getResource
public Resource _getResource(String name) { Resource f = directory.getRealResource(name); if (f != null && f.exists() && f.isFile()) return f; return null; }
java
public Resource _getResource(String name) { Resource f = directory.getRealResource(name); if (f != null && f.exists() && f.isFile()) return f; return null; }
[ "public", "Resource", "_getResource", "(", "String", "name", ")", "{", "Resource", "f", "=", "directory", ".", "getRealResource", "(", "name", ")", ";", "if", "(", "f", "!=", "null", "&&", "f", ".", "exists", "(", ")", "&&", "f", ".", "isFile", "(", ...
returns matching File Object or null if file not exust @param name @return matching file
[ "returns", "matching", "File", "Object", "or", "null", "if", "file", "not", "exust" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/lang/PClassLoader.java#L160-L164
30,215
lucee/Lucee
core/src/main/java/lucee/runtime/net/ntp/NtpClient.java
NtpClient.getOffset
public long getOffset() throws IOException { /// Send request DatagramSocket socket = null; try { socket = new DatagramSocket(); socket.setSoTimeout(20000); InetAddress address = InetAddress.getByName(serverName); byte[] buf = new NtpMessage().toByteArray(); DatagramPacket packet = new DatagramPacket(buf, buf.length, address, 123); // Set the transmit timestamp *just* before sending the packet NtpMessage.encodeTimestamp(packet.getData(), 40, (System.currentTimeMillis() / 1000.0) + 2208988800.0); socket.send(packet); // Get response packet = new DatagramPacket(buf, buf.length); socket.receive(packet); // Immediately record the incoming timestamp double destinationTimestamp = (System.currentTimeMillis() / 1000.0) + 2208988800.0; // Process response NtpMessage msg = new NtpMessage(packet.getData()); // double roundTripDelay = (destinationTimestamp-msg.originateTimestamp) - // (msg.receiveTimestamp-msg.transmitTimestamp); double localClockOffset = ((msg.receiveTimestamp - msg.originateTimestamp) + (msg.transmitTimestamp - destinationTimestamp)) / 2; return (long) (localClockOffset * 1000); } finally { IOUtil.closeEL(socket); } }
java
public long getOffset() throws IOException { /// Send request DatagramSocket socket = null; try { socket = new DatagramSocket(); socket.setSoTimeout(20000); InetAddress address = InetAddress.getByName(serverName); byte[] buf = new NtpMessage().toByteArray(); DatagramPacket packet = new DatagramPacket(buf, buf.length, address, 123); // Set the transmit timestamp *just* before sending the packet NtpMessage.encodeTimestamp(packet.getData(), 40, (System.currentTimeMillis() / 1000.0) + 2208988800.0); socket.send(packet); // Get response packet = new DatagramPacket(buf, buf.length); socket.receive(packet); // Immediately record the incoming timestamp double destinationTimestamp = (System.currentTimeMillis() / 1000.0) + 2208988800.0; // Process response NtpMessage msg = new NtpMessage(packet.getData()); // double roundTripDelay = (destinationTimestamp-msg.originateTimestamp) - // (msg.receiveTimestamp-msg.transmitTimestamp); double localClockOffset = ((msg.receiveTimestamp - msg.originateTimestamp) + (msg.transmitTimestamp - destinationTimestamp)) / 2; return (long) (localClockOffset * 1000); } finally { IOUtil.closeEL(socket); } }
[ "public", "long", "getOffset", "(", ")", "throws", "IOException", "{", "/// Send request", "DatagramSocket", "socket", "=", "null", ";", "try", "{", "socket", "=", "new", "DatagramSocket", "(", ")", ";", "socket", ".", "setSoTimeout", "(", "20000", ")", ";",...
returns the offest from the ntp server to local system @return @throws IOException
[ "returns", "the", "offest", "from", "the", "ntp", "server", "to", "local", "system" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/net/ntp/NtpClient.java#L51-L84
30,216
lucee/Lucee
core/src/main/java/lucee/runtime/functions/query/QueryExecute.java
QueryExecute.call
public static Object call(PageContext pc, String sql, Object params, Struct options, String name) throws PageException { PageContextImpl pci = (PageContextImpl) pc; lucee.runtime.tag.Query qry = (lucee.runtime.tag.Query) pci.use(lucee.runtime.tag.Query.class.getName(), "cfquery", TagLibTag.ATTRIBUTE_TYPE_FIXED); try { try { qry.hasBody(true); // set attributes qry.setReturnVariable(true); qry.setName(StringUtil.isEmpty(name) ? "QueryExecute" : name); if (options != null) TagUtil.setAttributeCollection(pc, qry, null, options, TagLibTag.ATTRIBUTE_TYPE_FIXED); qry.setParams(params); int res = qry.doStartTag(); pc.initBody(qry, res); pc.forceWrite(sql); qry.doAfterBody(); } catch (Throwable t) { ExceptionUtil.rethrowIfNecessary(t); try { qry.doCatch(t); } catch (Throwable t2) { ExceptionUtil.rethrowIfNecessary(t); throw Caster.toPageException(t2); } } finally { pc.popBody(); qry.doFinally(); } qry.doEndTag(); return qry.getReturnVariable(); } finally { pci.reuse(qry); } }
java
public static Object call(PageContext pc, String sql, Object params, Struct options, String name) throws PageException { PageContextImpl pci = (PageContextImpl) pc; lucee.runtime.tag.Query qry = (lucee.runtime.tag.Query) pci.use(lucee.runtime.tag.Query.class.getName(), "cfquery", TagLibTag.ATTRIBUTE_TYPE_FIXED); try { try { qry.hasBody(true); // set attributes qry.setReturnVariable(true); qry.setName(StringUtil.isEmpty(name) ? "QueryExecute" : name); if (options != null) TagUtil.setAttributeCollection(pc, qry, null, options, TagLibTag.ATTRIBUTE_TYPE_FIXED); qry.setParams(params); int res = qry.doStartTag(); pc.initBody(qry, res); pc.forceWrite(sql); qry.doAfterBody(); } catch (Throwable t) { ExceptionUtil.rethrowIfNecessary(t); try { qry.doCatch(t); } catch (Throwable t2) { ExceptionUtil.rethrowIfNecessary(t); throw Caster.toPageException(t2); } } finally { pc.popBody(); qry.doFinally(); } qry.doEndTag(); return qry.getReturnVariable(); } finally { pci.reuse(qry); } }
[ "public", "static", "Object", "call", "(", "PageContext", "pc", ",", "String", "sql", ",", "Object", "params", ",", "Struct", "options", ",", "String", "name", ")", "throws", "PageException", "{", "PageContextImpl", "pci", "=", "(", "PageContextImpl", ")", "...
name is set by evaluator
[ "name", "is", "set", "by", "evaluator" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/functions/query/QueryExecute.java#L54-L93
30,217
lucee/Lucee
core/src/main/java/lucee/runtime/thread/ThreadUtil.java
ThreadUtil.toStringPriority
public static String toStringPriority(int priority) { if (priority == Thread.NORM_PRIORITY) return "NORMAL"; if (priority == Thread.MAX_PRIORITY) return "HIGH"; if (priority == Thread.MIN_PRIORITY) return "LOW"; return null; }
java
public static String toStringPriority(int priority) { if (priority == Thread.NORM_PRIORITY) return "NORMAL"; if (priority == Thread.MAX_PRIORITY) return "HIGH"; if (priority == Thread.MIN_PRIORITY) return "LOW"; return null; }
[ "public", "static", "String", "toStringPriority", "(", "int", "priority", ")", "{", "if", "(", "priority", "==", "Thread", ".", "NORM_PRIORITY", ")", "return", "\"NORMAL\"", ";", "if", "(", "priority", "==", "Thread", ".", "MAX_PRIORITY", ")", "return", "\"H...
return priority as a String representation @param priority Thread priority @return String definition of priority (null when input is invalid)
[ "return", "priority", "as", "a", "String", "representation" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/thread/ThreadUtil.java#L137-L142
30,218
lucee/Lucee
core/src/main/java/lucee/runtime/thread/ThreadUtil.java
ThreadUtil.toIntPriority
public static int toIntPriority(String strPriority) { strPriority = strPriority.trim().toLowerCase(); if ("low".equals(strPriority)) return Thread.MIN_PRIORITY; if ("min".equals(strPriority)) return Thread.MIN_PRIORITY; if ("high".equals(strPriority)) return Thread.MAX_PRIORITY; if ("max".equals(strPriority)) return Thread.MAX_PRIORITY; if ("normal".equals(strPriority)) return Thread.NORM_PRIORITY; if ("norm".equals(strPriority)) return Thread.NORM_PRIORITY; return -1; }
java
public static int toIntPriority(String strPriority) { strPriority = strPriority.trim().toLowerCase(); if ("low".equals(strPriority)) return Thread.MIN_PRIORITY; if ("min".equals(strPriority)) return Thread.MIN_PRIORITY; if ("high".equals(strPriority)) return Thread.MAX_PRIORITY; if ("max".equals(strPriority)) return Thread.MAX_PRIORITY; if ("normal".equals(strPriority)) return Thread.NORM_PRIORITY; if ("norm".equals(strPriority)) return Thread.NORM_PRIORITY; return -1; }
[ "public", "static", "int", "toIntPriority", "(", "String", "strPriority", ")", "{", "strPriority", "=", "strPriority", ".", "trim", "(", ")", ".", "toLowerCase", "(", ")", ";", "if", "(", "\"low\"", ".", "equals", "(", "strPriority", ")", ")", "return", ...
return priority as a int representation @param priority Thread priority as String definition @return int definition of priority (-1 when input is invalid)
[ "return", "priority", "as", "a", "int", "representation" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/thread/ThreadUtil.java#L150-L160
30,219
lucee/Lucee
core/src/main/java/lucee/runtime/net/mail/MailClient.java
MailClient.start
public void start() throws MessagingException { Properties properties = new Properties(); String type = getTypeAsString(); properties.put("mail." + type + ".host", server); properties.put("mail." + type + ".port", new Double(port)); properties.put("mail." + type + ".connectiontimeout", String.valueOf(timeout)); properties.put("mail." + type + ".timeout", String.valueOf(timeout)); // properties.put("mail.mime.charset", "UTF-8"); if (secure) { properties.put("mail." + type + ".ssl.enable", "true"); // properties.put("mail."+type+".starttls.enable", "true" ); } if (TYPE_IMAP == getType()) { properties.put("mail.imap.partialfetch", "false"); } // if(TYPE_POP3==getType()){} _session = username != null ? Session.getInstance(properties, new _Authenticator(username, password)) : Session.getInstance(properties); _store = _session.getStore(type); if (!StringUtil.isEmpty(username)) _store.connect(server, username, password); else _store.connect(); }
java
public void start() throws MessagingException { Properties properties = new Properties(); String type = getTypeAsString(); properties.put("mail." + type + ".host", server); properties.put("mail." + type + ".port", new Double(port)); properties.put("mail." + type + ".connectiontimeout", String.valueOf(timeout)); properties.put("mail." + type + ".timeout", String.valueOf(timeout)); // properties.put("mail.mime.charset", "UTF-8"); if (secure) { properties.put("mail." + type + ".ssl.enable", "true"); // properties.put("mail."+type+".starttls.enable", "true" ); } if (TYPE_IMAP == getType()) { properties.put("mail.imap.partialfetch", "false"); } // if(TYPE_POP3==getType()){} _session = username != null ? Session.getInstance(properties, new _Authenticator(username, password)) : Session.getInstance(properties); _store = _session.getStore(type); if (!StringUtil.isEmpty(username)) _store.connect(server, username, password); else _store.connect(); }
[ "public", "void", "start", "(", ")", "throws", "MessagingException", "{", "Properties", "properties", "=", "new", "Properties", "(", ")", ";", "String", "type", "=", "getTypeAsString", "(", ")", ";", "properties", ".", "put", "(", "\"mail.\"", "+", "type", ...
connects to pop server @throws MessagingException
[ "connects", "to", "pop", "server" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/net/mail/MailClient.java#L244-L265
30,220
lucee/Lucee
core/src/main/java/lucee/runtime/net/mail/MailClient.java
MailClient.deleteMails
public void deleteMails(String as[], String as1[]) throws MessagingException, IOException { Folder folder; Message amessage[]; folder = _store.getFolder("INBOX"); folder.open(2); Map<String, Message> map = getMessages(null, folder, as1, as, startrow, maxrows, false); Iterator<String> iterator = map.keySet().iterator(); amessage = new Message[map.size()]; int i = 0; while (iterator.hasNext()) { amessage[i++] = map.get(iterator.next()); } try { folder.setFlags(amessage, new Flags(javax.mail.Flags.Flag.DELETED), true); } finally { folder.close(true); } }
java
public void deleteMails(String as[], String as1[]) throws MessagingException, IOException { Folder folder; Message amessage[]; folder = _store.getFolder("INBOX"); folder.open(2); Map<String, Message> map = getMessages(null, folder, as1, as, startrow, maxrows, false); Iterator<String> iterator = map.keySet().iterator(); amessage = new Message[map.size()]; int i = 0; while (iterator.hasNext()) { amessage[i++] = map.get(iterator.next()); } try { folder.setFlags(amessage, new Flags(javax.mail.Flags.Flag.DELETED), true); } finally { folder.close(true); } }
[ "public", "void", "deleteMails", "(", "String", "as", "[", "]", ",", "String", "as1", "[", "]", ")", "throws", "MessagingException", ",", "IOException", "{", "Folder", "folder", ";", "Message", "amessage", "[", "]", ";", "folder", "=", "_store", ".", "ge...
delete all message in ibox that match given criteria @param messageNumbers @param uIds @throws MessagingException @throws IOException
[ "delete", "all", "message", "in", "ibox", "that", "match", "given", "criteria" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/net/mail/MailClient.java#L279-L297
30,221
lucee/Lucee
core/src/main/java/lucee/runtime/net/mail/MailClient.java
MailClient.getMails
public Query getMails(String[] messageNumbers, String[] uids, boolean all) throws MessagingException, IOException { Query qry = new QueryImpl(all ? _fldnew : _flddo, 0, "query"); Folder folder = _store.getFolder("INBOX"); folder.open(Folder.READ_ONLY); try { getMessages(qry, folder, uids, messageNumbers, startrow, maxrows, all); } finally { folder.close(false); } return qry; }
java
public Query getMails(String[] messageNumbers, String[] uids, boolean all) throws MessagingException, IOException { Query qry = new QueryImpl(all ? _fldnew : _flddo, 0, "query"); Folder folder = _store.getFolder("INBOX"); folder.open(Folder.READ_ONLY); try { getMessages(qry, folder, uids, messageNumbers, startrow, maxrows, all); } finally { folder.close(false); } return qry; }
[ "public", "Query", "getMails", "(", "String", "[", "]", "messageNumbers", ",", "String", "[", "]", "uids", ",", "boolean", "all", ")", "throws", "MessagingException", ",", "IOException", "{", "Query", "qry", "=", "new", "QueryImpl", "(", "all", "?", "_fldn...
return all messages from inbox @param messageNumbers all messages with this ids @param uIds all messages with this uids @param withBody also return body @return all messages from inbox @throws MessagingException @throws IOException
[ "return", "all", "messages", "from", "inbox" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/net/mail/MailClient.java#L309-L320
30,222
lucee/Lucee
core/src/main/java/lucee/runtime/net/mail/MailClient.java
MailClient.getMessages
private Map<String, Message> getMessages(Query qry, Folder folder, String[] uids, String[] messageNumbers, int startRow, int maxRow, boolean all) throws MessagingException { Message[] messages = folder.getMessages(); Map<String, Message> map = qry == null ? new HashMap<String, Message>() : null; int k = 0; if (uids != null || messageNumbers != null) { startRow = 0; maxRow = -1; } Message message; for (int l = startRow; l < messages.length; l++) { if (maxRow != -1 && k == maxRow) { break; } message = messages[l]; int messageNumber = message.getMessageNumber(); String id = getId(folder, message); if (uids == null ? messageNumbers == null || contains(messageNumbers, messageNumber) : contains(uids, id)) { k++; if (qry != null) { toQuery(qry, message, id, all); } else map.put(id, message); } } return map; }
java
private Map<String, Message> getMessages(Query qry, Folder folder, String[] uids, String[] messageNumbers, int startRow, int maxRow, boolean all) throws MessagingException { Message[] messages = folder.getMessages(); Map<String, Message> map = qry == null ? new HashMap<String, Message>() : null; int k = 0; if (uids != null || messageNumbers != null) { startRow = 0; maxRow = -1; } Message message; for (int l = startRow; l < messages.length; l++) { if (maxRow != -1 && k == maxRow) { break; } message = messages[l]; int messageNumber = message.getMessageNumber(); String id = getId(folder, message); if (uids == null ? messageNumbers == null || contains(messageNumbers, messageNumber) : contains(uids, id)) { k++; if (qry != null) { toQuery(qry, message, id, all); } else map.put(id, message); } } return map; }
[ "private", "Map", "<", "String", ",", "Message", ">", "getMessages", "(", "Query", "qry", ",", "Folder", "folder", ",", "String", "[", "]", "uids", ",", "String", "[", "]", "messageNumbers", ",", "int", "startRow", ",", "int", "maxRow", ",", "boolean", ...
gets all messages from given Folder that match given criteria @param qry @param folder @param uIds @param messageNumbers @param all @param startrow @param maxrows @return @return matching Messages @throws MessagingException
[ "gets", "all", "messages", "from", "given", "Folder", "that", "match", "given", "criteria" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/net/mail/MailClient.java#L396-L423
30,223
lucee/Lucee
core/src/main/java/lucee/runtime/net/mail/MailClient.java
MailClient.getContent
private void getContent(Query query, Message message, int row) throws MessagingException, IOException { StringBuffer body = new StringBuffer(); Struct cids = new StructImpl(); query.setAtEL(CIDS, row, cids); if (message.isMimeType("text/plain")) { String content = getConent(message); query.setAtEL(TEXT_BODY, row, content); body.append(content); } else if (message.isMimeType("text/html")) { String content = getConent(message); query.setAtEL(HTML_BODY, row, content); body.append(content); } else { Object content = message.getContent(); if (content instanceof MimeMultipart) { Array attachments = new ArrayImpl(); Array attachmentFiles = new ArrayImpl(); getMultiPart(query, row, attachments, attachmentFiles, cids, (MimeMultipart) content, body); if (attachments.size() > 0) { try { query.setAtEL(ATTACHMENTS, row, ListUtil.arrayToList(attachments, "\t")); } catch (PageException pageexception) {} } if (attachmentFiles.size() > 0) { try { query.setAtEL(ATTACHMENT_FILES, row, ListUtil.arrayToList(attachmentFiles, "\t")); } catch (PageException pageexception1) {} } } } query.setAtEL(BODY, row, body.toString()); }
java
private void getContent(Query query, Message message, int row) throws MessagingException, IOException { StringBuffer body = new StringBuffer(); Struct cids = new StructImpl(); query.setAtEL(CIDS, row, cids); if (message.isMimeType("text/plain")) { String content = getConent(message); query.setAtEL(TEXT_BODY, row, content); body.append(content); } else if (message.isMimeType("text/html")) { String content = getConent(message); query.setAtEL(HTML_BODY, row, content); body.append(content); } else { Object content = message.getContent(); if (content instanceof MimeMultipart) { Array attachments = new ArrayImpl(); Array attachmentFiles = new ArrayImpl(); getMultiPart(query, row, attachments, attachmentFiles, cids, (MimeMultipart) content, body); if (attachments.size() > 0) { try { query.setAtEL(ATTACHMENTS, row, ListUtil.arrayToList(attachments, "\t")); } catch (PageException pageexception) {} } if (attachmentFiles.size() > 0) { try { query.setAtEL(ATTACHMENT_FILES, row, ListUtil.arrayToList(attachmentFiles, "\t")); } catch (PageException pageexception1) {} } } } query.setAtEL(BODY, row, body.toString()); }
[ "private", "void", "getContent", "(", "Query", "query", ",", "Message", "message", ",", "int", "row", ")", "throws", "MessagingException", ",", "IOException", "{", "StringBuffer", "body", "=", "new", "StringBuffer", "(", ")", ";", "Struct", "cids", "=", "new...
write content data to query @param qry @param content @param row @throws MessagingException @throws IOException
[ "write", "content", "data", "to", "query" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/net/mail/MailClient.java#L451-L488
30,224
lucee/Lucee
core/src/main/java/lucee/transformer/bytecode/statement/TryCatchFinally.java
TryCatchFinally.setFinally
public void setFinally(Body body, Position finallyLine) { body.setParent(this); this.finallyBody = body; this.finallyLine = finallyLine; }
java
public void setFinally(Body body, Position finallyLine) { body.setParent(this); this.finallyBody = body; this.finallyLine = finallyLine; }
[ "public", "void", "setFinally", "(", "Body", "body", ",", "Position", "finallyLine", ")", "{", "body", ".", "setParent", "(", "this", ")", ";", "this", ".", "finallyBody", "=", "body", ";", "this", ".", "finallyLine", "=", "finallyLine", ";", "}" ]
sets finally body @param body
[ "sets", "finally", "body" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/bytecode/statement/TryCatchFinally.java#L97-L101
30,225
lucee/Lucee
core/src/main/java/lucee/transformer/bytecode/statement/tag/TagLoop.java
TagLoop.writeOutTypeCondition
private void writeOutTypeCondition(BytecodeContext bc) throws TransformerException { WhileVisitor whileVisitor = new WhileVisitor(); loopVisitor = whileVisitor; whileVisitor.visitBeforeExpression(bc); bc.getFactory().toExprBoolean(getAttribute("condition").getValue()).writeOut(bc, Expression.MODE_VALUE); whileVisitor.visitAfterExpressionBeforeBody(bc); getBody().writeOut(bc); whileVisitor.visitAfterBody(bc, getEnd()); }
java
private void writeOutTypeCondition(BytecodeContext bc) throws TransformerException { WhileVisitor whileVisitor = new WhileVisitor(); loopVisitor = whileVisitor; whileVisitor.visitBeforeExpression(bc); bc.getFactory().toExprBoolean(getAttribute("condition").getValue()).writeOut(bc, Expression.MODE_VALUE); whileVisitor.visitAfterExpressionBeforeBody(bc); getBody().writeOut(bc); whileVisitor.visitAfterBody(bc, getEnd()); }
[ "private", "void", "writeOutTypeCondition", "(", "BytecodeContext", "bc", ")", "throws", "TransformerException", "{", "WhileVisitor", "whileVisitor", "=", "new", "WhileVisitor", "(", ")", ";", "loopVisitor", "=", "whileVisitor", ";", "whileVisitor", ".", "visitBeforeE...
write out condition loop @param adapter @throws TemplateException
[ "write", "out", "condition", "loop" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/bytecode/statement/tag/TagLoop.java#L357-L366
30,226
lucee/Lucee
core/src/main/java/lucee/runtime/functions/other/Dump.java
Dump.call
public static String call(PageContext pc, Object object) throws PageException { return call(pc, object, null, true, 9999, null, null, null, null, 9999, true, true); }
java
public static String call(PageContext pc, Object object) throws PageException { return call(pc, object, null, true, 9999, null, null, null, null, 9999, true, true); }
[ "public", "static", "String", "call", "(", "PageContext", "pc", ",", "Object", "object", ")", "throws", "PageException", "{", "return", "call", "(", "pc", ",", "object", ",", "null", ",", "true", ",", "9999", ",", "null", ",", "null", ",", "null", ",",...
private static final int FORMAT_TYPE_TEXT = 1;
[ "private", "static", "final", "int", "FORMAT_TYPE_TEXT", "=", "1", ";" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/functions/other/Dump.java#L54-L56
30,227
lucee/Lucee
core/src/main/java/lucee/commons/io/res/type/compress/Compress.java
Compress.getInstance
public static Compress getInstance(Resource zipFile, int format, boolean caseSensitive) throws IOException { ConfigImpl config = (ConfigImpl) ThreadLocalPageContext.getConfig(); return config.getCompressInstance(zipFile, format, caseSensitive); }
java
public static Compress getInstance(Resource zipFile, int format, boolean caseSensitive) throws IOException { ConfigImpl config = (ConfigImpl) ThreadLocalPageContext.getConfig(); return config.getCompressInstance(zipFile, format, caseSensitive); }
[ "public", "static", "Compress", "getInstance", "(", "Resource", "zipFile", ",", "int", "format", ",", "boolean", "caseSensitive", ")", "throws", "IOException", "{", "ConfigImpl", "config", "=", "(", "ConfigImpl", ")", "ThreadLocalPageContext", ".", "getConfig", "(...
return zip instance matching the zipfile, singelton instance only 1 zip for one file @param zipFile @param format @param caseSensitive @return @throws IOException
[ "return", "zip", "instance", "matching", "the", "zipfile", "singelton", "instance", "only", "1", "zip", "for", "one", "file" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/io/res/type/compress/Compress.java#L90-L93
30,228
lucee/Lucee
core/src/main/java/lucee/runtime/tag/Setting.java
Setting.setRequesttimeout
public void setRequesttimeout(double requesttimeout) { long rt; if (requesttimeout <= 0) rt = Long.MAX_VALUE; else rt = (long) (requesttimeout * 1000); pageContext.setRequestTimeout(rt); }
java
public void setRequesttimeout(double requesttimeout) { long rt; if (requesttimeout <= 0) rt = Long.MAX_VALUE; else rt = (long) (requesttimeout * 1000); pageContext.setRequestTimeout(rt); }
[ "public", "void", "setRequesttimeout", "(", "double", "requesttimeout", ")", "{", "long", "rt", ";", "if", "(", "requesttimeout", "<=", "0", ")", "rt", "=", "Long", ".", "MAX_VALUE", ";", "else", "rt", "=", "(", "long", ")", "(", "requesttimeout", "*", ...
set the value requesttimeout @param requesttimeout value to set
[ "set", "the", "value", "requesttimeout" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/tag/Setting.java#L34-L40
30,229
lucee/Lucee
core/src/main/java/lucee/runtime/tag/Setting.java
Setting.setEnablecfoutputonly
public void setEnablecfoutputonly(Object enablecfoutputonly) throws PageException { if (enablecfoutputonly instanceof String && Caster.toString(enablecfoutputonly).trim().equalsIgnoreCase("reset")) { pageContext.setCFOutputOnly((short) 0); } else { pageContext.setCFOutputOnly(Caster.toBooleanValue(enablecfoutputonly)); } }
java
public void setEnablecfoutputonly(Object enablecfoutputonly) throws PageException { if (enablecfoutputonly instanceof String && Caster.toString(enablecfoutputonly).trim().equalsIgnoreCase("reset")) { pageContext.setCFOutputOnly((short) 0); } else { pageContext.setCFOutputOnly(Caster.toBooleanValue(enablecfoutputonly)); } }
[ "public", "void", "setEnablecfoutputonly", "(", "Object", "enablecfoutputonly", ")", "throws", "PageException", "{", "if", "(", "enablecfoutputonly", "instanceof", "String", "&&", "Caster", ".", "toString", "(", "enablecfoutputonly", ")", ".", "trim", "(", ")", "....
set the value enablecfoutputonly Yes or No. When set to Yes, cfsetting blocks output of HTML that resides outside cfoutput tags. @param enablecfoutputonly value to set @throws PageException
[ "set", "the", "value", "enablecfoutputonly", "Yes", "or", "No", ".", "When", "set", "to", "Yes", "cfsetting", "blocks", "output", "of", "HTML", "that", "resides", "outside", "cfoutput", "tags", "." ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/tag/Setting.java#L59-L66
30,230
lucee/Lucee
core/src/main/java/lucee/runtime/util/URLResolver.java
URLResolver.transform
public String transform(String html, URL url, boolean setBaseTag) throws PageException { StringBuffer target = new StringBuffer(); SourceCode cfml = new SourceCode(html, false, CFMLEngine.DIALECT_CFML); while (!cfml.isAfterLast()) { if (cfml.forwardIfCurrent('<')) { target.append('<'); try { for (int i = 0; i < tags.length; i++) { if (cfml.forwardIfCurrent(tags[i].tag + " ")) { target.append(tags[i].tag + " "); transformTag(target, cfml, tags[i], url); } } } catch (MalformedURLException me) { throw Caster.toPageException(me); } } else { target.append(cfml.getCurrent()); cfml.next(); } } if (!setBaseTag) return target.toString(); html = target.toString(); String prefix = "", postfix = ""; int index = StringUtil.indexOfIgnoreCase(html, "</head>"); if (index == -1) { prefix = "<head>"; postfix = "</head>"; index = StringUtil.indexOfIgnoreCase(html, "</html>"); } if (index != -1) { StringBuffer sb = new StringBuffer(); sb.append(html.substring(0, index)); String port = url.getPort() == -1 ? "" : ":" + url.getPort(); sb.append(prefix + "<base href=\"" + (url.getProtocol() + "://" + url.getHost() + port) + "\">" + postfix); sb.append(html.substring(index)); html = sb.toString(); } return html; }
java
public String transform(String html, URL url, boolean setBaseTag) throws PageException { StringBuffer target = new StringBuffer(); SourceCode cfml = new SourceCode(html, false, CFMLEngine.DIALECT_CFML); while (!cfml.isAfterLast()) { if (cfml.forwardIfCurrent('<')) { target.append('<'); try { for (int i = 0; i < tags.length; i++) { if (cfml.forwardIfCurrent(tags[i].tag + " ")) { target.append(tags[i].tag + " "); transformTag(target, cfml, tags[i], url); } } } catch (MalformedURLException me) { throw Caster.toPageException(me); } } else { target.append(cfml.getCurrent()); cfml.next(); } } if (!setBaseTag) return target.toString(); html = target.toString(); String prefix = "", postfix = ""; int index = StringUtil.indexOfIgnoreCase(html, "</head>"); if (index == -1) { prefix = "<head>"; postfix = "</head>"; index = StringUtil.indexOfIgnoreCase(html, "</html>"); } if (index != -1) { StringBuffer sb = new StringBuffer(); sb.append(html.substring(0, index)); String port = url.getPort() == -1 ? "" : ":" + url.getPort(); sb.append(prefix + "<base href=\"" + (url.getProtocol() + "://" + url.getHost() + port) + "\">" + postfix); sb.append(html.substring(index)); html = sb.toString(); } return html; }
[ "public", "String", "transform", "(", "String", "html", ",", "URL", "url", ",", "boolean", "setBaseTag", ")", "throws", "PageException", "{", "StringBuffer", "target", "=", "new", "StringBuffer", "(", ")", ";", "SourceCode", "cfml", "=", "new", "SourceCode", ...
transform the HTML String @param html HTML String to transform @param url Absolute URL path to set @return transformed HTMl String @throws PageException
[ "transform", "the", "HTML", "String" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/util/URLResolver.java#L102-L147
30,231
lucee/Lucee
core/src/main/java/lucee/runtime/db/DatasourceConnectionPool.java
DatasourceConnectionPool.getDatasourceConnection
public DatasourceConnection getDatasourceConnection(Config config, DataSource datasource, String user, String pass) throws PageException { config = ThreadLocalPageContext.getConfig(config); if (StringUtil.isEmpty(user)) { user = datasource.getUsername(); pass = datasource.getPassword(); } if (pass == null) pass = ""; // get stack DCStack stack = getDCStack(datasource, user, pass); int max = datasource.getConnectionLimit(); // get an existing connection DatasourceConnection rtn; boolean wait = false; outer: while (true) { rtn = null; // wait until it is again my turn if (wait) { SystemUtil.wait(waiter, WAIT); wait = false; } synchronized (stack) { // do we have already to many open connections? if (max != -1) { RefInteger _counter = stack.getCounter();// _getCounter(stack,datasource,user,pass); if (max <= _counter.toInt()) {// go back ant wait wait = true; continue outer; } } // get an existing connection while (!stack.isEmpty()) { DatasourceConnection dc = (DatasourceConnection) stack.get(); if (dc != null) { rtn = dc; break; } } _inc(stack, datasource, user, pass); // if new or fine we // increase in any case // create a new instance if (rtn == null) { try { rtn = loadDatasourceConnection(config, datasource, user, pass); } catch (PageException pe) { _dec(stack, datasource, user, pass); throw pe; } if (rtn instanceof DatasourceConnectionImpl) ((DatasourceConnectionImpl) rtn).using(); return rtn; } } // we get us a fine connection (we do validation outside the // synchronized to safe shared time) if (isValid(rtn, Boolean.TRUE)) { if (rtn instanceof DatasourceConnectionImpl) ((DatasourceConnectionImpl) rtn).using(); return rtn; } // we have an invalid connection (above check failed), so we have to // start over synchronized (stack) { _dec(stack, datasource, user, pass); // we already did increment // in case we are fine SystemUtil.notify(waiter); } IOUtil.closeEL(rtn.getConnection()); rtn = null; } }
java
public DatasourceConnection getDatasourceConnection(Config config, DataSource datasource, String user, String pass) throws PageException { config = ThreadLocalPageContext.getConfig(config); if (StringUtil.isEmpty(user)) { user = datasource.getUsername(); pass = datasource.getPassword(); } if (pass == null) pass = ""; // get stack DCStack stack = getDCStack(datasource, user, pass); int max = datasource.getConnectionLimit(); // get an existing connection DatasourceConnection rtn; boolean wait = false; outer: while (true) { rtn = null; // wait until it is again my turn if (wait) { SystemUtil.wait(waiter, WAIT); wait = false; } synchronized (stack) { // do we have already to many open connections? if (max != -1) { RefInteger _counter = stack.getCounter();// _getCounter(stack,datasource,user,pass); if (max <= _counter.toInt()) {// go back ant wait wait = true; continue outer; } } // get an existing connection while (!stack.isEmpty()) { DatasourceConnection dc = (DatasourceConnection) stack.get(); if (dc != null) { rtn = dc; break; } } _inc(stack, datasource, user, pass); // if new or fine we // increase in any case // create a new instance if (rtn == null) { try { rtn = loadDatasourceConnection(config, datasource, user, pass); } catch (PageException pe) { _dec(stack, datasource, user, pass); throw pe; } if (rtn instanceof DatasourceConnectionImpl) ((DatasourceConnectionImpl) rtn).using(); return rtn; } } // we get us a fine connection (we do validation outside the // synchronized to safe shared time) if (isValid(rtn, Boolean.TRUE)) { if (rtn instanceof DatasourceConnectionImpl) ((DatasourceConnectionImpl) rtn).using(); return rtn; } // we have an invalid connection (above check failed), so we have to // start over synchronized (stack) { _dec(stack, datasource, user, pass); // we already did increment // in case we are fine SystemUtil.notify(waiter); } IOUtil.closeEL(rtn.getConnection()); rtn = null; } }
[ "public", "DatasourceConnection", "getDatasourceConnection", "(", "Config", "config", ",", "DataSource", "datasource", ",", "String", "user", ",", "String", "pass", ")", "throws", "PageException", "{", "config", "=", "ThreadLocalPageContext", ".", "getConfig", "(", ...
!!! do not change used in hibernate extension
[ "!!!", "do", "not", "change", "used", "in", "hibernate", "extension" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/db/DatasourceConnectionPool.java#L52-L129
30,232
lucee/Lucee
core/src/main/java/lucee/runtime/db/DatasourceConnectionPool.java
DatasourceConnectionPool.openConnections
public Map<String, Integer> openConnections() { Map<String, Integer> map = new HashMap<String, Integer>(); Iterator<DCStack> it = dcs.values().iterator(); // all connections in pool DCStack dcstack; while (it.hasNext()) { dcstack = it.next(); Integer val = map.get(dcstack.getDatasource().getName()); if (val == null) val = dcstack.openConnections(); else val = val.intValue() + dcstack.openConnections(); map.put(dcstack.getDatasource().getName(), val); } return map; }
java
public Map<String, Integer> openConnections() { Map<String, Integer> map = new HashMap<String, Integer>(); Iterator<DCStack> it = dcs.values().iterator(); // all connections in pool DCStack dcstack; while (it.hasNext()) { dcstack = it.next(); Integer val = map.get(dcstack.getDatasource().getName()); if (val == null) val = dcstack.openConnections(); else val = val.intValue() + dcstack.openConnections(); map.put(dcstack.getDatasource().getName(), val); } return map; }
[ "public", "Map", "<", "String", ",", "Integer", ">", "openConnections", "(", ")", "{", "Map", "<", "String", ",", "Integer", ">", "map", "=", "new", "HashMap", "<", "String", ",", "Integer", ">", "(", ")", ";", "Iterator", "<", "DCStack", ">", "it", ...
do not change interface, used by argus monitor
[ "do", "not", "change", "interface", "used", "by", "argus", "monitor" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/db/DatasourceConnectionPool.java#L315-L329
30,233
lucee/Lucee
core/src/main/java/lucee/runtime/type/util/ListUtil.java
ListUtil.listToArray
public static Array listToArray(String list, char delimiter) { if (list.length() == 0) return new ArrayImpl(); int len = list.length(); int last = 0; Array array = new ArrayImpl(); try { for (int i = 0; i < len; i++) { if (list.charAt(i) == delimiter) { array.append(list.substring(last, i)); last = i + 1; } } if (last <= len) array.append(list.substring(last)); } catch (PageException e) {} return array; }
java
public static Array listToArray(String list, char delimiter) { if (list.length() == 0) return new ArrayImpl(); int len = list.length(); int last = 0; Array array = new ArrayImpl(); try { for (int i = 0; i < len; i++) { if (list.charAt(i) == delimiter) { array.append(list.substring(last, i)); last = i + 1; } } if (last <= len) array.append(list.substring(last)); } catch (PageException e) {} return array; }
[ "public", "static", "Array", "listToArray", "(", "String", "list", ",", "char", "delimiter", ")", "{", "if", "(", "list", ".", "length", "(", ")", "==", "0", ")", "return", "new", "ArrayImpl", "(", ")", ";", "int", "len", "=", "list", ".", "length", ...
casts a list to Array object @param list list to cast @param delimiter delimter of the list @return Array Object
[ "casts", "a", "list", "to", "Array", "object" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/util/ListUtil.java#L164-L181
30,234
lucee/Lucee
core/src/main/java/lucee/runtime/type/util/ListUtil.java
ListUtil.listToArrayRemoveEmpty
public static Array listToArrayRemoveEmpty(String list, char delimiter) { int len = list.length(); ArrayImpl array = new ArrayImpl(); if (len == 0) return array; int last = 0; for (int i = 0; i < len; i++) { if (list.charAt(i) == delimiter) { if (last < i) array.appendEL(list.substring(last, i)); last = i + 1; } } if (last < len) array.appendEL(list.substring(last)); return array; }
java
public static Array listToArrayRemoveEmpty(String list, char delimiter) { int len = list.length(); ArrayImpl array = new ArrayImpl(); if (len == 0) return array; int last = 0; for (int i = 0; i < len; i++) { if (list.charAt(i) == delimiter) { if (last < i) array.appendEL(list.substring(last, i)); last = i + 1; } } if (last < len) array.appendEL(list.substring(last)); return array; }
[ "public", "static", "Array", "listToArrayRemoveEmpty", "(", "String", "list", ",", "char", "delimiter", ")", "{", "int", "len", "=", "list", ".", "length", "(", ")", ";", "ArrayImpl", "array", "=", "new", "ArrayImpl", "(", ")", ";", "if", "(", "len", "...
casts a list to Array object remove Empty Elements @param list list to cast @param delimiter delimter of the list @return Array Object
[ "casts", "a", "list", "to", "Array", "object", "remove", "Empty", "Elements" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/util/ListUtil.java#L247-L262
30,235
lucee/Lucee
core/src/main/java/lucee/runtime/type/util/ListUtil.java
ListUtil.listToArrayTrim
public static Array listToArrayTrim(String list, char delimiter) { if (list.length() == 0) return new ArrayImpl(); // remove at start while (list.indexOf(delimiter) == 0) { list = list.substring(1); } int len = list.length(); if (len == 0) return new ArrayImpl(); while (list.lastIndexOf(delimiter) == len - 1) { list = list.substring(0, len - 1 < 0 ? 0 : len - 1); len = list.length(); } return listToArray(list, delimiter); }
java
public static Array listToArrayTrim(String list, char delimiter) { if (list.length() == 0) return new ArrayImpl(); // remove at start while (list.indexOf(delimiter) == 0) { list = list.substring(1); } int len = list.length(); if (len == 0) return new ArrayImpl(); while (list.lastIndexOf(delimiter) == len - 1) { list = list.substring(0, len - 1 < 0 ? 0 : len - 1); len = list.length(); } return listToArray(list, delimiter); }
[ "public", "static", "Array", "listToArrayTrim", "(", "String", "list", ",", "char", "delimiter", ")", "{", "if", "(", "list", ".", "length", "(", ")", "==", "0", ")", "return", "new", "ArrayImpl", "(", ")", ";", "// remove at start", "while", "(", "list"...
casts a list to Array object, remove all empty items at start and end of the list @param list list to cast @param delimiter delimter of the list @return Array Object
[ "casts", "a", "list", "to", "Array", "object", "remove", "all", "empty", "items", "at", "start", "and", "end", "of", "the", "list" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/util/ListUtil.java#L486-L499
30,236
lucee/Lucee
core/src/main/java/lucee/runtime/type/util/ListUtil.java
ListUtil.listFind
public static int listFind(String list, String value, String delimiter) { Array arr = listToArrayTrim(list, delimiter); int len = arr.size(); for (int i = 1; i <= len; i++) { if (arr.get(i, "").equals(value)) return i - 1; } return -1; }
java
public static int listFind(String list, String value, String delimiter) { Array arr = listToArrayTrim(list, delimiter); int len = arr.size(); for (int i = 1; i <= len; i++) { if (arr.get(i, "").equals(value)) return i - 1; } return -1; }
[ "public", "static", "int", "listFind", "(", "String", "list", ",", "String", "value", ",", "String", "delimiter", ")", "{", "Array", "arr", "=", "listToArrayTrim", "(", "list", ",", "delimiter", ")", ";", "int", "len", "=", "arr", ".", "size", "(", ")"...
finds a value inside a list, do not case sensitive @param list list to search @param value value to find @param delimiter delimiter of the list @return position in list or 0
[ "finds", "a", "value", "inside", "a", "list", "do", "not", "case", "sensitive" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/util/ListUtil.java#L729-L737
30,237
lucee/Lucee
core/src/main/java/lucee/runtime/type/util/ListUtil.java
ListUtil.listFindIgnoreEmpty
public static int listFindIgnoreEmpty(String list, String value, char delimiter) { if (list == null) return -1; int len = list.length(); if (len == 0) return -1; int last = 0; int count = 0; for (int i = 0; i < len; i++) { if (list.charAt(i) == delimiter) { if (last < i) { if (list.substring(last, i).equals(value)) return count; count++; } last = i + 1; } } if (last < len) { if (list.substring(last).equals(value)) return count; } return -1; }
java
public static int listFindIgnoreEmpty(String list, String value, char delimiter) { if (list == null) return -1; int len = list.length(); if (len == 0) return -1; int last = 0; int count = 0; for (int i = 0; i < len; i++) { if (list.charAt(i) == delimiter) { if (last < i) { if (list.substring(last, i).equals(value)) return count; count++; } last = i + 1; } } if (last < len) { if (list.substring(last).equals(value)) return count; } return -1; }
[ "public", "static", "int", "listFindIgnoreEmpty", "(", "String", "list", ",", "String", "value", ",", "char", "delimiter", ")", "{", "if", "(", "list", "==", "null", ")", "return", "-", "1", ";", "int", "len", "=", "list", ".", "length", "(", ")", ";...
finds a value inside a list, case sensitive, ignore empty items @param list list to search @param value value to find @param delimiter delimiter of the list @return position in list or 0
[ "finds", "a", "value", "inside", "a", "list", "case", "sensitive", "ignore", "empty", "items" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/util/ListUtil.java#L784-L804
30,238
lucee/Lucee
core/src/main/java/lucee/runtime/type/util/ListUtil.java
ListUtil.listContainsNoCase
public static int listContainsNoCase(String list, String value, String delimiter, boolean includeEmptyFields, boolean multiCharacterDelimiter) { if (StringUtil.isEmpty(value)) return -1; Array arr = listToArray(list, delimiter, includeEmptyFields, multiCharacterDelimiter); int len = arr.size(); for (int i = 1; i <= len; i++) { if (StringUtil.indexOfIgnoreCase(arr.get(i, "").toString(), value) != -1) return i - 1; } return -1; }
java
public static int listContainsNoCase(String list, String value, String delimiter, boolean includeEmptyFields, boolean multiCharacterDelimiter) { if (StringUtil.isEmpty(value)) return -1; Array arr = listToArray(list, delimiter, includeEmptyFields, multiCharacterDelimiter); int len = arr.size(); for (int i = 1; i <= len; i++) { if (StringUtil.indexOfIgnoreCase(arr.get(i, "").toString(), value) != -1) return i - 1; } return -1; }
[ "public", "static", "int", "listContainsNoCase", "(", "String", "list", ",", "String", "value", ",", "String", "delimiter", ",", "boolean", "includeEmptyFields", ",", "boolean", "multiCharacterDelimiter", ")", "{", "if", "(", "StringUtil", ".", "isEmpty", "(", "...
returns if a value of the list contains given value, ignore case @param list list to search in @param value value to serach @param delimiter delimiter of the list @return position in list or 0
[ "returns", "if", "a", "value", "of", "the", "list", "contains", "given", "value", "ignore", "case" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/util/ListUtil.java#L814-L824
30,239
lucee/Lucee
core/src/main/java/lucee/runtime/type/util/ListUtil.java
ListUtil.arrayToListTrim
public static String arrayToListTrim(String[] array, String delimiter) { return trim(arrayToList(array, delimiter), delimiter, false); }
java
public static String arrayToListTrim(String[] array, String delimiter) { return trim(arrayToList(array, delimiter), delimiter, false); }
[ "public", "static", "String", "arrayToListTrim", "(", "String", "[", "]", "array", ",", "String", "delimiter", ")", "{", "return", "trim", "(", "arrayToList", "(", "array", ",", "delimiter", ")", ",", "delimiter", ",", "false", ")", ";", "}" ]
convert a string array to string list, removes empty values at begin and end of the list @param array array to convert @param delimiter delimiter for the new list @return list generated from string array
[ "convert", "a", "string", "array", "to", "string", "list", "removes", "empty", "values", "at", "begin", "and", "end", "of", "the", "list" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/util/ListUtil.java#L890-L892
30,240
lucee/Lucee
core/src/main/java/lucee/runtime/type/util/ListUtil.java
ListUtil.arrayToList
public static String arrayToList(String[] array, String delimiter) { if (ArrayUtil.isEmpty(array)) return ""; StringBuilder sb = new StringBuilder(array[0]); if (delimiter.length() == 1) { char c = delimiter.charAt(0); for (int i = 1; i < array.length; i++) { sb.append(c); sb.append(array[i]); } } else { for (int i = 1; i < array.length; i++) { sb.append(delimiter); sb.append(array[i]); } } return sb.toString(); }
java
public static String arrayToList(String[] array, String delimiter) { if (ArrayUtil.isEmpty(array)) return ""; StringBuilder sb = new StringBuilder(array[0]); if (delimiter.length() == 1) { char c = delimiter.charAt(0); for (int i = 1; i < array.length; i++) { sb.append(c); sb.append(array[i]); } } else { for (int i = 1; i < array.length; i++) { sb.append(delimiter); sb.append(array[i]); } } return sb.toString(); }
[ "public", "static", "String", "arrayToList", "(", "String", "[", "]", "array", ",", "String", "delimiter", ")", "{", "if", "(", "ArrayUtil", ".", "isEmpty", "(", "array", ")", ")", "return", "\"\"", ";", "StringBuilder", "sb", "=", "new", "StringBuilder", ...
convert a string array to string list @param array array to convert @param delimiter delimiter for the new list @return list generated from string array
[ "convert", "a", "string", "array", "to", "string", "list" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/util/ListUtil.java#L901-L920
30,241
lucee/Lucee
core/src/main/java/lucee/runtime/type/util/ListUtil.java
ListUtil.arrayToList
public static String arrayToList(Array array, String delimiter) throws PageException { if (array.size() == 0) return ""; StringBuilder sb = new StringBuilder(Caster.toString(array.get(1, ""))); int len = array.size(); for (int i = 2; i <= len; i++) { sb.append(delimiter); sb.append(Caster.toString(array.get(i, ""))); } return sb.toString(); }
java
public static String arrayToList(Array array, String delimiter) throws PageException { if (array.size() == 0) return ""; StringBuilder sb = new StringBuilder(Caster.toString(array.get(1, ""))); int len = array.size(); for (int i = 2; i <= len; i++) { sb.append(delimiter); sb.append(Caster.toString(array.get(i, ""))); } return sb.toString(); }
[ "public", "static", "String", "arrayToList", "(", "Array", "array", ",", "String", "delimiter", ")", "throws", "PageException", "{", "if", "(", "array", ".", "size", "(", ")", "==", "0", ")", "return", "\"\"", ";", "StringBuilder", "sb", "=", "new", "Str...
convert Array Object to string list @param array array to convert @param delimiter delimiter for the new list @return list generated from string array @throws PageException
[ "convert", "Array", "Object", "to", "string", "list" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/util/ListUtil.java#L951-L961
30,242
lucee/Lucee
core/src/main/java/lucee/runtime/type/util/ListUtil.java
ListUtil.trim
public static String[] trim(String[] array) { int from = 0; int to = 0; // test start for (int i = 0; i < array.length; i++) { from = i; if (array[i].length() != 0) break; } // test end for (int i = array.length - 1; i >= 0; i--) { to = i; if (array[i].length() != 0) break; } int newLen = to - from + 1; if (newLen < array.length) { String[] rtn = new String[newLen]; System.arraycopy(array, from, rtn, 0, newLen); return rtn; } return array; }
java
public static String[] trim(String[] array) { int from = 0; int to = 0; // test start for (int i = 0; i < array.length; i++) { from = i; if (array[i].length() != 0) break; } // test end for (int i = array.length - 1; i >= 0; i--) { to = i; if (array[i].length() != 0) break; } int newLen = to - from + 1; if (newLen < array.length) { String[] rtn = new String[newLen]; System.arraycopy(array, from, rtn, 0, newLen); return rtn; } return array; }
[ "public", "static", "String", "[", "]", "trim", "(", "String", "[", "]", "array", ")", "{", "int", "from", "=", "0", ";", "int", "to", "=", "0", ";", "// test start", "for", "(", "int", "i", "=", "0", ";", "i", "<", "array", ".", "length", ";",...
trims a string array, removes all empty array positions at the start and the end of the array @param array array to remove elements @return cleared array
[ "trims", "a", "string", "array", "removes", "all", "empty", "array", "positions", "at", "the", "start", "and", "the", "end", "of", "the", "array" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/util/ListUtil.java#L1011-L1035
30,243
lucee/Lucee
core/src/main/java/lucee/runtime/type/util/ListUtil.java
ListUtil.toStringArrayTrim
public static String[] toStringArrayTrim(Array array) throws PageException { String[] arr = new String[array.size()]; for (int i = 0; i < arr.length; i++) { arr[i] = Caster.toString(array.get(i + 1, "")).trim(); } return arr; }
java
public static String[] toStringArrayTrim(Array array) throws PageException { String[] arr = new String[array.size()]; for (int i = 0; i < arr.length; i++) { arr[i] = Caster.toString(array.get(i + 1, "")).trim(); } return arr; }
[ "public", "static", "String", "[", "]", "toStringArrayTrim", "(", "Array", "array", ")", "throws", "PageException", "{", "String", "[", "]", "arr", "=", "new", "String", "[", "array", ".", "size", "(", ")", "]", ";", "for", "(", "int", "i", "=", "0",...
cast a Object Array to a String Array and trim all values @param array @return String Array @throws PageException
[ "cast", "a", "Object", "Array", "to", "a", "String", "Array", "and", "trim", "all", "values" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/util/ListUtil.java#L1234-L1241
30,244
lucee/Lucee
core/src/main/java/lucee/runtime/type/util/ListUtil.java
ListUtil.first
@Deprecated public static String first(String list, String delimiter) { return first(list, delimiter, true, 1); }
java
@Deprecated public static String first(String list, String delimiter) { return first(list, delimiter, true, 1); }
[ "@", "Deprecated", "public", "static", "String", "first", "(", "String", "list", ",", "String", "delimiter", ")", "{", "return", "first", "(", "list", ",", "delimiter", ",", "true", ",", "1", ")", ";", "}" ]
return first element of the list @param list @param delimiter @return returns the first element of the list @deprecated use instead first(String list, String delimiter, boolean ignoreEmpty)
[ "return", "first", "element", "of", "the", "list" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/util/ListUtil.java#L1251-L1254
30,245
lucee/Lucee
core/src/main/java/lucee/runtime/type/util/ListUtil.java
ListUtil.getAt
public static String getAt(String list, String delimiter, int position, boolean ignoreEmpty, String defaultValue) { if (delimiter.length() == 1) return getAt(list, delimiter.charAt(0), position, ignoreEmpty, defaultValue); int len = list.length(); if (len == 0) return defaultValue; int last = -1; int count = -1; char[] del = delimiter.toCharArray(); char c; for (int i = 0; i < len; i++) { c = list.charAt(i); for (int y = 0; y < del.length; y++) { if (c == del[y]) { if (ignoreEmpty && (last + 1) == i) { last = i; break; } count++; if (count == position) { return list.substring(last + 1, i); } last = i; break; } } } if (position == count + 1) { if (!ignoreEmpty || last + 1 < len) return list.substring(last + 1); } return defaultValue; }
java
public static String getAt(String list, String delimiter, int position, boolean ignoreEmpty, String defaultValue) { if (delimiter.length() == 1) return getAt(list, delimiter.charAt(0), position, ignoreEmpty, defaultValue); int len = list.length(); if (len == 0) return defaultValue; int last = -1; int count = -1; char[] del = delimiter.toCharArray(); char c; for (int i = 0; i < len; i++) { c = list.charAt(i); for (int y = 0; y < del.length; y++) { if (c == del[y]) { if (ignoreEmpty && (last + 1) == i) { last = i; break; } count++; if (count == position) { return list.substring(last + 1, i); } last = i; break; } } } if (position == count + 1) { if (!ignoreEmpty || last + 1 < len) return list.substring(last + 1); } return defaultValue; }
[ "public", "static", "String", "getAt", "(", "String", "list", ",", "String", "delimiter", ",", "int", "position", ",", "boolean", "ignoreEmpty", ",", "String", "defaultValue", ")", "{", "if", "(", "delimiter", ".", "length", "(", ")", "==", "1", ")", "re...
gets a value from list @param list list to cast @param delimiter delimter of the list @param position @return Array Object
[ "gets", "a", "value", "from", "list" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/util/ListUtil.java#L1413-L1446
30,246
lucee/Lucee
core/src/main/java/lucee/runtime/type/util/ListUtil.java
ListUtil.getAt
public static String getAt(String list, char delimiter, int position, boolean ignoreEmpty, String defaultValue) { int len = list.length(); if (len == 0) return defaultValue; int last = -1; int count = -1; for (int i = 0; i < len; i++) { // char == delimiter if (list.charAt(i) == delimiter) { if (ignoreEmpty && (last + 1) == i) { last = i; continue; } count++; if (count == position) { return list.substring(last + 1, i); } last = i; } } if (position == count + 1) { if (!ignoreEmpty || last + 1 < len) return list.substring(last + 1); } return defaultValue; }
java
public static String getAt(String list, char delimiter, int position, boolean ignoreEmpty, String defaultValue) { int len = list.length(); if (len == 0) return defaultValue; int last = -1; int count = -1; for (int i = 0; i < len; i++) { // char == delimiter if (list.charAt(i) == delimiter) { if (ignoreEmpty && (last + 1) == i) { last = i; continue; } count++; if (count == position) { return list.substring(last + 1, i); } last = i; } } if (position == count + 1) { if (!ignoreEmpty || last + 1 < len) return list.substring(last + 1); } return defaultValue; }
[ "public", "static", "String", "getAt", "(", "String", "list", ",", "char", "delimiter", ",", "int", "position", ",", "boolean", "ignoreEmpty", ",", "String", "defaultValue", ")", "{", "int", "len", "=", "list", ".", "length", "(", ")", ";", "if", "(", ...
get a elemnt at a specified position in list @param list list to cast @param delimiter delimter of the list @param position @return Array Object
[ "get", "a", "elemnt", "at", "a", "specified", "position", "in", "list" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/util/ListUtil.java#L1456-L1482
30,247
lucee/Lucee
core/src/main/java/lucee/runtime/type/util/ListUtil.java
ListUtil.getDelimIndex
public static int getDelimIndex(StringBuilder sb, int itemPos, char[] delims, boolean ignoreEmpty) { if (StringUtil.isEmpty(sb)) return -1; int curr = -1, listIndex = 0; int len = sb.length(); for (int i = 0; i < len; i++) { if (contains(delims, sb.charAt(i))) { curr = i; if (ignoreEmpty) { if (i == 0 || (i + 1 < len && contains(delims, sb.charAt(i + 1)))) { sb.delete(curr, curr + 1); len--; i--; curr--; continue; } } if (++listIndex == itemPos) break; } } if (listIndex < itemPos) return len; return curr; }
java
public static int getDelimIndex(StringBuilder sb, int itemPos, char[] delims, boolean ignoreEmpty) { if (StringUtil.isEmpty(sb)) return -1; int curr = -1, listIndex = 0; int len = sb.length(); for (int i = 0; i < len; i++) { if (contains(delims, sb.charAt(i))) { curr = i; if (ignoreEmpty) { if (i == 0 || (i + 1 < len && contains(delims, sb.charAt(i + 1)))) { sb.delete(curr, curr + 1); len--; i--; curr--; continue; } } if (++listIndex == itemPos) break; } } if (listIndex < itemPos) return len; return curr; }
[ "public", "static", "int", "getDelimIndex", "(", "StringBuilder", "sb", ",", "int", "itemPos", ",", "char", "[", "]", "delims", ",", "boolean", "ignoreEmpty", ")", "{", "if", "(", "StringUtil", ".", "isEmpty", "(", "sb", ")", ")", "return", "-", "1", "...
returns the 0-based delimiter position for the specified item @param list @param itemPos @param ignoreEmpty @return
[ "returns", "the", "0", "-", "based", "delimiter", "position", "for", "the", "specified", "item" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/util/ListUtil.java#L1635-L1658
30,248
lucee/Lucee
core/src/main/java/lucee/transformer/cfml/expression/AbstrCFMLExprTransformer.java
AbstrCFMLExprTransformer.init
protected Data init(Data data) { if (JSON_ARRAY == null) JSON_ARRAY = getFLF(data, "_literalArray"); if (JSON_STRUCT == null) JSON_STRUCT = getFLF(data, "_literalStruct"); if (GET_STATIC_SCOPE == null) GET_STATIC_SCOPE = getFLF(data, "_getStaticScope"); if (GET_SUPER_STATIC_SCOPE == null) GET_SUPER_STATIC_SCOPE = getFLF(data, "_getSuperStaticScope"); return data; }
java
protected Data init(Data data) { if (JSON_ARRAY == null) JSON_ARRAY = getFLF(data, "_literalArray"); if (JSON_STRUCT == null) JSON_STRUCT = getFLF(data, "_literalStruct"); if (GET_STATIC_SCOPE == null) GET_STATIC_SCOPE = getFLF(data, "_getStaticScope"); if (GET_SUPER_STATIC_SCOPE == null) GET_SUPER_STATIC_SCOPE = getFLF(data, "_getSuperStaticScope"); return data; }
[ "protected", "Data", "init", "(", "Data", "data", ")", "{", "if", "(", "JSON_ARRAY", "==", "null", ")", "JSON_ARRAY", "=", "getFLF", "(", "data", ",", "\"_literalArray\"", ")", ";", "if", "(", "JSON_STRUCT", "==", "null", ")", "JSON_STRUCT", "=", "getFLF...
Initialmethode, wird aufgerufen um den internen Zustand des Objektes zu setzten. @param fld Function Libraries zum validieren der Funktionen @param cfml CFML Code der transfomiert werden soll.
[ "Initialmethode", "wird", "aufgerufen", "um", "den", "internen", "Zustand", "des", "Objektes", "zu", "setzten", "." ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/cfml/expression/AbstrCFMLExprTransformer.java#L245-L251
30,249
lucee/Lucee
core/src/main/java/lucee/runtime/net/mail/SMTPVerifier.java
SMTPVerifier.verify
public static boolean verify(String host, String username, String password, int port) throws SMTPException { try { return _verify(host, username, password, port); } catch (MessagingException e) { // check user if (!StringUtil.isEmpty(username)) { try { _verify(host, null, null, port); throw new SMTPExceptionImpl("can't connect to mail server, authentication settings are invalid"); } catch (MessagingException e1) { } } // check port if (port > 0 && port != 25) { try { _verify(host, null, null, 25); throw new SMTPExceptionImpl("can't connect to mail server, port definition is invalid"); } catch (MessagingException e1) {} } throw new SMTPExceptionImpl("can't connect to mail server"); } }
java
public static boolean verify(String host, String username, String password, int port) throws SMTPException { try { return _verify(host, username, password, port); } catch (MessagingException e) { // check user if (!StringUtil.isEmpty(username)) { try { _verify(host, null, null, port); throw new SMTPExceptionImpl("can't connect to mail server, authentication settings are invalid"); } catch (MessagingException e1) { } } // check port if (port > 0 && port != 25) { try { _verify(host, null, null, 25); throw new SMTPExceptionImpl("can't connect to mail server, port definition is invalid"); } catch (MessagingException e1) {} } throw new SMTPExceptionImpl("can't connect to mail server"); } }
[ "public", "static", "boolean", "verify", "(", "String", "host", ",", "String", "username", ",", "String", "password", ",", "int", "port", ")", "throws", "SMTPException", "{", "try", "{", "return", "_verify", "(", "host", ",", "username", ",", "password", "...
verify mail server @param host @param username @param password @param port @return are the setting ok @throws SMTPException
[ "verify", "mail", "server" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/net/mail/SMTPVerifier.java#L47-L74
30,250
lucee/Lucee
core/src/main/java/lucee/runtime/config/ConfigServerImpl.java
ConfigServerImpl.getConfigWebImpl
protected ConfigWebImpl getConfigWebImpl(String realpath) { Iterator<String> it = initContextes.keySet().iterator(); while (it.hasNext()) { ConfigWebImpl cw = ((CFMLFactoryImpl) initContextes.get(it.next())).getConfigWebImpl(); if (ReqRspUtil.getRootPath(cw.getServletContext()).equals(realpath)) return cw; } return null; }
java
protected ConfigWebImpl getConfigWebImpl(String realpath) { Iterator<String> it = initContextes.keySet().iterator(); while (it.hasNext()) { ConfigWebImpl cw = ((CFMLFactoryImpl) initContextes.get(it.next())).getConfigWebImpl(); if (ReqRspUtil.getRootPath(cw.getServletContext()).equals(realpath)) return cw; } return null; }
[ "protected", "ConfigWebImpl", "getConfigWebImpl", "(", "String", "realpath", ")", "{", "Iterator", "<", "String", ">", "it", "=", "initContextes", ".", "keySet", "(", ")", ".", "iterator", "(", ")", ";", "while", "(", "it", ".", "hasNext", "(", ")", ")",...
returns CongigWeb Implementtion @param realpath @return ConfigWebImpl
[ "returns", "CongigWeb", "Implementtion" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/ConfigServerImpl.java#L208-L215
30,251
lucee/Lucee
core/src/main/java/lucee/runtime/type/scope/ScopeSupport.java
ScopeSupport.fillDecoded
protected void fillDecoded(URLItem[] raw, String encoding, boolean scriptProteced, boolean sameAsArray) throws UnsupportedEncodingException { clear(); String name, value; // Object curr; for (int i = 0; i < raw.length; i++) { name = raw[i].getName(); value = raw[i].getValue(); if (raw[i].isUrlEncoded()) { name = URLDecoder.decode(name, encoding, true); value = URLDecoder.decode(value, encoding, true); } // MUST valueStruct if (name.indexOf('.') != -1) { StringList list = ListUtil.listToStringListRemoveEmpty(name, '.'); if (list.size() > 0) { Struct parent = this; while (list.hasNextNext()) { parent = _fill(parent, list.next(), new CastableStruct(Struct.TYPE_LINKED), false, scriptProteced, sameAsArray); } _fill(parent, list.next(), value, true, scriptProteced, sameAsArray); } } // else _fill(this, name, value, true, scriptProteced, sameAsArray); } }
java
protected void fillDecoded(URLItem[] raw, String encoding, boolean scriptProteced, boolean sameAsArray) throws UnsupportedEncodingException { clear(); String name, value; // Object curr; for (int i = 0; i < raw.length; i++) { name = raw[i].getName(); value = raw[i].getValue(); if (raw[i].isUrlEncoded()) { name = URLDecoder.decode(name, encoding, true); value = URLDecoder.decode(value, encoding, true); } // MUST valueStruct if (name.indexOf('.') != -1) { StringList list = ListUtil.listToStringListRemoveEmpty(name, '.'); if (list.size() > 0) { Struct parent = this; while (list.hasNextNext()) { parent = _fill(parent, list.next(), new CastableStruct(Struct.TYPE_LINKED), false, scriptProteced, sameAsArray); } _fill(parent, list.next(), value, true, scriptProteced, sameAsArray); } } // else _fill(this, name, value, true, scriptProteced, sameAsArray); } }
[ "protected", "void", "fillDecoded", "(", "URLItem", "[", "]", "raw", ",", "String", "encoding", ",", "boolean", "scriptProteced", ",", "boolean", "sameAsArray", ")", "throws", "UnsupportedEncodingException", "{", "clear", "(", ")", ";", "String", "name", ",", ...
fill th data from given strut and decode it @param raw @param encoding @throws UnsupportedEncodingException
[ "fill", "th", "data", "from", "given", "strut", "and", "decode", "it" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/scope/ScopeSupport.java#L172-L198
30,252
lucee/Lucee
core/src/main/java/lucee/runtime/tag/HttpParam.java
HttpParam.setType
public void setType(String type) throws ApplicationException { if (StringUtil.isEmpty(type, true)) return; type = type.toLowerCase().trim(); if (type.equals("url")) param.setType(HttpParamBean.TYPE_URL); else if (type.equals("formfield") || type.equals("form")) param.setType(HttpParamBean.TYPE_FORM); else if (type.equals("cgi")) param.setType(HttpParamBean.TYPE_CGI); else if (type.startsWith("head") || type.startsWith("header")) param.setType(HttpParamBean.TYPE_HEADER); else if (type.equals("cookie")) param.setType(HttpParamBean.TYPE_COOKIE); else if (type.equals("file")) param.setType(HttpParamBean.TYPE_FILE); else if (type.equals("xml")) param.setType(HttpParamBean.TYPE_XML); else if (type.equals("body")) param.setType(HttpParamBean.TYPE_BODY); else throw new ApplicationException("invalid type [" + type + "], valid types are [body,cgi,cookie,file,form,head,url,xml]"); }
java
public void setType(String type) throws ApplicationException { if (StringUtil.isEmpty(type, true)) return; type = type.toLowerCase().trim(); if (type.equals("url")) param.setType(HttpParamBean.TYPE_URL); else if (type.equals("formfield") || type.equals("form")) param.setType(HttpParamBean.TYPE_FORM); else if (type.equals("cgi")) param.setType(HttpParamBean.TYPE_CGI); else if (type.startsWith("head") || type.startsWith("header")) param.setType(HttpParamBean.TYPE_HEADER); else if (type.equals("cookie")) param.setType(HttpParamBean.TYPE_COOKIE); else if (type.equals("file")) param.setType(HttpParamBean.TYPE_FILE); else if (type.equals("xml")) param.setType(HttpParamBean.TYPE_XML); else if (type.equals("body")) param.setType(HttpParamBean.TYPE_BODY); else throw new ApplicationException("invalid type [" + type + "], valid types are [body,cgi,cookie,file,form,head,url,xml]"); }
[ "public", "void", "setType", "(", "String", "type", ")", "throws", "ApplicationException", "{", "if", "(", "StringUtil", ".", "isEmpty", "(", "type", ",", "true", ")", ")", "return", ";", "type", "=", "type", ".", "toLowerCase", "(", ")", ".", "trim", ...
set the value type The transaction type. @param type value to set @throws ApplicationException
[ "set", "the", "value", "type", "The", "transaction", "type", "." ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/tag/HttpParam.java#L77-L90
30,253
lucee/Lucee
core/src/main/java/lucee/runtime/sql/exp/ColumnExpression.java
ColumnExpression.getValue
@Override public Object getValue(Query qr, int row) throws PageException { if (col == null) col = qr.getColumn(getColumn()); return QueryUtil.getValue(col, row); }
java
@Override public Object getValue(Query qr, int row) throws PageException { if (col == null) col = qr.getColumn(getColumn()); return QueryUtil.getValue(col, row); }
[ "@", "Override", "public", "Object", "getValue", "(", "Query", "qr", ",", "int", "row", ")", "throws", "PageException", "{", "if", "(", "col", "==", "null", ")", "col", "=", "qr", ".", "getColumn", "(", "getColumn", "(", ")", ")", ";", "return", "Que...
MUST hanle null correctly
[ "MUST", "hanle", "null", "correctly" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/sql/exp/ColumnExpression.java#L107-L111
30,254
lucee/Lucee
core/src/main/java/lucee/transformer/bytecode/util/ASMUtil.java
ASMUtil.getParentTag
public static Tag getParentTag(Tag tag) { Statement p = tag.getParent(); if (p == null) return null; p = p.getParent(); if (p instanceof Tag) return (Tag) p; return null; }
java
public static Tag getParentTag(Tag tag) { Statement p = tag.getParent(); if (p == null) return null; p = p.getParent(); if (p instanceof Tag) return (Tag) p; return null; }
[ "public", "static", "Tag", "getParentTag", "(", "Tag", "tag", ")", "{", "Statement", "p", "=", "tag", ".", "getParent", "(", ")", ";", "if", "(", "p", "==", "null", ")", "return", "null", ";", "p", "=", "p", ".", "getParent", "(", ")", ";", "if",...
Gibt das uebergeordnete CFXD Tag Element zurueck, falls dies nicht existiert wird null zurueckgegeben. @param el Element von dem das parent Element zurueckgegeben werden soll. @return uebergeordnete CFXD Tag Element
[ "Gibt", "das", "uebergeordnete", "CFXD", "Tag", "Element", "zurueck", "falls", "dies", "nicht", "existiert", "wird", "null", "zurueckgegeben", "." ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/bytecode/util/ASMUtil.java#L130-L136
30,255
lucee/Lucee
core/src/main/java/lucee/transformer/bytecode/util/ASMUtil.java
ASMUtil.hasSisterTagAfter
public static boolean hasSisterTagAfter(Tag tag, String nameToFind) { Body body = (Body) tag.getParent(); List<Statement> stats = body.getStatements(); Iterator<Statement> it = stats.iterator(); Statement other; boolean isAfter = false; while (it.hasNext()) { other = it.next(); if (other instanceof Tag) { if (isAfter) { if (((Tag) other).getTagLibTag().getName().equals(nameToFind)) return true; } else if (other == tag) isAfter = true; } } return false; }
java
public static boolean hasSisterTagAfter(Tag tag, String nameToFind) { Body body = (Body) tag.getParent(); List<Statement> stats = body.getStatements(); Iterator<Statement> it = stats.iterator(); Statement other; boolean isAfter = false; while (it.hasNext()) { other = it.next(); if (other instanceof Tag) { if (isAfter) { if (((Tag) other).getTagLibTag().getName().equals(nameToFind)) return true; } else if (other == tag) isAfter = true; } } return false; }
[ "public", "static", "boolean", "hasSisterTagAfter", "(", "Tag", "tag", ",", "String", "nameToFind", ")", "{", "Body", "body", "=", "(", "Body", ")", "tag", ".", "getParent", "(", ")", ";", "List", "<", "Statement", ">", "stats", "=", "body", ".", "getS...
Prueft ob das das angegebene Tag in der gleichen Ebene nach dem angegebenen Tag vorkommt. @param tag Ausgangspunkt, nach diesem tag darf das angegebene nicht vorkommen. @param nameToFind Tag Name der nicht vorkommen darf @return kommt das Tag vor.
[ "Prueft", "ob", "das", "das", "angegebene", "Tag", "in", "der", "gleichen", "Ebene", "nach", "dem", "angegebenen", "Tag", "vorkommt", "." ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/bytecode/util/ASMUtil.java#L398-L416
30,256
lucee/Lucee
core/src/main/java/lucee/transformer/bytecode/util/ASMUtil.java
ASMUtil.remove
public static void remove(Tag tag) { Body body = (Body) tag.getParent(); body.getStatements().remove(tag); }
java
public static void remove(Tag tag) { Body body = (Body) tag.getParent(); body.getStatements().remove(tag); }
[ "public", "static", "void", "remove", "(", "Tag", "tag", ")", "{", "Body", "body", "=", "(", "Body", ")", "tag", ".", "getParent", "(", ")", ";", "body", ".", "getStatements", "(", ")", ".", "remove", "(", "tag", ")", ";", "}" ]
remove this tag from his parent body @param tag
[ "remove", "this", "tag", "from", "his", "parent", "body" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/bytecode/util/ASMUtil.java#L445-L448
30,257
lucee/Lucee
core/src/main/java/lucee/transformer/bytecode/util/ASMUtil.java
ASMUtil.replace
public static void replace(Tag src, Tag trg, boolean moveBody) { trg.setParent(src.getParent()); Body p = (Body) src.getParent(); List<Statement> stats = p.getStatements(); Iterator<Statement> it = stats.iterator(); Statement stat; int count = 0; while (it.hasNext()) { stat = it.next(); if (stat == src) { if (moveBody && src.getBody() != null) src.getBody().setParent(trg); stats.set(count, trg); break; } count++; } }
java
public static void replace(Tag src, Tag trg, boolean moveBody) { trg.setParent(src.getParent()); Body p = (Body) src.getParent(); List<Statement> stats = p.getStatements(); Iterator<Statement> it = stats.iterator(); Statement stat; int count = 0; while (it.hasNext()) { stat = it.next(); if (stat == src) { if (moveBody && src.getBody() != null) src.getBody().setParent(trg); stats.set(count, trg); break; } count++; } }
[ "public", "static", "void", "replace", "(", "Tag", "src", ",", "Tag", "trg", ",", "boolean", "moveBody", ")", "{", "trg", ".", "setParent", "(", "src", ".", "getParent", "(", ")", ")", ";", "Body", "p", "=", "(", "Body", ")", "src", ".", "getParent...
replace src with trg @param src @param trg
[ "replace", "src", "with", "trg" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/bytecode/util/ASMUtil.java#L475-L493
30,258
lucee/Lucee
core/src/main/java/lucee/transformer/bytecode/util/ASMUtil.java
ASMUtil.toValueType
public static Type toValueType(Type type) { if (type == Types.BYTE) return Types.BYTE_VALUE; if (type == Types.BOOLEAN) return Types.BOOLEAN_VALUE; if (type == Types.CHARACTER) return Types.CHAR; if (type == Types.DOUBLE) return Types.DOUBLE_VALUE; if (type == Types.FLOAT) return Types.FLOAT_VALUE; if (type == Types.INTEGER) return Types.INT_VALUE; if (type == Types.LONG) return Types.LONG_VALUE; if (type == Types.SHORT) return Types.SHORT_VALUE; return type; }
java
public static Type toValueType(Type type) { if (type == Types.BYTE) return Types.BYTE_VALUE; if (type == Types.BOOLEAN) return Types.BOOLEAN_VALUE; if (type == Types.CHARACTER) return Types.CHAR; if (type == Types.DOUBLE) return Types.DOUBLE_VALUE; if (type == Types.FLOAT) return Types.FLOAT_VALUE; if (type == Types.INTEGER) return Types.INT_VALUE; if (type == Types.LONG) return Types.LONG_VALUE; if (type == Types.SHORT) return Types.SHORT_VALUE; return type; }
[ "public", "static", "Type", "toValueType", "(", "Type", "type", ")", "{", "if", "(", "type", "==", "Types", ".", "BYTE", ")", "return", "Types", ".", "BYTE_VALUE", ";", "if", "(", "type", "==", "Types", ".", "BOOLEAN", ")", "return", "Types", ".", "B...
return value type only when there is one @param type @return
[ "return", "value", "type", "only", "when", "there", "is", "one" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/bytecode/util/ASMUtil.java#L873-L884
30,259
lucee/Lucee
core/src/main/java/lucee/runtime/converter/ScriptConverter.java
ScriptConverter._serializeDate
private void _serializeDate(Date date, StringBuilder sb) throws ConverterException { _serializeDateTime(new DateTimeImpl(date), sb); }
java
private void _serializeDate(Date date, StringBuilder sb) throws ConverterException { _serializeDateTime(new DateTimeImpl(date), sb); }
[ "private", "void", "_serializeDate", "(", "Date", "date", ",", "StringBuilder", "sb", ")", "throws", "ConverterException", "{", "_serializeDateTime", "(", "new", "DateTimeImpl", "(", "date", ")", ",", "sb", ")", ";", "}" ]
serialize a Date @param date Date to serialize @param sb @throws ConverterException
[ "serialize", "a", "Date" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/converter/ScriptConverter.java#L115-L117
30,260
lucee/Lucee
core/src/main/java/lucee/runtime/converter/ScriptConverter.java
ScriptConverter.serialize
public String serialize(Object object) throws ConverterException { deep = 0; StringBuilder sb = new StringBuilder(); _serialize(object, sb, new HashSet<Object>()); return sb.toString(); }
java
public String serialize(Object object) throws ConverterException { deep = 0; StringBuilder sb = new StringBuilder(); _serialize(object, sb, new HashSet<Object>()); return sb.toString(); }
[ "public", "String", "serialize", "(", "Object", "object", ")", "throws", "ConverterException", "{", "deep", "=", "0", ";", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "_serialize", "(", "object", ",", "sb", ",", "new", "HashSet", "<"...
serialize a Object to his literal Format @param object Object to serialize @return serialized wddx package @throws ConverterException
[ "serialize", "a", "Object", "to", "his", "literal", "Format" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/converter/ScriptConverter.java#L603-L608
30,261
lucee/Lucee
core/src/main/java/lucee/runtime/tag/Query.java
Query.setDatasource
public void setDatasource(Object datasource) throws PageException, ClassException, BundleException { if (datasource == null) return; data.rawDatasource = datasource; data.datasource = toDatasource(pageContext, datasource); }
java
public void setDatasource(Object datasource) throws PageException, ClassException, BundleException { if (datasource == null) return; data.rawDatasource = datasource; data.datasource = toDatasource(pageContext, datasource); }
[ "public", "void", "setDatasource", "(", "Object", "datasource", ")", "throws", "PageException", ",", "ClassException", ",", "BundleException", "{", "if", "(", "datasource", "==", "null", ")", "return", ";", "data", ".", "rawDatasource", "=", "datasource", ";", ...
set the value datasource The name of the data source from which this query should retrieve data. @param datasource value to set @throws ClassException @throws BundleException
[ "set", "the", "value", "datasource", "The", "name", "of", "the", "data", "source", "from", "which", "this", "query", "should", "retrieve", "data", "." ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/tag/Query.java#L211-L215
30,262
lucee/Lucee
core/src/main/java/lucee/runtime/functions/decision/IsValid.java
IsValid.call
public static boolean call(PageContext pc, String type, Object value) throws ExpressionException { type = type.trim(); if ("range".equalsIgnoreCase(type)) throw new FunctionException(pc, "isValid", 1, "type", "for [range] you have to define a min and max value"); if ("regex".equalsIgnoreCase(type) || "regular_expression".equalsIgnoreCase(type)) throw new FunctionException(pc, "isValid", 1, "type", "for [regex] you have to define a pattern"); return Decision.isValid(type, value); }
java
public static boolean call(PageContext pc, String type, Object value) throws ExpressionException { type = type.trim(); if ("range".equalsIgnoreCase(type)) throw new FunctionException(pc, "isValid", 1, "type", "for [range] you have to define a min and max value"); if ("regex".equalsIgnoreCase(type) || "regular_expression".equalsIgnoreCase(type)) throw new FunctionException(pc, "isValid", 1, "type", "for [regex] you have to define a pattern"); return Decision.isValid(type, value); }
[ "public", "static", "boolean", "call", "(", "PageContext", "pc", ",", "String", "type", ",", "Object", "value", ")", "throws", "ExpressionException", "{", "type", "=", "type", ".", "trim", "(", ")", ";", "if", "(", "\"range\"", ".", "equalsIgnoreCase", "("...
check for many diff types @param pc @param type @param value @return @throws ExpressionException
[ "check", "for", "many", "diff", "types" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/functions/decision/IsValid.java#L46-L55
30,263
lucee/Lucee
core/src/main/java/lucee/commons/io/IOUtil.java
IOUtil.merge
public static final void merge(InputStream in1, InputStream in2, OutputStream out, boolean closeIS1, boolean closeIS2, boolean closeOS) throws IOException { try { merge(in1, in2, out, 0xffff); } finally { if (closeIS1) closeEL(in1); if (closeIS2) closeEL(in2); if (closeOS) closeEL(out); } }
java
public static final void merge(InputStream in1, InputStream in2, OutputStream out, boolean closeIS1, boolean closeIS2, boolean closeOS) throws IOException { try { merge(in1, in2, out, 0xffff); } finally { if (closeIS1) closeEL(in1); if (closeIS2) closeEL(in2); if (closeOS) closeEL(out); } }
[ "public", "static", "final", "void", "merge", "(", "InputStream", "in1", ",", "InputStream", "in2", ",", "OutputStream", "out", ",", "boolean", "closeIS1", ",", "boolean", "closeIS2", ",", "boolean", "closeOS", ")", "throws", "IOException", "{", "try", "{", ...
copy a inputstream to a outputstream @param in @param out @param closeIS @param closeOS @throws IOException
[ "copy", "a", "inputstream", "to", "a", "outputstream" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/io/IOUtil.java#L93-L102
30,264
lucee/Lucee
core/src/main/java/lucee/commons/io/IOUtil.java
IOUtil.copy
public void copy(File in, File out) throws IOException { InputStream is = null; OutputStream os = null; try { is = new BufferedFileInputStream(in); os = new BufferedFileOutputStream(out); } catch (IOException ioe) { closeEL(is, os); throw ioe; } copy(is, os, true, true); }
java
public void copy(File in, File out) throws IOException { InputStream is = null; OutputStream os = null; try { is = new BufferedFileInputStream(in); os = new BufferedFileOutputStream(out); } catch (IOException ioe) { closeEL(is, os); throw ioe; } copy(is, os, true, true); }
[ "public", "void", "copy", "(", "File", "in", ",", "File", "out", ")", "throws", "IOException", "{", "InputStream", "is", "=", "null", ";", "OutputStream", "os", "=", "null", ";", "try", "{", "is", "=", "new", "BufferedFileInputStream", "(", "in", ")", ...
copy content of in file to out File @param in input @param out output @throws IOException
[ "copy", "content", "of", "in", "file", "to", "out", "File" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/io/IOUtil.java#L374-L386
30,265
lucee/Lucee
core/src/main/java/lucee/commons/io/IOUtil.java
IOUtil.closeEL
public static void closeEL(InputStream is) { try { if (is != null) is.close(); } // catch (AlwaysThrow at) {throw at;} catch (Throwable t) { ExceptionUtil.rethrowIfNecessary(t); } }
java
public static void closeEL(InputStream is) { try { if (is != null) is.close(); } // catch (AlwaysThrow at) {throw at;} catch (Throwable t) { ExceptionUtil.rethrowIfNecessary(t); } }
[ "public", "static", "void", "closeEL", "(", "InputStream", "is", ")", "{", "try", "{", "if", "(", "is", "!=", "null", ")", "is", ".", "close", "(", ")", ";", "}", "// catch (AlwaysThrow at) {throw at;}", "catch", "(", "Throwable", "t", ")", "{", "Excepti...
close inputstream without a Exception @param is
[ "close", "inputstream", "without", "a", "Exception" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/io/IOUtil.java#L414-L422
30,266
lucee/Lucee
core/src/main/java/lucee/commons/io/IOUtil.java
IOUtil.closeEL
public static void closeEL(OutputStream os) { try { if (os != null) os.close(); } // catch (AlwaysThrow at) {throw at;} catch (Throwable t) { ExceptionUtil.rethrowIfNecessary(t); } }
java
public static void closeEL(OutputStream os) { try { if (os != null) os.close(); } // catch (AlwaysThrow at) {throw at;} catch (Throwable t) { ExceptionUtil.rethrowIfNecessary(t); } }
[ "public", "static", "void", "closeEL", "(", "OutputStream", "os", ")", "{", "try", "{", "if", "(", "os", "!=", "null", ")", "os", ".", "close", "(", ")", ";", "}", "// catch (AlwaysThrow at) {throw at;}", "catch", "(", "Throwable", "t", ")", "{", "Except...
close outputstream without a Exception @param os
[ "close", "outputstream", "without", "a", "Exception" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/io/IOUtil.java#L439-L447
30,267
lucee/Lucee
core/src/main/java/lucee/commons/io/IOUtil.java
IOUtil.closeEL
public static void closeEL(Reader r) { try { if (r != null) r.close(); } // catch (AlwaysThrow at) {throw at;} catch (Throwable e) { ExceptionUtil.rethrowIfNecessary(e); } }
java
public static void closeEL(Reader r) { try { if (r != null) r.close(); } // catch (AlwaysThrow at) {throw at;} catch (Throwable e) { ExceptionUtil.rethrowIfNecessary(e); } }
[ "public", "static", "void", "closeEL", "(", "Reader", "r", ")", "{", "try", "{", "if", "(", "r", "!=", "null", ")", "r", ".", "close", "(", ")", ";", "}", "// catch (AlwaysThrow at) {throw at;}", "catch", "(", "Throwable", "e", ")", "{", "ExceptionUtil",...
close Reader without a Exception @param r
[ "close", "Reader", "without", "a", "Exception" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/io/IOUtil.java#L463-L471
30,268
lucee/Lucee
core/src/main/java/lucee/commons/io/IOUtil.java
IOUtil.closeEL
public static void closeEL(Closeable c) { try { if (c != null) c.close(); } // catch (AlwaysThrow at) {throw at;} catch (Throwable e) { ExceptionUtil.rethrowIfNecessary(e); } }
java
public static void closeEL(Closeable c) { try { if (c != null) c.close(); } // catch (AlwaysThrow at) {throw at;} catch (Throwable e) { ExceptionUtil.rethrowIfNecessary(e); } }
[ "public", "static", "void", "closeEL", "(", "Closeable", "c", ")", "{", "try", "{", "if", "(", "c", "!=", "null", ")", "c", ".", "close", "(", ")", ";", "}", "// catch (AlwaysThrow at) {throw at;}", "catch", "(", "Throwable", "e", ")", "{", "ExceptionUti...
close Closeable without a Exception @param r
[ "close", "Closeable", "without", "a", "Exception" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/io/IOUtil.java#L478-L486
30,269
lucee/Lucee
core/src/main/java/lucee/commons/io/IOUtil.java
IOUtil.closeEL
public static void closeEL(Object obj) { if (obj instanceof InputStream) IOUtil.closeEL((InputStream) obj); else if (obj instanceof OutputStream) IOUtil.closeEL((OutputStream) obj); else if (obj instanceof Writer) IOUtil.closeEL((Writer) obj); else if (obj instanceof Reader) IOUtil.closeEL((Reader) obj); else if (obj instanceof Closeable) IOUtil.closeEL((Closeable) obj); else if (obj instanceof ZipFile) IOUtil.closeEL((ZipFile) obj); else if (obj instanceof ResultSet) IOUtil.closeEL((ResultSet) obj); else if (obj instanceof Connection) IOUtil.closeEL((Connection) obj); else { try { Method method = obj.getClass().getMethod("close", new Class[0]); method.invoke(obj, new Object[0]); } catch (Throwable e) { ExceptionUtil.rethrowIfNecessary(e); } } }
java
public static void closeEL(Object obj) { if (obj instanceof InputStream) IOUtil.closeEL((InputStream) obj); else if (obj instanceof OutputStream) IOUtil.closeEL((OutputStream) obj); else if (obj instanceof Writer) IOUtil.closeEL((Writer) obj); else if (obj instanceof Reader) IOUtil.closeEL((Reader) obj); else if (obj instanceof Closeable) IOUtil.closeEL((Closeable) obj); else if (obj instanceof ZipFile) IOUtil.closeEL((ZipFile) obj); else if (obj instanceof ResultSet) IOUtil.closeEL((ResultSet) obj); else if (obj instanceof Connection) IOUtil.closeEL((Connection) obj); else { try { Method method = obj.getClass().getMethod("close", new Class[0]); method.invoke(obj, new Object[0]); } catch (Throwable e) { ExceptionUtil.rethrowIfNecessary(e); } } }
[ "public", "static", "void", "closeEL", "(", "Object", "obj", ")", "{", "if", "(", "obj", "instanceof", "InputStream", ")", "IOUtil", ".", "closeEL", "(", "(", "InputStream", ")", "obj", ")", ";", "else", "if", "(", "obj", "instanceof", "OutputStream", ")...
call close method from any Object with a close method. @param obj
[ "call", "close", "method", "from", "any", "Object", "with", "a", "close", "method", "." ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/io/IOUtil.java#L522-L540
30,270
lucee/Lucee
core/src/main/java/lucee/commons/io/IOUtil.java
IOUtil.checkEncoding
public static void checkEncoding(String encoding) throws IOException { try { URLEncoder.encode("", encoding); } catch (UnsupportedEncodingException e) { throw new IOException("invalid encoding [" + encoding + "]"); } }
java
public static void checkEncoding(String encoding) throws IOException { try { URLEncoder.encode("", encoding); } catch (UnsupportedEncodingException e) { throw new IOException("invalid encoding [" + encoding + "]"); } }
[ "public", "static", "void", "checkEncoding", "(", "String", "encoding", ")", "throws", "IOException", "{", "try", "{", "URLEncoder", ".", "encode", "(", "\"\"", ",", "encoding", ")", ";", "}", "catch", "(", "UnsupportedEncodingException", "e", ")", "{", "thr...
check if given encoding is ok @param encoding @throws PageException
[ "check", "if", "given", "encoding", "is", "ok" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/io/IOUtil.java#L1024-L1031
30,271
lucee/Lucee
core/src/main/java/lucee/runtime/net/mail/MailUtil.java
MailUtil.isValidEmail
public static boolean isValidEmail(Object value) { InternetAddress addr = parseEmail(value, null); if (addr != null) { String address = addr.getAddress(); if (address.contains("..")) return false; int pos = address.indexOf('@'); if (pos < 1 || pos == address.length() - 1) return false; String local = address.substring(0, pos); String domain = address.substring(pos + 1); if (domain.charAt(0) == '.' || local.charAt(0) == '.' || local.charAt(local.length() - 1) == '.') return false; pos = domain.lastIndexOf('.'); if (pos > 0 && pos < domain.length() - 2) { // test TLD to be at // least 2 chars all // alpha characters if (StringUtil.isAllAlpha(domain.substring(pos + 1))) return true; try { addr.validate(); return true; } catch (AddressException e) {} } } return false; }
java
public static boolean isValidEmail(Object value) { InternetAddress addr = parseEmail(value, null); if (addr != null) { String address = addr.getAddress(); if (address.contains("..")) return false; int pos = address.indexOf('@'); if (pos < 1 || pos == address.length() - 1) return false; String local = address.substring(0, pos); String domain = address.substring(pos + 1); if (domain.charAt(0) == '.' || local.charAt(0) == '.' || local.charAt(local.length() - 1) == '.') return false; pos = domain.lastIndexOf('.'); if (pos > 0 && pos < domain.length() - 2) { // test TLD to be at // least 2 chars all // alpha characters if (StringUtil.isAllAlpha(domain.substring(pos + 1))) return true; try { addr.validate(); return true; } catch (AddressException e) {} } } return false; }
[ "public", "static", "boolean", "isValidEmail", "(", "Object", "value", ")", "{", "InternetAddress", "addr", "=", "parseEmail", "(", "value", ",", "null", ")", ";", "if", "(", "addr", "!=", "null", ")", "{", "String", "address", "=", "addr", ".", "getAddr...
returns true if the passed value is a in valid email address format @param value @return
[ "returns", "true", "if", "the", "passed", "value", "is", "a", "in", "valid", "email", "address", "format" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/net/mail/MailUtil.java#L135-L169
30,272
lucee/Lucee
core/src/main/java/lucee/runtime/net/mail/MailUtil.java
MailUtil.parseEmail
public static InternetAddress parseEmail(Object value, InternetAddress defaultValue) { String str = Caster.toString(value, ""); if (str.indexOf('@') > -1) { try { str = fixIDN(str); InternetAddress addr = new InternetAddress(str); // fixIDN( addr ); return addr; } catch (AddressException ex) {} } return defaultValue; }
java
public static InternetAddress parseEmail(Object value, InternetAddress defaultValue) { String str = Caster.toString(value, ""); if (str.indexOf('@') > -1) { try { str = fixIDN(str); InternetAddress addr = new InternetAddress(str); // fixIDN( addr ); return addr; } catch (AddressException ex) {} } return defaultValue; }
[ "public", "static", "InternetAddress", "parseEmail", "(", "Object", "value", ",", "InternetAddress", "defaultValue", ")", "{", "String", "str", "=", "Caster", ".", "toString", "(", "value", ",", "\"\"", ")", ";", "if", "(", "str", ".", "indexOf", "(", "'",...
returns an InternetAddress object or null if the parsing fails. to be be used in multiple places. @param value @return
[ "returns", "an", "InternetAddress", "object", "or", "null", "if", "the", "parsing", "fails", ".", "to", "be", "be", "used", "in", "multiple", "places", "." ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/net/mail/MailUtil.java#L184-L196
30,273
lucee/Lucee
core/src/main/java/lucee/runtime/net/mail/MailUtil.java
MailUtil.fixIDN
public static String fixIDN(String addr) { int pos = addr.indexOf('@'); if (pos > 0 && pos < addr.length() - 1) { String domain = addr.substring(pos + 1); if (!StringUtil.isAscii(domain)) { domain = IDN.toASCII(domain); return addr.substring(0, pos) + "@" + domain; } } return addr; }
java
public static String fixIDN(String addr) { int pos = addr.indexOf('@'); if (pos > 0 && pos < addr.length() - 1) { String domain = addr.substring(pos + 1); if (!StringUtil.isAscii(domain)) { domain = IDN.toASCII(domain); return addr.substring(0, pos) + "@" + domain; } } return addr; }
[ "public", "static", "String", "fixIDN", "(", "String", "addr", ")", "{", "int", "pos", "=", "addr", ".", "indexOf", "(", "'", "'", ")", ";", "if", "(", "pos", ">", "0", "&&", "pos", "<", "addr", ".", "length", "(", ")", "-", "1", ")", "{", "S...
converts IDN to ASCII if needed @param addr @return
[ "converts", "IDN", "to", "ASCII", "if", "needed" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/net/mail/MailUtil.java#L204-L214
30,274
lucee/Lucee
core/src/main/java/lucee/runtime/tag/TagHandlerPool.java
TagHandlerPool.reuse
public void reuse(Tag tag) { tag.release(); Queue<Tag> queue = getQueue(tag.getClass().getName()); queue.add(tag); }
java
public void reuse(Tag tag) { tag.release(); Queue<Tag> queue = getQueue(tag.getClass().getName()); queue.add(tag); }
[ "public", "void", "reuse", "(", "Tag", "tag", ")", "{", "tag", ".", "release", "(", ")", ";", "Queue", "<", "Tag", ">", "queue", "=", "getQueue", "(", "tag", ".", "getClass", "(", ")", ".", "getName", "(", ")", ")", ";", "queue", ".", "add", "(...
free a tag for reusing @param tag @throws ExpressionException
[ "free", "a", "tag", "for", "reusing" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/tag/TagHandlerPool.java#L73-L77
30,275
lucee/Lucee
core/src/main/java/lucee/runtime/registry/RegistryQuery.java
RegistryQuery.executeQuery
public static String executeQuery(String[] cmd) throws IOException, InterruptedException { return Command.execute(cmd).getOutput(); }
java
public static String executeQuery(String[] cmd) throws IOException, InterruptedException { return Command.execute(cmd).getOutput(); }
[ "public", "static", "String", "executeQuery", "(", "String", "[", "]", "cmd", ")", "throws", "IOException", ",", "InterruptedException", "{", "return", "Command", ".", "execute", "(", "cmd", ")", ".", "getOutput", "(", ")", ";", "}" ]
execute a String query on command line @param query String to execute @return @throws IOException @throws InterruptedException
[ "execute", "a", "String", "query", "on", "command", "line" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/registry/RegistryQuery.java#L50-L52
30,276
lucee/Lucee
core/src/main/java/lucee/runtime/registry/RegistryQuery.java
RegistryQuery.getValue
public static RegistryEntry getValue(String branch, String entry, short type) throws RegistryException, IOException, InterruptedException { String[] cmd = new String[] { "reg", "query", cleanBrunch(branch), "/v", entry }; RegistryEntry[] rst = filter(executeQuery(cmd), branch, type); if (rst.length == 1) { return rst[0]; // if(type==RegistryEntry.TYPE_ANY || type==r.getType()) return r; } return null; }
java
public static RegistryEntry getValue(String branch, String entry, short type) throws RegistryException, IOException, InterruptedException { String[] cmd = new String[] { "reg", "query", cleanBrunch(branch), "/v", entry }; RegistryEntry[] rst = filter(executeQuery(cmd), branch, type); if (rst.length == 1) { return rst[0]; // if(type==RegistryEntry.TYPE_ANY || type==r.getType()) return r; } return null; }
[ "public", "static", "RegistryEntry", "getValue", "(", "String", "branch", ",", "String", "entry", ",", "short", "type", ")", "throws", "RegistryException", ",", "IOException", ",", "InterruptedException", "{", "String", "[", "]", "cmd", "=", "new", "String", "...
gets a single value form the registry @param branch brach to get value from @param entry entry to get @param type type of the registry entry to get @return registry entry or null of not exist @throws RegistryException @throws IOException @throws InterruptedException
[ "gets", "a", "single", "value", "form", "the", "registry" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/registry/RegistryQuery.java#L65-L73
30,277
lucee/Lucee
core/src/main/java/lucee/runtime/registry/RegistryQuery.java
RegistryQuery.getValues
public static RegistryEntry[] getValues(String branch, short type) throws RegistryException, IOException, InterruptedException { String[] cmd = new String[] { "reg", "query", branch }; return filter(executeQuery(cmd), cleanBrunch(branch), type); }
java
public static RegistryEntry[] getValues(String branch, short type) throws RegistryException, IOException, InterruptedException { String[] cmd = new String[] { "reg", "query", branch }; return filter(executeQuery(cmd), cleanBrunch(branch), type); }
[ "public", "static", "RegistryEntry", "[", "]", "getValues", "(", "String", "branch", ",", "short", "type", ")", "throws", "RegistryException", ",", "IOException", ",", "InterruptedException", "{", "String", "[", "]", "cmd", "=", "new", "String", "[", "]", "{...
gets all entries of one branch @param branch @param type @return @throws RegistryException @throws IOException @throws InterruptedException
[ "gets", "all", "entries", "of", "one", "branch" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/registry/RegistryQuery.java#L85-L88
30,278
lucee/Lucee
core/src/main/java/lucee/runtime/registry/RegistryQuery.java
RegistryQuery.setValue
public static void setValue(String branch, String entry, short type, String value) throws RegistryException, IOException, InterruptedException { if (type == RegistryEntry.TYPE_KEY) { String fullKey = ListUtil.trim(branch, "\\") + "\\" + ListUtil.trim(entry, "\\"); // String[] cmd = new String[]{"reg","add",cleanBrunch(fullKey),"/ve","/f"}; String[] cmd = new String[] { "reg", "add", cleanBrunch(fullKey), "/f" }; executeQuery(cmd); } else { if (type == RegistryEntry.TYPE_DWORD) value = Caster.toString(Caster.toIntValue(value, 0)); String[] cmd = new String[] { "reg", "add", cleanBrunch(branch), "/v", entry, "/t", RegistryEntry.toStringType(type), "/d", value, "/f" }; executeQuery(cmd); } }
java
public static void setValue(String branch, String entry, short type, String value) throws RegistryException, IOException, InterruptedException { if (type == RegistryEntry.TYPE_KEY) { String fullKey = ListUtil.trim(branch, "\\") + "\\" + ListUtil.trim(entry, "\\"); // String[] cmd = new String[]{"reg","add",cleanBrunch(fullKey),"/ve","/f"}; String[] cmd = new String[] { "reg", "add", cleanBrunch(fullKey), "/f" }; executeQuery(cmd); } else { if (type == RegistryEntry.TYPE_DWORD) value = Caster.toString(Caster.toIntValue(value, 0)); String[] cmd = new String[] { "reg", "add", cleanBrunch(branch), "/v", entry, "/t", RegistryEntry.toStringType(type), "/d", value, "/f" }; executeQuery(cmd); } }
[ "public", "static", "void", "setValue", "(", "String", "branch", ",", "String", "entry", ",", "short", "type", ",", "String", "value", ")", "throws", "RegistryException", ",", "IOException", ",", "InterruptedException", "{", "if", "(", "type", "==", "RegistryE...
writes a value to registry @param branch @param entry @param type @param value @throws RegistryException @throws IOException @throws InterruptedException
[ "writes", "a", "value", "to", "registry" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/registry/RegistryQuery.java#L101-L114
30,279
lucee/Lucee
core/src/main/java/lucee/runtime/registry/RegistryQuery.java
RegistryQuery.deleteValue
public static void deleteValue(String branch, String entry) throws IOException, InterruptedException { if (entry == null) { String[] cmd = new String[] { "reg", "delete", cleanBrunch(branch), "/f" }; executeQuery(cmd); // executeQuery("reg delete \""+List.trim(branch,"\\")+"\" /f"); } else { String[] cmd = new String[] { "reg", "delete", cleanBrunch(branch), "/v", entry, "/f" }; executeQuery(cmd); // executeQuery("reg delete \""+List.trim(branch,"\\")+"\" /v "+entry+" /f"); } }
java
public static void deleteValue(String branch, String entry) throws IOException, InterruptedException { if (entry == null) { String[] cmd = new String[] { "reg", "delete", cleanBrunch(branch), "/f" }; executeQuery(cmd); // executeQuery("reg delete \""+List.trim(branch,"\\")+"\" /f"); } else { String[] cmd = new String[] { "reg", "delete", cleanBrunch(branch), "/v", entry, "/f" }; executeQuery(cmd); // executeQuery("reg delete \""+List.trim(branch,"\\")+"\" /v "+entry+" /f"); } }
[ "public", "static", "void", "deleteValue", "(", "String", "branch", ",", "String", "entry", ")", "throws", "IOException", ",", "InterruptedException", "{", "if", "(", "entry", "==", "null", ")", "{", "String", "[", "]", "cmd", "=", "new", "String", "[", ...
deletes a value or a key @param branch @param entry @throws IOException @throws InterruptedException
[ "deletes", "a", "value", "or", "a", "key" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/registry/RegistryQuery.java#L124-L135
30,280
lucee/Lucee
core/src/main/java/lucee/runtime/registry/RegistryQuery.java
RegistryQuery.filter
private static RegistryEntry[] filter(String string, String branch, short type) throws RegistryException { branch = ListUtil.trim(branch, "\\"); StringBuffer result = new StringBuffer(); ArrayList array = new ArrayList(); String[] arr = string.split("\n"); for (int i = 0; i < arr.length; i++) { String line = arr[i].trim(); int indexDWORD = line.indexOf(RegistryEntry.REGDWORD_TOKEN); int indexSTRING = line.indexOf(RegistryEntry.REGSTR_TOKEN); if ((indexDWORD != -1) || (indexSTRING != -1)) { int index = (indexDWORD == -1) ? indexSTRING : indexDWORD; int len = (indexDWORD == -1) ? lenSTRING : lenDWORD; short _type = (indexDWORD == -1) ? RegistryEntry.TYPE_STRING : RegistryEntry.TYPE_DWORD; if (result.length() > 0) result.append("\n"); String _key = line.substring(0, index).trim(); String _value = StringUtil.substringEL(line, index + len + 1, "").trim(); if (_key.equals(NO_NAME)) _key = ""; if (_type == RegistryEntry.TYPE_DWORD) _value = String.valueOf(ParseNumber.invoke(_value.substring(2), "hex", 0)); RegistryEntry re = new RegistryEntry(_type, _key, _value); if (type == RegistryEntry.TYPE_ANY || type == re.getType()) array.add(re); // } } else if (line.indexOf(branch) == 0 && (type == RegistryEntry.TYPE_ANY || type == RegistryEntry.TYPE_KEY)) { line = ListUtil.trim(line, "\\"); if (branch.length() < line.length()) { array.add(new RegistryEntry(RegistryEntry.TYPE_KEY, ListUtil.last(line, "\\", true), "")); } } } return (RegistryEntry[]) array.toArray(new RegistryEntry[array.size()]); }
java
private static RegistryEntry[] filter(String string, String branch, short type) throws RegistryException { branch = ListUtil.trim(branch, "\\"); StringBuffer result = new StringBuffer(); ArrayList array = new ArrayList(); String[] arr = string.split("\n"); for (int i = 0; i < arr.length; i++) { String line = arr[i].trim(); int indexDWORD = line.indexOf(RegistryEntry.REGDWORD_TOKEN); int indexSTRING = line.indexOf(RegistryEntry.REGSTR_TOKEN); if ((indexDWORD != -1) || (indexSTRING != -1)) { int index = (indexDWORD == -1) ? indexSTRING : indexDWORD; int len = (indexDWORD == -1) ? lenSTRING : lenDWORD; short _type = (indexDWORD == -1) ? RegistryEntry.TYPE_STRING : RegistryEntry.TYPE_DWORD; if (result.length() > 0) result.append("\n"); String _key = line.substring(0, index).trim(); String _value = StringUtil.substringEL(line, index + len + 1, "").trim(); if (_key.equals(NO_NAME)) _key = ""; if (_type == RegistryEntry.TYPE_DWORD) _value = String.valueOf(ParseNumber.invoke(_value.substring(2), "hex", 0)); RegistryEntry re = new RegistryEntry(_type, _key, _value); if (type == RegistryEntry.TYPE_ANY || type == re.getType()) array.add(re); // } } else if (line.indexOf(branch) == 0 && (type == RegistryEntry.TYPE_ANY || type == RegistryEntry.TYPE_KEY)) { line = ListUtil.trim(line, "\\"); if (branch.length() < line.length()) { array.add(new RegistryEntry(RegistryEntry.TYPE_KEY, ListUtil.last(line, "\\", true), "")); } } } return (RegistryEntry[]) array.toArray(new RegistryEntry[array.size()]); }
[ "private", "static", "RegistryEntry", "[", "]", "filter", "(", "String", "string", ",", "String", "branch", ",", "short", "type", ")", "throws", "RegistryException", "{", "branch", "=", "ListUtil", ".", "trim", "(", "branch", ",", "\"\\\\\"", ")", ";", "St...
filter registry entries from the raw result @param string plain result to filter regisry entries @param branch @param type @return filtered entries @throws RegistryException
[ "filter", "registry", "entries", "from", "the", "raw", "result" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/registry/RegistryQuery.java#L153-L188
30,281
lucee/Lucee
core/src/main/java/lucee/runtime/type/QueryColumnImpl.java
QueryColumnImpl.touch
public Object touch(int row) { if (row < 1 || row > size) return NullSupportHelper.full() ? null : ""; Object o = data[row - 1]; if (o != null) return o; return setEL(row, new StructImpl()); }
java
public Object touch(int row) { if (row < 1 || row > size) return NullSupportHelper.full() ? null : ""; Object o = data[row - 1]; if (o != null) return o; return setEL(row, new StructImpl()); }
[ "public", "Object", "touch", "(", "int", "row", ")", "{", "if", "(", "row", "<", "1", "||", "row", ">", "size", ")", "return", "NullSupportHelper", ".", "full", "(", ")", "?", "null", ":", "\"\"", ";", "Object", "o", "=", "data", "[", "row", "-",...
touch the given line on the column at given row @param row @return new row or existing @throws DatabaseException
[ "touch", "the", "given", "line", "on", "the", "column", "at", "given", "row" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/QueryColumnImpl.java#L253-L258
30,282
lucee/Lucee
core/src/main/java/lucee/runtime/db/SQLCaster.java
SQLCaster.toCFTypex
public static Object toCFTypex(SQLItem item) throws PageException { try { return _toCFTypex(item); } catch (PageException e) { if (item.isNulls()) return item.getValue(); throw e; } }
java
public static Object toCFTypex(SQLItem item) throws PageException { try { return _toCFTypex(item); } catch (PageException e) { if (item.isNulls()) return item.getValue(); throw e; } }
[ "public", "static", "Object", "toCFTypex", "(", "SQLItem", "item", ")", "throws", "PageException", "{", "try", "{", "return", "_toCFTypex", "(", "item", ")", ";", "}", "catch", "(", "PageException", "e", ")", "{", "if", "(", "item", ".", "isNulls", "(", ...
cast a Value to a correspondance CF Type @param item @return cf type @throws PageException
[ "cast", "a", "Value", "to", "a", "correspondance", "CF", "Type" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/db/SQLCaster.java#L398-L406
30,283
lucee/Lucee
core/src/main/java/lucee/runtime/db/SQLCaster.java
SQLCaster.toStringType
public static String toStringType(int type, String defaultValue) { switch (type) { case Types.ARRAY: return "CF_SQL_ARRAY"; case Types.BIGINT: return "CF_SQL_BIGINT"; case Types.BINARY: return "CF_SQL_BINARY"; case Types.BIT: return "CF_SQL_BIT"; case Types.BOOLEAN: return "CF_SQL_BOOLEAN"; case Types.BLOB: return "CF_SQL_BLOB"; case Types.CHAR: return "CF_SQL_CHAR"; case Types.CLOB: return "CF_SQL_CLOB"; case Types.DATALINK: return "CF_SQL_DATALINK"; case Types.DATE: return "CF_SQL_DATE"; case Types.DISTINCT: return "CF_SQL_DISTINCT"; case Types.NUMERIC: return "CF_SQL_NUMERIC"; case Types.DECIMAL: return "CF_SQL_DECIMAL"; case Types.DOUBLE: return "CF_SQL_DOUBLE"; case Types.REAL: return "CF_SQL_REAL"; case Types.FLOAT: return "CF_SQL_FLOAT"; case Types.TINYINT: return "CF_SQL_TINYINT"; case Types.SMALLINT: return "CF_SQL_SMALLINT"; case Types.STRUCT: return "CF_SQL_STRUCT"; case Types.INTEGER: return "CF_SQL_INTEGER"; case Types.VARCHAR: return "CF_SQL_VARCHAR"; case Types.NVARCHAR: return "CF_SQL_NVARCHAR"; case CFTypes.VARCHAR2: return "CF_SQL_VARCHAR2"; case Types.LONGVARBINARY: return "CF_SQL_LONGVARBINARY"; case Types.VARBINARY: return "CF_SQL_VARBINARY"; case Types.LONGVARCHAR: return "CF_SQL_LONGVARCHAR"; case Types.TIME: return "CF_SQL_TIME"; case Types.TIMESTAMP: return "CF_SQL_TIMESTAMP"; case Types.REF: return "CF_SQL_REF"; case CFTypes.CURSOR: return "CF_SQL_REFCURSOR"; case Types.OTHER: return "CF_SQL_OTHER"; case Types.NULL: return "CF_SQL_NULL"; default: return null; } }
java
public static String toStringType(int type, String defaultValue) { switch (type) { case Types.ARRAY: return "CF_SQL_ARRAY"; case Types.BIGINT: return "CF_SQL_BIGINT"; case Types.BINARY: return "CF_SQL_BINARY"; case Types.BIT: return "CF_SQL_BIT"; case Types.BOOLEAN: return "CF_SQL_BOOLEAN"; case Types.BLOB: return "CF_SQL_BLOB"; case Types.CHAR: return "CF_SQL_CHAR"; case Types.CLOB: return "CF_SQL_CLOB"; case Types.DATALINK: return "CF_SQL_DATALINK"; case Types.DATE: return "CF_SQL_DATE"; case Types.DISTINCT: return "CF_SQL_DISTINCT"; case Types.NUMERIC: return "CF_SQL_NUMERIC"; case Types.DECIMAL: return "CF_SQL_DECIMAL"; case Types.DOUBLE: return "CF_SQL_DOUBLE"; case Types.REAL: return "CF_SQL_REAL"; case Types.FLOAT: return "CF_SQL_FLOAT"; case Types.TINYINT: return "CF_SQL_TINYINT"; case Types.SMALLINT: return "CF_SQL_SMALLINT"; case Types.STRUCT: return "CF_SQL_STRUCT"; case Types.INTEGER: return "CF_SQL_INTEGER"; case Types.VARCHAR: return "CF_SQL_VARCHAR"; case Types.NVARCHAR: return "CF_SQL_NVARCHAR"; case CFTypes.VARCHAR2: return "CF_SQL_VARCHAR2"; case Types.LONGVARBINARY: return "CF_SQL_LONGVARBINARY"; case Types.VARBINARY: return "CF_SQL_VARBINARY"; case Types.LONGVARCHAR: return "CF_SQL_LONGVARCHAR"; case Types.TIME: return "CF_SQL_TIME"; case Types.TIMESTAMP: return "CF_SQL_TIMESTAMP"; case Types.REF: return "CF_SQL_REF"; case CFTypes.CURSOR: return "CF_SQL_REFCURSOR"; case Types.OTHER: return "CF_SQL_OTHER"; case Types.NULL: return "CF_SQL_NULL"; default: return null; } }
[ "public", "static", "String", "toStringType", "(", "int", "type", ",", "String", "defaultValue", ")", "{", "switch", "(", "type", ")", "{", "case", "Types", ".", "ARRAY", ":", "return", "\"CF_SQL_ARRAY\"", ";", "case", "Types", ".", "BIGINT", ":", "return"...
returns CF SQL Type as String @param type @return SQL Type as String @throws DatabaseException
[ "returns", "CF", "SQL", "Type", "as", "String" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/db/SQLCaster.java#L552-L622
30,284
lucee/Lucee
core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java
XMLConfigAdmin.setMailLog
public void setMailLog(String logFile, String level) throws PageException { checkWriteAccess(); boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_MAIL); if (!hasAccess) throw new SecurityException("no access to update mail server settings"); ConfigWebUtil.getFile(config, config.getRootDirectory(), logFile, FileUtil.TYPE_FILE); Element logging = XMLConfigWebFactory.getChildByName(doc.getDocumentElement(), "logging"); Element[] children = XMLUtil.getChildElementsAsArray(logging); Element logger = null; for (int i = 0; i < children.length; i++) { if (children[i].getTagName().equals("logger") && "mail".equalsIgnoreCase(children[i].getAttribute("name"))) { logger = children[i]; break; } } if (logger == null) { logger = doc.createElement("logger"); logging.appendChild(logger); } logger.setAttribute("name", "mail"); if ("console".equalsIgnoreCase(logFile)) { setClass(logger, null, "appender-", Log4jUtil.appenderClassDefintion("console")); setClass(logger, null, "layout-", Log4jUtil.layoutClassDefintion("pattern")); } else { setClass(logger, null, "appender-", Log4jUtil.appenderClassDefintion("resource")); setClass(logger, null, "layout-", Log4jUtil.layoutClassDefintion("classic")); logger.setAttribute("appender-arguments", "path:" + logFile); } logger.setAttribute("log-level", level); }
java
public void setMailLog(String logFile, String level) throws PageException { checkWriteAccess(); boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_MAIL); if (!hasAccess) throw new SecurityException("no access to update mail server settings"); ConfigWebUtil.getFile(config, config.getRootDirectory(), logFile, FileUtil.TYPE_FILE); Element logging = XMLConfigWebFactory.getChildByName(doc.getDocumentElement(), "logging"); Element[] children = XMLUtil.getChildElementsAsArray(logging); Element logger = null; for (int i = 0; i < children.length; i++) { if (children[i].getTagName().equals("logger") && "mail".equalsIgnoreCase(children[i].getAttribute("name"))) { logger = children[i]; break; } } if (logger == null) { logger = doc.createElement("logger"); logging.appendChild(logger); } logger.setAttribute("name", "mail"); if ("console".equalsIgnoreCase(logFile)) { setClass(logger, null, "appender-", Log4jUtil.appenderClassDefintion("console")); setClass(logger, null, "layout-", Log4jUtil.layoutClassDefintion("pattern")); } else { setClass(logger, null, "appender-", Log4jUtil.appenderClassDefintion("resource")); setClass(logger, null, "layout-", Log4jUtil.layoutClassDefintion("classic")); logger.setAttribute("appender-arguments", "path:" + logFile); } logger.setAttribute("log-level", level); }
[ "public", "void", "setMailLog", "(", "String", "logFile", ",", "String", "level", ")", "throws", "PageException", "{", "checkWriteAccess", "(", ")", ";", "boolean", "hasAccess", "=", "ConfigWebUtil", ".", "hasAccess", "(", "config", ",", "SecurityManager", ".", ...
sets Mail Logger to Config @param logFile @param level @throws PageException
[ "sets", "Mail", "Logger", "to", "Config" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java#L353-L385
30,285
lucee/Lucee
core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java
XMLConfigAdmin.setMailSpoolEnable
public void setMailSpoolEnable(Boolean spoolEnable) throws SecurityException { checkWriteAccess(); boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_MAIL); if (!hasAccess) throw new SecurityException("no access to update mail server settings"); Element mail = _getRootElement("mail"); mail.setAttribute("spool-enable", Caster.toString(spoolEnable, "")); // config.setMailSpoolEnable(spoolEnable); }
java
public void setMailSpoolEnable(Boolean spoolEnable) throws SecurityException { checkWriteAccess(); boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_MAIL); if (!hasAccess) throw new SecurityException("no access to update mail server settings"); Element mail = _getRootElement("mail"); mail.setAttribute("spool-enable", Caster.toString(spoolEnable, "")); // config.setMailSpoolEnable(spoolEnable); }
[ "public", "void", "setMailSpoolEnable", "(", "Boolean", "spoolEnable", ")", "throws", "SecurityException", "{", "checkWriteAccess", "(", ")", ";", "boolean", "hasAccess", "=", "ConfigWebUtil", ".", "hasAccess", "(", "config", ",", "SecurityManager", ".", "TYPE_MAIL"...
sets if spool is enable or not @param spoolEnable @throws SecurityException
[ "sets", "if", "spool", "is", "enable", "or", "not" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java#L393-L401
30,286
lucee/Lucee
core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java
XMLConfigAdmin.setMailTimeout
public void setMailTimeout(Integer timeout) throws SecurityException { checkWriteAccess(); boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_MAIL); if (!hasAccess) throw new SecurityException("no access to update mail server settings"); Element mail = _getRootElement("mail"); mail.setAttribute("timeout", Caster.toString(timeout, "")); // config.setMailTimeout(timeout); }
java
public void setMailTimeout(Integer timeout) throws SecurityException { checkWriteAccess(); boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_MAIL); if (!hasAccess) throw new SecurityException("no access to update mail server settings"); Element mail = _getRootElement("mail"); mail.setAttribute("timeout", Caster.toString(timeout, "")); // config.setMailTimeout(timeout); }
[ "public", "void", "setMailTimeout", "(", "Integer", "timeout", ")", "throws", "SecurityException", "{", "checkWriteAccess", "(", ")", ";", "boolean", "hasAccess", "=", "ConfigWebUtil", ".", "hasAccess", "(", "config", ",", "SecurityManager", ".", "TYPE_MAIL", ")",...
sets the timeout for the spooler for one job @param timeout @throws SecurityException
[ "sets", "the", "timeout", "for", "the", "spooler", "for", "one", "job" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java#L422-L429
30,287
lucee/Lucee
core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java
XMLConfigAdmin.setMailDefaultCharset
public void setMailDefaultCharset(String charset) throws PageException { checkWriteAccess(); boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_MAIL); if (!hasAccess) throw new SecurityException("no access to update mail server settings"); if (!StringUtil.isEmpty(charset)) { try { IOUtil.checkEncoding(charset); } catch (IOException e) { throw Caster.toPageException(e); } } Element mail = _getRootElement("mail"); mail.setAttribute("default-encoding", charset); // config.setMailDefaultEncoding(charset); }
java
public void setMailDefaultCharset(String charset) throws PageException { checkWriteAccess(); boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_MAIL); if (!hasAccess) throw new SecurityException("no access to update mail server settings"); if (!StringUtil.isEmpty(charset)) { try { IOUtil.checkEncoding(charset); } catch (IOException e) { throw Caster.toPageException(e); } } Element mail = _getRootElement("mail"); mail.setAttribute("default-encoding", charset); // config.setMailDefaultEncoding(charset); }
[ "public", "void", "setMailDefaultCharset", "(", "String", "charset", ")", "throws", "PageException", "{", "checkWriteAccess", "(", ")", ";", "boolean", "hasAccess", "=", "ConfigWebUtil", ".", "hasAccess", "(", "config", ",", "SecurityManager", ".", "TYPE_MAIL", ")...
sets the charset for the mail @param charset @throws SecurityException
[ "sets", "the", "charset", "for", "the", "mail" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java#L437-L454
30,288
lucee/Lucee
core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java
XMLConfigAdmin.updateMailServer
public void updateMailServer(int id, String hostName, String username, String password, int port, boolean tls, boolean ssl, long lifeTimeSpan, long idleTimeSpan, boolean reuseConnections) throws PageException { checkWriteAccess(); boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_MAIL); if (!hasAccess) throw new SecurityException("no access to update mail server settings"); Element mail = _getRootElement("mail"); if (port < 1) port = 21; if (hostName == null || hostName.trim().length() == 0) throw new ExpressionException("Host (SMTP) can be a empty value"); hostName = hostName.trim(); Element[] children = XMLConfigWebFactory.getChildren(mail, "server"); boolean checkId = id > 0; // Update Element server = null; String _hostName, _username; for (int i = 0; i < children.length; i++) { Element el = children[i]; if (checkId) { if (i + 1 == id) { server = el; break; } } else { _hostName = StringUtil.emptyIfNull(el.getAttribute("smtp")); _username = StringUtil.emptyIfNull(el.getAttribute("username")); if (_hostName.equalsIgnoreCase(hostName) && _username.equals(StringUtil.emptyIfNull(username))) { server = el; break; } } } // Insert if (server == null) { server = doc.createElement("server"); mail.appendChild(XMLCaster.toRawNode(server)); } server.setAttribute("smtp", hostName); server.setAttribute("username", username); server.setAttribute("password", ConfigWebUtil.encrypt(password)); server.setAttribute("port", Caster.toString(port)); server.setAttribute("tls", Caster.toString(tls)); server.setAttribute("ssl", Caster.toString(ssl)); server.setAttribute("life", Caster.toString(lifeTimeSpan)); server.setAttribute("idle", Caster.toString(idleTimeSpan)); server.setAttribute("reuse-connection", Caster.toString(reuseConnections)); }
java
public void updateMailServer(int id, String hostName, String username, String password, int port, boolean tls, boolean ssl, long lifeTimeSpan, long idleTimeSpan, boolean reuseConnections) throws PageException { checkWriteAccess(); boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_MAIL); if (!hasAccess) throw new SecurityException("no access to update mail server settings"); Element mail = _getRootElement("mail"); if (port < 1) port = 21; if (hostName == null || hostName.trim().length() == 0) throw new ExpressionException("Host (SMTP) can be a empty value"); hostName = hostName.trim(); Element[] children = XMLConfigWebFactory.getChildren(mail, "server"); boolean checkId = id > 0; // Update Element server = null; String _hostName, _username; for (int i = 0; i < children.length; i++) { Element el = children[i]; if (checkId) { if (i + 1 == id) { server = el; break; } } else { _hostName = StringUtil.emptyIfNull(el.getAttribute("smtp")); _username = StringUtil.emptyIfNull(el.getAttribute("username")); if (_hostName.equalsIgnoreCase(hostName) && _username.equals(StringUtil.emptyIfNull(username))) { server = el; break; } } } // Insert if (server == null) { server = doc.createElement("server"); mail.appendChild(XMLCaster.toRawNode(server)); } server.setAttribute("smtp", hostName); server.setAttribute("username", username); server.setAttribute("password", ConfigWebUtil.encrypt(password)); server.setAttribute("port", Caster.toString(port)); server.setAttribute("tls", Caster.toString(tls)); server.setAttribute("ssl", Caster.toString(ssl)); server.setAttribute("life", Caster.toString(lifeTimeSpan)); server.setAttribute("idle", Caster.toString(idleTimeSpan)); server.setAttribute("reuse-connection", Caster.toString(reuseConnections)); }
[ "public", "void", "updateMailServer", "(", "int", "id", ",", "String", "hostName", ",", "String", "username", ",", "String", "password", ",", "int", "port", ",", "boolean", "tls", ",", "boolean", "ssl", ",", "long", "lifeTimeSpan", ",", "long", "idleTimeSpan...
insert or update a mailserver on system @param hostName @param username @param password @param port @param ssl @param tls @throws PageException
[ "insert", "or", "update", "a", "mailserver", "on", "system" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java#L467-L519
30,289
lucee/Lucee
core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java
XMLConfigAdmin.removeMailServer
public void removeMailServer(String hostName, String username) throws SecurityException { checkWriteAccess(); Element mail = _getRootElement("mail"); Element[] children = XMLConfigWebFactory.getChildren(mail, "server"); String _hostName, _username; if (children.length > 0) { for (int i = 0; i < children.length; i++) { Element el = children[i]; _hostName = el.getAttribute("smtp"); _username = el.getAttribute("username"); if (StringUtil.emptyIfNull(_hostName).equalsIgnoreCase(StringUtil.emptyIfNull(hostName)) && StringUtil.emptyIfNull(_username).equalsIgnoreCase(StringUtil.emptyIfNull(username))) { mail.removeChild(children[i]); } } } }
java
public void removeMailServer(String hostName, String username) throws SecurityException { checkWriteAccess(); Element mail = _getRootElement("mail"); Element[] children = XMLConfigWebFactory.getChildren(mail, "server"); String _hostName, _username; if (children.length > 0) { for (int i = 0; i < children.length; i++) { Element el = children[i]; _hostName = el.getAttribute("smtp"); _username = el.getAttribute("username"); if (StringUtil.emptyIfNull(_hostName).equalsIgnoreCase(StringUtil.emptyIfNull(hostName)) && StringUtil.emptyIfNull(_username).equalsIgnoreCase(StringUtil.emptyIfNull(username))) { mail.removeChild(children[i]); } } } }
[ "public", "void", "removeMailServer", "(", "String", "hostName", ",", "String", "username", ")", "throws", "SecurityException", "{", "checkWriteAccess", "(", ")", ";", "Element", "mail", "=", "_getRootElement", "(", "\"mail\"", ")", ";", "Element", "[", "]", "...
removes a mailserver from system @param hostName @throws SecurityException
[ "removes", "a", "mailserver", "from", "system" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java#L527-L544
30,290
lucee/Lucee
core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java
XMLConfigAdmin.updateMapping
public void updateMapping(String virtual, String physical, String archive, String primary, short inspect, boolean toplevel, int listenerMode, int listenerType, boolean readOnly) throws ExpressionException, SecurityException { checkWriteAccess(); _updateMapping(virtual, physical, archive, primary, inspect, toplevel, listenerMode, listenerType, readOnly); }
java
public void updateMapping(String virtual, String physical, String archive, String primary, short inspect, boolean toplevel, int listenerMode, int listenerType, boolean readOnly) throws ExpressionException, SecurityException { checkWriteAccess(); _updateMapping(virtual, physical, archive, primary, inspect, toplevel, listenerMode, listenerType, readOnly); }
[ "public", "void", "updateMapping", "(", "String", "virtual", ",", "String", "physical", ",", "String", "archive", ",", "String", "primary", ",", "short", "inspect", ",", "boolean", "toplevel", ",", "int", "listenerMode", ",", "int", "listenerType", ",", "boole...
insert or update a mapping on system @param virtual @param physical @param archive @param primary @param trusted @param toplevel @throws ExpressionException @throws SecurityException
[ "insert", "or", "update", "a", "mapping", "on", "system" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java#L599-L603
30,291
lucee/Lucee
core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java
XMLConfigAdmin.removeCustomTag
public void removeCustomTag(String virtual) throws SecurityException { checkWriteAccess(); Element mappings = _getRootElement("custom-tag"); Element[] children = XMLConfigWebFactory.getChildren(mappings, "mapping"); for (int i = 0; i < children.length; i++) { if (virtual.equals(createVirtual(children[i]))) mappings.removeChild(children[i]); } }
java
public void removeCustomTag(String virtual) throws SecurityException { checkWriteAccess(); Element mappings = _getRootElement("custom-tag"); Element[] children = XMLConfigWebFactory.getChildren(mappings, "mapping"); for (int i = 0; i < children.length; i++) { if (virtual.equals(createVirtual(children[i]))) mappings.removeChild(children[i]); } }
[ "public", "void", "removeCustomTag", "(", "String", "virtual", ")", "throws", "SecurityException", "{", "checkWriteAccess", "(", ")", ";", "Element", "mappings", "=", "_getRootElement", "(", "\"custom-tag\"", ")", ";", "Element", "[", "]", "children", "=", "XMLC...
delete a customtagmapping on system @param virtual @throws SecurityException
[ "delete", "a", "customtagmapping", "on", "system" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java#L834-L842
30,292
lucee/Lucee
core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java
XMLConfigAdmin.updateCustomTag
public void updateCustomTag(String virtual, String physical, String archive, String primary, short inspect) throws ExpressionException, SecurityException { checkWriteAccess(); _updateCustomTag(virtual, physical, archive, primary, inspect); }
java
public void updateCustomTag(String virtual, String physical, String archive, String primary, short inspect) throws ExpressionException, SecurityException { checkWriteAccess(); _updateCustomTag(virtual, physical, archive, primary, inspect); }
[ "public", "void", "updateCustomTag", "(", "String", "virtual", ",", "String", "physical", ",", "String", "archive", ",", "String", "primary", ",", "short", "inspect", ")", "throws", "ExpressionException", ",", "SecurityException", "{", "checkWriteAccess", "(", ")"...
insert or update a mapping for Custom Tag @param virtual @param physical @param archive @param primary @param trusted @throws ExpressionException @throws SecurityException
[ "insert", "or", "update", "a", "mapping", "for", "Custom", "Tag" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java#L867-L870
30,293
lucee/Lucee
core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java
XMLConfigAdmin.updateJavaCFX
public void updateJavaCFX(String name, ClassDefinition cd) throws PageException { checkWriteAccess(); boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_CFX_SETTING); if (!hasAccess) throw new SecurityException("no access to change cfx settings"); if (name == null || name.length() == 0) throw new ExpressionException("class name can't be a empty value"); renameOldstyleCFX(); Element tags = _getRootElement("ext-tags"); // Update Element[] children = XMLConfigWebFactory.getChildren(tags, "ext-tag"); for (int i = 0; i < children.length; i++) { String n = children[i].getAttribute("name"); if (n != null && n.equalsIgnoreCase(name)) { Element el = children[i]; if (!"java".equalsIgnoreCase(el.getAttribute("type"))) throw new ExpressionException("there is already a c++ cfx tag with this name"); setClass(el, CustomTag.class, "", cd); el.setAttribute("type", "java"); return; } } // Insert Element el = doc.createElement("ext-tag"); tags.appendChild(el); setClass(el, CustomTag.class, "", cd); el.setAttribute("name", name); el.setAttribute("type", "java"); }
java
public void updateJavaCFX(String name, ClassDefinition cd) throws PageException { checkWriteAccess(); boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_CFX_SETTING); if (!hasAccess) throw new SecurityException("no access to change cfx settings"); if (name == null || name.length() == 0) throw new ExpressionException("class name can't be a empty value"); renameOldstyleCFX(); Element tags = _getRootElement("ext-tags"); // Update Element[] children = XMLConfigWebFactory.getChildren(tags, "ext-tag"); for (int i = 0; i < children.length; i++) { String n = children[i].getAttribute("name"); if (n != null && n.equalsIgnoreCase(name)) { Element el = children[i]; if (!"java".equalsIgnoreCase(el.getAttribute("type"))) throw new ExpressionException("there is already a c++ cfx tag with this name"); setClass(el, CustomTag.class, "", cd); el.setAttribute("type", "java"); return; } } // Insert Element el = doc.createElement("ext-tag"); tags.appendChild(el); setClass(el, CustomTag.class, "", cd); el.setAttribute("name", name); el.setAttribute("type", "java"); }
[ "public", "void", "updateJavaCFX", "(", "String", "name", ",", "ClassDefinition", "cd", ")", "throws", "PageException", "{", "checkWriteAccess", "(", ")", ";", "boolean", "hasAccess", "=", "ConfigWebUtil", ".", "hasAccess", "(", "config", ",", "SecurityManager", ...
insert or update a Java CFX Tag @param name @param strClass @throws PageException
[ "insert", "or", "update", "a", "Java", "CFX", "Tag" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java#L1134-L1167
30,294
lucee/Lucee
core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java
XMLConfigAdmin.fixSalt
public static boolean fixSalt(Document doc) { Element root = doc.getDocumentElement(); String salt = root.getAttribute("salt"); if (StringUtil.isEmpty(salt, true) || !Decision.isUUId(salt)) { // create salt root.setAttribute("salt", CreateUUID.invoke()); return true; } return false; }
java
public static boolean fixSalt(Document doc) { Element root = doc.getDocumentElement(); String salt = root.getAttribute("salt"); if (StringUtil.isEmpty(salt, true) || !Decision.isUUId(salt)) { // create salt root.setAttribute("salt", CreateUUID.invoke()); return true; } return false; }
[ "public", "static", "boolean", "fixSalt", "(", "Document", "doc", ")", "{", "Element", "root", "=", "doc", ".", "getDocumentElement", "(", ")", ";", "String", "salt", "=", "root", ".", "getAttribute", "(", "\"salt\"", ")", ";", "if", "(", "StringUtil", "...
make sure every context has a salt
[ "make", "sure", "every", "context", "has", "a", "salt" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java#L1214-L1223
30,295
lucee/Lucee
core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java
XMLConfigAdmin.removeCFX
public void removeCFX(String name) throws ExpressionException, SecurityException { checkWriteAccess(); // check parameters if (name == null || name.length() == 0) throw new ExpressionException("name for CFX Tag can be a empty value"); renameOldstyleCFX(); Element mappings = _getRootElement("ext-tags"); Element[] children = XMLConfigWebFactory.getChildren(mappings, "ext-tag"); for (int i = 0; i < children.length; i++) { String n = children[i].getAttribute("name"); if (n != null && n.equalsIgnoreCase(name)) { mappings.removeChild(children[i]); } } }
java
public void removeCFX(String name) throws ExpressionException, SecurityException { checkWriteAccess(); // check parameters if (name == null || name.length() == 0) throw new ExpressionException("name for CFX Tag can be a empty value"); renameOldstyleCFX(); Element mappings = _getRootElement("ext-tags"); Element[] children = XMLConfigWebFactory.getChildren(mappings, "ext-tag"); for (int i = 0; i < children.length; i++) { String n = children[i].getAttribute("name"); if (n != null && n.equalsIgnoreCase(name)) { mappings.removeChild(children[i]); } } }
[ "public", "void", "removeCFX", "(", "String", "name", ")", "throws", "ExpressionException", ",", "SecurityException", "{", "checkWriteAccess", "(", ")", ";", "// check parameters", "if", "(", "name", "==", "null", "||", "name", ".", "length", "(", ")", "==", ...
remove a CFX Tag @param name @throws ExpressionException @throws SecurityException
[ "remove", "a", "CFX", "Tag" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java#L1472-L1488
30,296
lucee/Lucee
core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java
XMLConfigAdmin.removeDataSource
public void removeDataSource(String name) throws ExpressionException, SecurityException { checkWriteAccess(); // check parameters if (name == null || name.length() == 0) throw new ExpressionException("name for Datasource Connection can be a empty value"); Element datasources = _getRootElement("data-sources"); Element[] children = XMLConfigWebFactory.getChildren(datasources, "data-source"); for (int i = 0; i < children.length; i++) { String n = children[i].getAttribute("name"); if (n != null && n.equalsIgnoreCase(name)) { datasources.removeChild(children[i]); } } }
java
public void removeDataSource(String name) throws ExpressionException, SecurityException { checkWriteAccess(); // check parameters if (name == null || name.length() == 0) throw new ExpressionException("name for Datasource Connection can be a empty value"); Element datasources = _getRootElement("data-sources"); Element[] children = XMLConfigWebFactory.getChildren(datasources, "data-source"); for (int i = 0; i < children.length; i++) { String n = children[i].getAttribute("name"); if (n != null && n.equalsIgnoreCase(name)) { datasources.removeChild(children[i]); } } }
[ "public", "void", "removeDataSource", "(", "String", "name", ")", "throws", "ExpressionException", ",", "SecurityException", "{", "checkWriteAccess", "(", ")", ";", "// check parameters", "if", "(", "name", "==", "null", "||", "name", ".", "length", "(", ")", ...
remove a DataSource Connection @param name @throws ExpressionException @throws SecurityException
[ "remove", "a", "DataSource", "Connection" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java#L2255-L2269
30,297
lucee/Lucee
core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java
XMLConfigAdmin.updatePSQ
public void updatePSQ(Boolean psq) throws SecurityException { checkWriteAccess(); boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_DATASOURCE); if (!hasAccess) throw new SecurityException("no access to update datsource connections"); Element datasources = _getRootElement("data-sources"); datasources.setAttribute("psq", Caster.toString(psq, "")); if (datasources.hasAttribute("preserve-single-quote")) datasources.removeAttribute("preserve-single-quote"); }
java
public void updatePSQ(Boolean psq) throws SecurityException { checkWriteAccess(); boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_DATASOURCE); if (!hasAccess) throw new SecurityException("no access to update datsource connections"); Element datasources = _getRootElement("data-sources"); datasources.setAttribute("psq", Caster.toString(psq, "")); if (datasources.hasAttribute("preserve-single-quote")) datasources.removeAttribute("preserve-single-quote"); }
[ "public", "void", "updatePSQ", "(", "Boolean", "psq", ")", "throws", "SecurityException", "{", "checkWriteAccess", "(", ")", ";", "boolean", "hasAccess", "=", "ConfigWebUtil", ".", "hasAccess", "(", "config", ",", "SecurityManager", ".", "TYPE_DATASOURCE", ")", ...
update PSQ State @param psq Preserver Single Quote @throws SecurityException
[ "update", "PSQ", "State" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java#L2400-L2409
30,298
lucee/Lucee
core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java
XMLConfigAdmin.updateAllowImplicidQueryCall
public void updateAllowImplicidQueryCall(Boolean allow) throws SecurityException { checkWriteAccess(); boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("no access to update scope setting"); Element scope = _getRootElement("scope"); scope.setAttribute("cascade-to-resultset", Caster.toString(allow, "")); }
java
public void updateAllowImplicidQueryCall(Boolean allow) throws SecurityException { checkWriteAccess(); boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("no access to update scope setting"); Element scope = _getRootElement("scope"); scope.setAttribute("cascade-to-resultset", Caster.toString(allow, "")); }
[ "public", "void", "updateAllowImplicidQueryCall", "(", "Boolean", "allow", ")", "throws", "SecurityException", "{", "checkWriteAccess", "(", ")", ";", "boolean", "hasAccess", "=", "ConfigWebUtil", ".", "hasAccess", "(", "config", ",", "SecurityManager", ".", "TYPE_S...
sets if allowed implicid query call @param allow @throws SecurityException
[ "sets", "if", "allowed", "implicid", "query", "call" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java#L2479-L2488
30,299
lucee/Lucee
core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java
XMLConfigAdmin.updateApplicationTimeout
public void updateApplicationTimeout(TimeSpan span) throws SecurityException { checkWriteAccess(); boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("no access to update scope setting"); Element scope = _getRootElement("scope"); if (span != null) scope.setAttribute("applicationtimeout", span.getDay() + "," + span.getHour() + "," + span.getMinute() + "," + span.getSecond()); else scope.removeAttribute("applicationtimeout"); }
java
public void updateApplicationTimeout(TimeSpan span) throws SecurityException { checkWriteAccess(); boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING); if (!hasAccess) throw new SecurityException("no access to update scope setting"); Element scope = _getRootElement("scope"); if (span != null) scope.setAttribute("applicationtimeout", span.getDay() + "," + span.getHour() + "," + span.getMinute() + "," + span.getSecond()); else scope.removeAttribute("applicationtimeout"); }
[ "public", "void", "updateApplicationTimeout", "(", "TimeSpan", "span", ")", "throws", "SecurityException", "{", "checkWriteAccess", "(", ")", ";", "boolean", "hasAccess", "=", "ConfigWebUtil", ".", "hasAccess", "(", "config", ",", "SecurityManager", ".", "TYPE_SETTI...
updates request timeout value @param span @throws SecurityException
[ "updates", "request", "timeout", "value" ]
29b153fc4e126e5edb97da937f2ee2e231b87593
https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java#L2721-L2730