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
120,800
fusesource/jansi
jansi/src/main/java/org/fusesource/jansi/AnsiPrintStream.java
AnsiPrintStream.processCharsetSelect
private boolean processCharsetSelect(ArrayList<Object> options) { int set = optionInt(options, 0); char seq = ((Character) options.get(1)).charValue(); processCharsetSelect(set, seq); return true; }
java
private boolean processCharsetSelect(ArrayList<Object> options) { int set = optionInt(options, 0); char seq = ((Character) options.get(1)).charValue(); processCharsetSelect(set, seq); return true; }
[ "private", "boolean", "processCharsetSelect", "(", "ArrayList", "<", "Object", ">", "options", ")", "{", "int", "set", "=", "optionInt", "(", "options", ",", "0", ")", ";", "char", "seq", "=", "(", "(", "Character", ")", "options", ".", "get", "(", "1"...
Process character set sequence. @param options options @return true if the charcter set select command was processed.
[ "Process", "character", "set", "sequence", "." ]
bbd72d6e26f4e70a20a5736a496f9cb9d354ca3f
https://github.com/fusesource/jansi/blob/bbd72d6e26f4e70a20a5736a496f9cb9d354ca3f/jansi/src/main/java/org/fusesource/jansi/AnsiPrintStream.java#L761-L766
120,801
fusesource/jansi
jansi/src/main/java/org/fusesource/jansi/AnsiRenderer.java
AnsiRenderer.render
public static Appendable render(final String input, Appendable target) throws IOException { int i = 0; int j, k; while (true) { j = input.indexOf(BEGIN_TOKEN, i); if (j == -1) { if (i == 0) { target.append(input); ...
java
public static Appendable render(final String input, Appendable target) throws IOException { int i = 0; int j, k; while (true) { j = input.indexOf(BEGIN_TOKEN, i); if (j == -1) { if (i == 0) { target.append(input); ...
[ "public", "static", "Appendable", "render", "(", "final", "String", "input", ",", "Appendable", "target", ")", "throws", "IOException", "{", "int", "i", "=", "0", ";", "int", "j", ",", "k", ";", "while", "(", "true", ")", "{", "j", "=", "input", ".",...
Renders the given input to the target Appendable. @param input source to render @param target render onto this target Appendable. @return the given Appendable @throws IOException If an I/O error occurs
[ "Renders", "the", "given", "input", "to", "the", "target", "Appendable", "." ]
bbd72d6e26f4e70a20a5736a496f9cb9d354ca3f
https://github.com/fusesource/jansi/blob/bbd72d6e26f4e70a20a5736a496f9cb9d354ca3f/jansi/src/main/java/org/fusesource/jansi/AnsiRenderer.java#L81-L117
120,802
structr/structr
structr-rest/src/main/java/org/structr/rest/auth/TimeBasedOneTimePasswordHelper.java
TimeBasedOneTimePasswordHelper.zeroPrepend
static String zeroPrepend(long num, int digits) { String numStr = Long.toString(num); if (numStr.length() >= digits) { return numStr; } else { return String.format("%0" + digits + "d", num); } }
java
static String zeroPrepend(long num, int digits) { String numStr = Long.toString(num); if (numStr.length() >= digits) { return numStr; } else { return String.format("%0" + digits + "d", num); } }
[ "static", "String", "zeroPrepend", "(", "long", "num", ",", "int", "digits", ")", "{", "String", "numStr", "=", "Long", ".", "toString", "(", "num", ")", ";", "if", "(", "numStr", ".", "length", "(", ")", ">=", "digits", ")", "{", "return", "numStr",...
Return the string prepended with 0s.
[ "Return", "the", "string", "prepended", "with", "0s", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-rest/src/main/java/org/structr/rest/auth/TimeBasedOneTimePasswordHelper.java#L150-L157
120,803
structr/structr
structr-rest/src/main/java/org/structr/rest/auth/TimeBasedOneTimePasswordHelper.java
TimeBasedOneTimePasswordHelper.decodeBase32
static byte[] decodeBase32(String str) { // each base-32 character encodes 5 bits int numBytes = ((str.length() * 5) + 7) / 8; byte[] result = new byte[numBytes]; int resultIndex = 0; int which = 0; int working = 0; for (int i = 0; i < str.length(); i++) { char ch = str.charAt(i); int val; if (ch...
java
static byte[] decodeBase32(String str) { // each base-32 character encodes 5 bits int numBytes = ((str.length() * 5) + 7) / 8; byte[] result = new byte[numBytes]; int resultIndex = 0; int which = 0; int working = 0; for (int i = 0; i < str.length(); i++) { char ch = str.charAt(i); int val; if (ch...
[ "static", "byte", "[", "]", "decodeBase32", "(", "String", "str", ")", "{", "// each base-32 character encodes 5 bits", "int", "numBytes", "=", "(", "(", "str", ".", "length", "(", ")", "*", "5", ")", "+", "7", ")", "/", "8", ";", "byte", "[", "]", "...
Decode base-32 method. I didn't want to add a dependency to Apache Codec just for this decode method. Exposed for testing.
[ "Decode", "base", "-", "32", "method", ".", "I", "didn", "t", "want", "to", "add", "a", "dependency", "to", "Apache", "Codec", "just", "for", "this", "decode", "method", ".", "Exposed", "for", "testing", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-rest/src/main/java/org/structr/rest/auth/TimeBasedOneTimePasswordHelper.java#L163-L252
120,804
structr/structr
structr-core/src/main/java/org/structr/core/entity/AbstractNode.java
AbstractNode.getName
@Override public final String getName() { String name = getProperty(AbstractNode.name); if (name == null) { name = getUuid(); } return name; }
java
@Override public final String getName() { String name = getProperty(AbstractNode.name); if (name == null) { name = getUuid(); } return name; }
[ "@", "Override", "public", "final", "String", "getName", "(", ")", "{", "String", "name", "=", "getProperty", "(", "AbstractNode", ".", "name", ")", ";", "if", "(", "name", "==", "null", ")", "{", "name", "=", "getUuid", "(", ")", ";", "}", "return",...
Get name from underlying db node If name is null, return node id as fallback
[ "Get", "name", "from", "underlying", "db", "node" ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/core/entity/AbstractNode.java#L353-L363
120,805
structr/structr
structr-core/src/main/java/org/structr/core/entity/AbstractNode.java
AbstractNode.getPropertyKeys
@Override public Set<PropertyKey> getPropertyKeys(final String propertyView) { // check for custom view in content-type field if (securityContext != null && securityContext.hasCustomView()) { final Set<PropertyKey> keys = new LinkedHashSet<>(StructrApp.getConfiguration().getPropertySet(entityType, PropertyVie...
java
@Override public Set<PropertyKey> getPropertyKeys(final String propertyView) { // check for custom view in content-type field if (securityContext != null && securityContext.hasCustomView()) { final Set<PropertyKey> keys = new LinkedHashSet<>(StructrApp.getConfiguration().getPropertySet(entityType, PropertyVie...
[ "@", "Override", "public", "Set", "<", "PropertyKey", ">", "getPropertyKeys", "(", "final", "String", "propertyView", ")", "{", "// check for custom view in content-type field", "if", "(", "securityContext", "!=", "null", "&&", "securityContext", ".", "hasCustomView", ...
Returns the property set for the given view as an Iterable. @param propertyView @return the property set for the given view
[ "Returns", "the", "property", "set", "for", "the", "given", "view", "as", "an", "Iterable", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/core/entity/AbstractNode.java#L408-L429
120,806
structr/structr
structr-core/src/main/java/org/structr/core/entity/AbstractNode.java
AbstractNode.getComparableProperty
@Override public final <T> Comparable getComparableProperty(final PropertyKey<T> key) { if (key != null) { final T propertyValue = getProperty(key); // check property converter PropertyConverter<T, ?> converter = key.databaseConverter(securityContext, this); if (converter != null) { try { re...
java
@Override public final <T> Comparable getComparableProperty(final PropertyKey<T> key) { if (key != null) { final T propertyValue = getProperty(key); // check property converter PropertyConverter<T, ?> converter = key.databaseConverter(securityContext, this); if (converter != null) { try { re...
[ "@", "Override", "public", "final", "<", "T", ">", "Comparable", "getComparableProperty", "(", "final", "PropertyKey", "<", "T", ">", "key", ")", "{", "if", "(", "key", "!=", "null", ")", "{", "final", "T", "propertyValue", "=", "getProperty", "(", "key"...
Returns the property value for the given key as a Comparable @param key the property key to retrieve the value for @return the property value for the given key as a Comparable
[ "Returns", "the", "property", "value", "for", "the", "given", "key", "as", "a", "Comparable" ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/core/entity/AbstractNode.java#L483-L521
120,807
structr/structr
structr-core/src/main/java/org/structr/core/entity/AbstractNode.java
AbstractNode.getRelationshipInfo
public final Map<String, Long> getRelationshipInfo(final Direction dir) throws FrameworkException { return StructrApp.getInstance(securityContext).command(NodeRelationshipStatisticsCommand.class).execute(this, dir); }
java
public final Map<String, Long> getRelationshipInfo(final Direction dir) throws FrameworkException { return StructrApp.getInstance(securityContext).command(NodeRelationshipStatisticsCommand.class).execute(this, dir); }
[ "public", "final", "Map", "<", "String", ",", "Long", ">", "getRelationshipInfo", "(", "final", "Direction", "dir", ")", "throws", "FrameworkException", "{", "return", "StructrApp", ".", "getInstance", "(", "securityContext", ")", ".", "command", "(", "NodeRelat...
Return statistical information on all relationships of this node @param dir @return number of relationships
[ "Return", "statistical", "information", "on", "all", "relationships", "of", "this", "node" ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/core/entity/AbstractNode.java#L684-L686
120,808
structr/structr
structr-core/src/main/java/org/structr/core/entity/AbstractNode.java
AbstractNode.getOwnerNode
@Override public final Principal getOwnerNode() { if (cachedOwnerNode == null) { final Ownership ownership = getIncomingRelationshipAsSuperUser(PrincipalOwnsNode.class); if (ownership != null) { Principal principal = ownership.getSourceNode(); cachedOwnerNode = (Principal) principal; } } ret...
java
@Override public final Principal getOwnerNode() { if (cachedOwnerNode == null) { final Ownership ownership = getIncomingRelationshipAsSuperUser(PrincipalOwnsNode.class); if (ownership != null) { Principal principal = ownership.getSourceNode(); cachedOwnerNode = (Principal) principal; } } ret...
[ "@", "Override", "public", "final", "Principal", "getOwnerNode", "(", ")", "{", "if", "(", "cachedOwnerNode", "==", "null", ")", "{", "final", "Ownership", "ownership", "=", "getIncomingRelationshipAsSuperUser", "(", "PrincipalOwnsNode", ".", "class", ")", ";", ...
Returns the owner node of this node, following an INCOMING OWNS relationship. @return the owner node of this node
[ "Returns", "the", "owner", "node", "of", "this", "node", "following", "an", "INCOMING", "OWNS", "relationship", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/core/entity/AbstractNode.java#L694-L708
120,809
structr/structr
structr-core/src/main/java/org/structr/core/entity/AbstractNode.java
AbstractNode.hasRelationship
public final <A extends NodeInterface, B extends NodeInterface, S extends Source, T extends Target> boolean hasRelationship(final Class<? extends Relation<A, B, S, T>> type) { return this.getRelationships(type).iterator().hasNext(); }
java
public final <A extends NodeInterface, B extends NodeInterface, S extends Source, T extends Target> boolean hasRelationship(final Class<? extends Relation<A, B, S, T>> type) { return this.getRelationships(type).iterator().hasNext(); }
[ "public", "final", "<", "A", "extends", "NodeInterface", ",", "B", "extends", "NodeInterface", ",", "S", "extends", "Source", ",", "T", "extends", "Target", ">", "boolean", "hasRelationship", "(", "final", "Class", "<", "?", "extends", "Relation", "<", "A", ...
Return true if this node has a relationship of given type and direction. @param <A> @param <B> @param <S> @param <T> @param type @return relationships
[ "Return", "true", "if", "this", "node", "has", "a", "relationship", "of", "given", "type", "and", "direction", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/core/entity/AbstractNode.java#L745-L747
120,810
structr/structr
structr-core/src/main/java/org/structr/core/entity/AbstractNode.java
AbstractNode.propagationAllowed
private boolean propagationAllowed(final AbstractNode thisNode, final RelationshipInterface rel, final SchemaRelationshipNode.Direction propagationDirection, final boolean doLog) { // early exit if (propagationDirection.equals(SchemaRelationshipNode.Direction.Both)) { return true; } // early exit if (pro...
java
private boolean propagationAllowed(final AbstractNode thisNode, final RelationshipInterface rel, final SchemaRelationshipNode.Direction propagationDirection, final boolean doLog) { // early exit if (propagationDirection.equals(SchemaRelationshipNode.Direction.Both)) { return true; } // early exit if (pro...
[ "private", "boolean", "propagationAllowed", "(", "final", "AbstractNode", "thisNode", ",", "final", "RelationshipInterface", "rel", ",", "final", "SchemaRelationshipNode", ".", "Direction", "propagationDirection", ",", "final", "boolean", "doLog", ")", "{", "// early ex...
Determines whether propagation of permissions is allowed along the given relationship. CAUTION: this is a complex situation. - we need to determine the EVALUATION DIRECTION, which can be either WITH or AGAINST the RELATIONSHIP DIRECTION - if we are looking at the START NODE of the relationship, we are evaluating WITH...
[ "Determines", "whether", "propagation", "of", "permissions", "is", "allowed", "along", "the", "given", "relationship", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/core/entity/AbstractNode.java#L1045-L1086
120,811
structr/structr
structr-core/src/main/java/org/structr/agent/AgentService.java
AgentService.createAgent
private Agent createAgent(Task forTask) { logger.debug("Creating new agent for task {}", forTask.getClass().getSimpleName()); Agent agent = null; try { agent = lookupAgent(forTask); if (agent != null) { // register us in agent.. agent.setAgentService(this); } } catch (Throwable t) { ...
java
private Agent createAgent(Task forTask) { logger.debug("Creating new agent for task {}", forTask.getClass().getSimpleName()); Agent agent = null; try { agent = lookupAgent(forTask); if (agent != null) { // register us in agent.. agent.setAgentService(this); } } catch (Throwable t) { ...
[ "private", "Agent", "createAgent", "(", "Task", "forTask", ")", "{", "logger", ".", "debug", "(", "\"Creating new agent for task {}\"", ",", "forTask", ".", "getClass", "(", ")", ".", "getSimpleName", "(", ")", ")", ";", "Agent", "agent", "=", "null", ";", ...
Creates a new agent for the given Task. Note that the agent must be started manually after creation. @param forTask @return a new agent for the given task
[ "Creates", "a", "new", "agent", "for", "the", "given", "Task", ".", "Note", "that", "the", "agent", "must", "be", "started", "manually", "after", "creation", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/agent/AgentService.java#L212-L234
120,812
structr/structr
structr-core/src/main/java/org/structr/core/property/ReferenceGroup.java
ReferenceGroup.getDirectAccessReferenceGroup
public <T> PropertyKey<T> getDirectAccessReferenceGroup(String name, Class<T> type) { if (!propertyKeys.containsKey(name)) { throw new IllegalArgumentException("ReferenceGroup " + dbName + " does not contain grouped property " + name + "!"); } return new GenericProperty(propertyKeys.get(name).dbName()); }
java
public <T> PropertyKey<T> getDirectAccessReferenceGroup(String name, Class<T> type) { if (!propertyKeys.containsKey(name)) { throw new IllegalArgumentException("ReferenceGroup " + dbName + " does not contain grouped property " + name + "!"); } return new GenericProperty(propertyKeys.get(name).dbName()); }
[ "public", "<", "T", ">", "PropertyKey", "<", "T", ">", "getDirectAccessReferenceGroup", "(", "String", "name", ",", "Class", "<", "T", ">", "type", ")", "{", "if", "(", "!", "propertyKeys", ".", "containsKey", "(", "name", ")", ")", "{", "throw", "new"...
Returns a wrapped group property that can be used to access a nested group property directly, i.e. without having to fetch the group first. @param <T> @param name @param type @return property
[ "Returns", "a", "wrapped", "group", "property", "that", "can", "be", "used", "to", "access", "a", "nested", "group", "property", "directly", "i", ".", "e", ".", "without", "having", "to", "fetch", "the", "group", "first", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/core/property/ReferenceGroup.java#L194-L201
120,813
structr/structr
structr-ui/src/main/java/org/structr/web/auth/UiAuthenticator.java
UiAuthenticator.checkExternalAuthentication
protected Principal checkExternalAuthentication(final HttpServletRequest request, final HttpServletResponse response) throws FrameworkException { final String path = PathHelper.clean(request.getPathInfo()); final String[] uriParts = PathHelper.getParts(path); logger.debug("Checking external authentication ...")...
java
protected Principal checkExternalAuthentication(final HttpServletRequest request, final HttpServletResponse response) throws FrameworkException { final String path = PathHelper.clean(request.getPathInfo()); final String[] uriParts = PathHelper.getParts(path); logger.debug("Checking external authentication ...")...
[ "protected", "Principal", "checkExternalAuthentication", "(", "final", "HttpServletRequest", "request", ",", "final", "HttpServletResponse", "response", ")", "throws", "FrameworkException", "{", "final", "String", "path", "=", "PathHelper", ".", "clean", "(", "request",...
This method checks all configured external authentication services. @param request @param response @return user
[ "This", "method", "checks", "all", "configured", "external", "authentication", "services", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-ui/src/main/java/org/structr/web/auth/UiAuthenticator.java#L378-L473
120,814
structr/structr
structr-core/src/main/java/org/structr/common/ValidationHelper.java
ValidationHelper.isValidStringMinLength
public static boolean isValidStringMinLength(final GraphObject node, final PropertyKey<String> key, final int minLength, final ErrorBuffer errorBuffer) { String value = node.getProperty(key); String type = node.getType(); if (StringUtils.isNotBlank(value)) { if (value.length() >= minLength) { return t...
java
public static boolean isValidStringMinLength(final GraphObject node, final PropertyKey<String> key, final int minLength, final ErrorBuffer errorBuffer) { String value = node.getProperty(key); String type = node.getType(); if (StringUtils.isNotBlank(value)) { if (value.length() >= minLength) { return t...
[ "public", "static", "boolean", "isValidStringMinLength", "(", "final", "GraphObject", "node", ",", "final", "PropertyKey", "<", "String", ">", "key", ",", "final", "int", "minLength", ",", "final", "ErrorBuffer", "errorBuffer", ")", "{", "String", "value", "=", ...
Checks whether the value for the given property key of the given node has at least the given length. @param node the node @param key the property key whose value should be checked @param minLength the min length @param errorBuffer the error buffer @return true if the condition is valid
[ "Checks", "whether", "the", "value", "for", "the", "given", "property", "key", "of", "the", "given", "node", "has", "at", "least", "the", "given", "length", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/common/ValidationHelper.java#L70-L90
120,815
structr/structr
structr-core/src/main/java/org/structr/core/entity/LinkedListNodeImpl.java
LinkedListNodeImpl.listGetPrevious
@Override public T listGetPrevious(final T currentElement) { Relation<T, T, OneStartpoint<T>, OneEndpoint<T>> prevRel = currentElement.getIncomingRelationship(getSiblingLinkType()); if (prevRel != null) { return (T)prevRel.getSourceNode(); } return null; }
java
@Override public T listGetPrevious(final T currentElement) { Relation<T, T, OneStartpoint<T>, OneEndpoint<T>> prevRel = currentElement.getIncomingRelationship(getSiblingLinkType()); if (prevRel != null) { return (T)prevRel.getSourceNode(); } return null; }
[ "@", "Override", "public", "T", "listGetPrevious", "(", "final", "T", "currentElement", ")", "{", "Relation", "<", "T", ",", "T", ",", "OneStartpoint", "<", "T", ">", ",", "OneEndpoint", "<", "T", ">", ">", "prevRel", "=", "currentElement", ".", "getInco...
Returns the predecessor of the given element in the list structure defined by this LinkedListManager. @param currentElement @return previous element
[ "Returns", "the", "predecessor", "of", "the", "given", "element", "in", "the", "list", "structure", "defined", "by", "this", "LinkedListManager", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/core/entity/LinkedListNodeImpl.java#L44-L54
120,816
structr/structr
structr-core/src/main/java/org/structr/core/entity/LinkedListNodeImpl.java
LinkedListNodeImpl.listGetNext
@Override public T listGetNext(final T currentElement) { Relation<T, T, OneStartpoint<T>, OneEndpoint<T>> nextRel = currentElement.getOutgoingRelationship(getSiblingLinkType()); if (nextRel != null) { return (T)nextRel.getTargetNode(); } return null; }
java
@Override public T listGetNext(final T currentElement) { Relation<T, T, OneStartpoint<T>, OneEndpoint<T>> nextRel = currentElement.getOutgoingRelationship(getSiblingLinkType()); if (nextRel != null) { return (T)nextRel.getTargetNode(); } return null; }
[ "@", "Override", "public", "T", "listGetNext", "(", "final", "T", "currentElement", ")", "{", "Relation", "<", "T", ",", "T", ",", "OneStartpoint", "<", "T", ">", ",", "OneEndpoint", "<", "T", ">", ">", "nextRel", "=", "currentElement", ".", "getOutgoing...
Returns the successor of the given element in the list structure defined by this LinkedListManager. @param currentElement @return next element
[ "Returns", "the", "successor", "of", "the", "given", "element", "in", "the", "list", "structure", "defined", "by", "this", "LinkedListManager", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/core/entity/LinkedListNodeImpl.java#L63-L73
120,817
structr/structr
structr-core/src/main/java/org/structr/core/entity/LinkedListNodeImpl.java
LinkedListNodeImpl.listInsertBefore
@Override public void listInsertBefore(final T currentElement, final T newElement) throws FrameworkException { if (currentElement.getUuid().equals(newElement.getUuid())) { throw new IllegalStateException("Cannot link a node to itself!"); } final T previousElement = listGetPrevious(currentElement); if (pre...
java
@Override public void listInsertBefore(final T currentElement, final T newElement) throws FrameworkException { if (currentElement.getUuid().equals(newElement.getUuid())) { throw new IllegalStateException("Cannot link a node to itself!"); } final T previousElement = listGetPrevious(currentElement); if (pre...
[ "@", "Override", "public", "void", "listInsertBefore", "(", "final", "T", "currentElement", ",", "final", "T", "newElement", ")", "throws", "FrameworkException", "{", "if", "(", "currentElement", ".", "getUuid", "(", ")", ".", "equals", "(", "newElement", ".",...
Inserts newElement before currentElement in the list defined by this LinkedListManager. @param currentElement the reference element @param newElement the new element @throws org.structr.common.error.FrameworkException
[ "Inserts", "newElement", "before", "currentElement", "in", "the", "list", "defined", "by", "this", "LinkedListManager", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/core/entity/LinkedListNodeImpl.java#L83-L109
120,818
structr/structr
structr-core/src/main/java/org/structr/core/entity/LinkedListNodeImpl.java
LinkedListNodeImpl.listInsertAfter
@Override public void listInsertAfter(final T currentElement, final T newElement) throws FrameworkException { if (currentElement.getUuid().equals(newElement.getUuid())) { throw new IllegalStateException("Cannot link a node to itself!"); } final T next = listGetNext(currentElement); if (next == null) { ...
java
@Override public void listInsertAfter(final T currentElement, final T newElement) throws FrameworkException { if (currentElement.getUuid().equals(newElement.getUuid())) { throw new IllegalStateException("Cannot link a node to itself!"); } final T next = listGetNext(currentElement); if (next == null) { ...
[ "@", "Override", "public", "void", "listInsertAfter", "(", "final", "T", "currentElement", ",", "final", "T", "newElement", ")", "throws", "FrameworkException", "{", "if", "(", "currentElement", ".", "getUuid", "(", ")", ".", "equals", "(", "newElement", ".", ...
Inserts newElement after currentElement in the list defined by this LinkedListManager. @param currentElement the reference element @param newElement the new element
[ "Inserts", "newElement", "after", "currentElement", "in", "the", "list", "defined", "by", "this", "LinkedListManager", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/core/entity/LinkedListNodeImpl.java#L118-L144
120,819
structr/structr
structr-core/src/main/java/org/structr/core/entity/LinkedListNodeImpl.java
LinkedListNodeImpl.listRemove
@Override public void listRemove(final T currentElement) throws FrameworkException { final T previousElement = listGetPrevious(currentElement); final T nextElement = listGetNext(currentElement); if (currentElement != null) { if (previousElement != null) { unlinkNodes(getSiblingLinkType(), previousE...
java
@Override public void listRemove(final T currentElement) throws FrameworkException { final T previousElement = listGetPrevious(currentElement); final T nextElement = listGetNext(currentElement); if (currentElement != null) { if (previousElement != null) { unlinkNodes(getSiblingLinkType(), previousE...
[ "@", "Override", "public", "void", "listRemove", "(", "final", "T", "currentElement", ")", "throws", "FrameworkException", "{", "final", "T", "previousElement", "=", "listGetPrevious", "(", "currentElement", ")", ";", "final", "T", "nextElement", "=", "listGetNext...
Removes the current element from the list defined by this LinkedListManager. @param currentElement the element to be removed
[ "Removes", "the", "current", "element", "from", "the", "list", "defined", "by", "this", "LinkedListManager", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/core/entity/LinkedListNodeImpl.java#L152-L180
120,820
structr/structr
structr-rest/src/main/java/org/structr/rest/common/XMLHandler.java
XMLHandler.handleSetProperty
private void handleSetProperty(final Element element, final Map<String, Object> entityData, final Map<String, Object> config) { String propertyName = (String)config.get(PROPERTY_NAME); if (propertyName == null) { propertyName = element.tagName; } entityData.put(propertyName, element.text); }
java
private void handleSetProperty(final Element element, final Map<String, Object> entityData, final Map<String, Object> config) { String propertyName = (String)config.get(PROPERTY_NAME); if (propertyName == null) { propertyName = element.tagName; } entityData.put(propertyName, element.text); }
[ "private", "void", "handleSetProperty", "(", "final", "Element", "element", ",", "final", "Map", "<", "String", ",", "Object", ">", "entityData", ",", "final", "Map", "<", "String", ",", "Object", ">", "config", ")", "{", "String", "propertyName", "=", "("...
The setProperty action will not descend further into the collection of children, but will instead evaluate a transformation expression. @param element element @param entityData parent's entity data @param config type configuration
[ "The", "setProperty", "action", "will", "not", "descend", "further", "into", "the", "collection", "of", "children", "but", "will", "instead", "evaluate", "a", "transformation", "expression", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-rest/src/main/java/org/structr/rest/common/XMLHandler.java#L310-L319
120,821
structr/structr
structr-core/src/main/java/org/structr/schema/export/StructrSchema.java
StructrSchema.createFromDatabase
public static JsonSchema createFromDatabase(final App app, final List<String> types) throws FrameworkException, URISyntaxException { try (final Tx tx = app.tx()) { final JsonSchema schema = StructrSchemaDefinition.initializeFromDatabase(app, types); tx.success(); return schema; } }
java
public static JsonSchema createFromDatabase(final App app, final List<String> types) throws FrameworkException, URISyntaxException { try (final Tx tx = app.tx()) { final JsonSchema schema = StructrSchemaDefinition.initializeFromDatabase(app, types); tx.success(); return schema; } }
[ "public", "static", "JsonSchema", "createFromDatabase", "(", "final", "App", "app", ",", "final", "List", "<", "String", ">", "types", ")", "throws", "FrameworkException", ",", "URISyntaxException", "{", "try", "(", "final", "Tx", "tx", "=", "app", ".", "tx"...
Creates JsonSchema instance from the current schema in Structr, including only a subset of schema nodes. @param app @param types @return the current Structr schema @throws FrameworkException @throws URISyntaxException
[ "Creates", "JsonSchema", "instance", "from", "the", "current", "schema", "in", "Structr", "including", "only", "a", "subset", "of", "schema", "nodes", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/schema/export/StructrSchema.java#L75-L85
120,822
structr/structr
structr-core/src/main/java/org/structr/schema/export/StructrSchema.java
StructrSchema.createFromSource
public static JsonSchema createFromSource(final String source) throws InvalidSchemaException, URISyntaxException { return StructrSchema.createFromSource(new StringReader(source)); }
java
public static JsonSchema createFromSource(final String source) throws InvalidSchemaException, URISyntaxException { return StructrSchema.createFromSource(new StringReader(source)); }
[ "public", "static", "JsonSchema", "createFromSource", "(", "final", "String", "source", ")", "throws", "InvalidSchemaException", ",", "URISyntaxException", "{", "return", "StructrSchema", ".", "createFromSource", "(", "new", "StringReader", "(", "source", ")", ")", ...
Parses a JsonSchema from the given string. @param source @return @throws InvalidSchemaException @throws URISyntaxException
[ "Parses", "a", "JsonSchema", "from", "the", "given", "string", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/schema/export/StructrSchema.java#L97-L99
120,823
structr/structr
structr-core/src/main/java/org/structr/schema/export/StructrSchema.java
StructrSchema.createFromSource
public static JsonSchema createFromSource(final Reader reader) throws InvalidSchemaException, URISyntaxException { final Gson gson = new GsonBuilder().create(); final Map<String, Object> rawData = gson.fromJson(reader, Map.class); return StructrSchemaDefinition.initializeFromSource(rawDa...
java
public static JsonSchema createFromSource(final Reader reader) throws InvalidSchemaException, URISyntaxException { final Gson gson = new GsonBuilder().create(); final Map<String, Object> rawData = gson.fromJson(reader, Map.class); return StructrSchemaDefinition.initializeFromSource(rawDa...
[ "public", "static", "JsonSchema", "createFromSource", "(", "final", "Reader", "reader", ")", "throws", "InvalidSchemaException", ",", "URISyntaxException", "{", "final", "Gson", "gson", "=", "new", "GsonBuilder", "(", ")", ".", "create", "(", ")", ";", "final", ...
Parses a JsonSchema from the given reader. @param reader @return @throws InvalidSchemaException @throws URISyntaxException
[ "Parses", "a", "JsonSchema", "from", "the", "given", "reader", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/schema/export/StructrSchema.java#L111-L117
120,824
structr/structr
structr-core/src/main/java/org/structr/schema/export/StructrSchema.java
StructrSchema.replaceDatabaseSchema
public static void replaceDatabaseSchema(final App app, final JsonSchema newSchema) throws FrameworkException, URISyntaxException { Services.getInstance().setOverridingSchemaTypesAllowed(true); try (final Tx tx = app.tx()) { for (final SchemaRelationshipNode schemaRelationship : app.nodeQuery(SchemaRelationsh...
java
public static void replaceDatabaseSchema(final App app, final JsonSchema newSchema) throws FrameworkException, URISyntaxException { Services.getInstance().setOverridingSchemaTypesAllowed(true); try (final Tx tx = app.tx()) { for (final SchemaRelationshipNode schemaRelationship : app.nodeQuery(SchemaRelationsh...
[ "public", "static", "void", "replaceDatabaseSchema", "(", "final", "App", "app", ",", "final", "JsonSchema", "newSchema", ")", "throws", "FrameworkException", ",", "URISyntaxException", "{", "Services", ".", "getInstance", "(", ")", ".", "setOverridingSchemaTypesAllow...
Replaces the current Structr schema with the given new schema. This method is the reverse of createFromDatabase above. @param app @param newSchema the new schema to replace the current Structr schema @throws FrameworkException @throws URISyntaxException
[ "Replaces", "the", "current", "Structr", "schema", "with", "the", "given", "new", "schema", ".", "This", "method", "is", "the", "reverse", "of", "createFromDatabase", "above", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/schema/export/StructrSchema.java#L150-L184
120,825
structr/structr
structr-core/src/main/java/org/structr/schema/export/StructrSchema.java
StructrSchema.extendDatabaseSchema
public static void extendDatabaseSchema(final App app, final JsonSchema newSchema) throws FrameworkException, URISyntaxException { try (final Tx tx = app.tx()) { newSchema.createDatabaseSchema(app, JsonSchema.ImportMode.extend); tx.success(); } }
java
public static void extendDatabaseSchema(final App app, final JsonSchema newSchema) throws FrameworkException, URISyntaxException { try (final Tx tx = app.tx()) { newSchema.createDatabaseSchema(app, JsonSchema.ImportMode.extend); tx.success(); } }
[ "public", "static", "void", "extendDatabaseSchema", "(", "final", "App", "app", ",", "final", "JsonSchema", "newSchema", ")", "throws", "FrameworkException", ",", "URISyntaxException", "{", "try", "(", "final", "Tx", "tx", "=", "app", ".", "tx", "(", ")", ")...
Extend the current Structr schema by the elements contained in the given new schema. @param app @param newSchema the new schema to add to the current Structr schema @throws FrameworkException @throws URISyntaxException
[ "Extend", "the", "current", "Structr", "schema", "by", "the", "elements", "contained", "in", "the", "given", "new", "schema", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/schema/export/StructrSchema.java#L195-L203
120,826
structr/structr
structr-core/src/main/java/javatools/parsers/Char.java
Char.eatPercentage
public static char eatPercentage(String a, int[] n) { // Length 0 if (!a.startsWith("%") || a.length() < 3) { n[0] = 0; return ((char) 0); } char c; // Try to parse first char try { c = (char) Integer.parseInt(a.substring(1, 3), 16); } catch (Exception e) { n[0] = -1;...
java
public static char eatPercentage(String a, int[] n) { // Length 0 if (!a.startsWith("%") || a.length() < 3) { n[0] = 0; return ((char) 0); } char c; // Try to parse first char try { c = (char) Integer.parseInt(a.substring(1, 3), 16); } catch (Exception e) { n[0] = -1;...
[ "public", "static", "char", "eatPercentage", "(", "String", "a", ",", "int", "[", "]", "n", ")", "{", "// Length 0", "if", "(", "!", "a", ".", "startsWith", "(", "\"%\"", ")", "||", "a", ".", "length", "(", ")", "<", "3", ")", "{", "n", "[", "0...
Eats a String of the form "%xx" from a string, where xx is a hexadecimal code. If xx is a UTF8 code start, tries to complete the UTF8-code and decodes it.
[ "Eats", "a", "String", "of", "the", "form", "%xx", "from", "a", "string", "where", "xx", "is", "a", "hexadecimal", "code", ".", "If", "xx", "is", "a", "UTF8", "code", "start", "tries", "to", "complete", "the", "UTF8", "-", "code", "and", "decodes", "...
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/javatools/parsers/Char.java#L670-L703
120,827
structr/structr
structr-core/src/main/java/javatools/parsers/Char.java
Char.eatAmpersand
public static char eatAmpersand(String a, int[] n) { n[0] = 0; if (!a.startsWith("&")) return ((char) 0); // Seek to ';' // We also accept spaces and the end of the String as a delimiter while (n[0] < a.length() && !Character.isSpaceChar(a.charAt(n[0])) && a.charAt(n[0]) != ';') n[0]++; if...
java
public static char eatAmpersand(String a, int[] n) { n[0] = 0; if (!a.startsWith("&")) return ((char) 0); // Seek to ';' // We also accept spaces and the end of the String as a delimiter while (n[0] < a.length() && !Character.isSpaceChar(a.charAt(n[0])) && a.charAt(n[0]) != ';') n[0]++; if...
[ "public", "static", "char", "eatAmpersand", "(", "String", "a", ",", "int", "[", "]", "n", ")", "{", "n", "[", "0", "]", "=", "0", ";", "if", "(", "!", "a", ".", "startsWith", "(", "\"&\"", ")", ")", "return", "(", "(", "char", ")", "0", ")",...
Eats an HTML ampersand code from a String
[ "Eats", "an", "HTML", "ampersand", "code", "from", "a", "String" ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/javatools/parsers/Char.java#L706-L746
120,828
structr/structr
structr-core/src/main/java/javatools/parsers/Char.java
Char.eatUtf8
public static char eatUtf8(String a, int[] n) { if (a.length() == 0) { n[0] = 0; return ((char) 0); } n[0] = Utf8Length(a.charAt(0)); if (a.length() >= n[0]) { switch (n[0]) { case 1: return (a.charAt(0)); case 2: if ((a.charAt(1) & 0xC0) != 0x80) br...
java
public static char eatUtf8(String a, int[] n) { if (a.length() == 0) { n[0] = 0; return ((char) 0); } n[0] = Utf8Length(a.charAt(0)); if (a.length() >= n[0]) { switch (n[0]) { case 1: return (a.charAt(0)); case 2: if ((a.charAt(1) & 0xC0) != 0x80) br...
[ "public", "static", "char", "eatUtf8", "(", "String", "a", ",", "int", "[", "]", "n", ")", "{", "if", "(", "a", ".", "length", "(", ")", "==", "0", ")", "{", "n", "[", "0", "]", "=", "0", ";", "return", "(", "(", "char", ")", "0", ")", ";...
Eats a UTF8 code from a String. There is also a built-in way in Java that converts UTF8 to characters and back, but it does not work with all characters.
[ "Eats", "a", "UTF8", "code", "from", "a", "String", ".", "There", "is", "also", "a", "built", "-", "in", "way", "in", "Java", "that", "converts", "UTF8", "to", "characters", "and", "back", "but", "it", "does", "not", "work", "with", "all", "characters"...
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/javatools/parsers/Char.java#L765-L788
120,829
structr/structr
structr-core/src/main/java/javatools/parsers/Char.java
Char.decodeUTF8
public static String decodeUTF8(String s) { StringBuilder result = new StringBuilder(); int[] eatLength = new int[1]; while (s.length() != 0) { char c = eatUtf8(s, eatLength); if (eatLength[0] != -1) { result.append(c); s = s.substring(eatLength[0]); } else { result...
java
public static String decodeUTF8(String s) { StringBuilder result = new StringBuilder(); int[] eatLength = new int[1]; while (s.length() != 0) { char c = eatUtf8(s, eatLength); if (eatLength[0] != -1) { result.append(c); s = s.substring(eatLength[0]); } else { result...
[ "public", "static", "String", "decodeUTF8", "(", "String", "s", ")", "{", "StringBuilder", "result", "=", "new", "StringBuilder", "(", ")", ";", "int", "[", "]", "eatLength", "=", "new", "int", "[", "1", "]", ";", "while", "(", "s", ".", "length", "(...
Decodes all UTF8 characters in the string
[ "Decodes", "all", "UTF8", "characters", "in", "the", "string" ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/javatools/parsers/Char.java#L791-L805
120,830
structr/structr
structr-core/src/main/java/javatools/parsers/Char.java
Char.decodePercentage
public static String decodePercentage(String s) { StringBuilder result = new StringBuilder(); int[] eatLength = new int[1]; while (s.length() != 0) { char c = eatPercentage(s, eatLength); if (eatLength[0] > 1) { result.append(c); s = s.substring(eatLength[0]); } else { ...
java
public static String decodePercentage(String s) { StringBuilder result = new StringBuilder(); int[] eatLength = new int[1]; while (s.length() != 0) { char c = eatPercentage(s, eatLength); if (eatLength[0] > 1) { result.append(c); s = s.substring(eatLength[0]); } else { ...
[ "public", "static", "String", "decodePercentage", "(", "String", "s", ")", "{", "StringBuilder", "result", "=", "new", "StringBuilder", "(", ")", ";", "int", "[", "]", "eatLength", "=", "new", "int", "[", "1", "]", ";", "while", "(", "s", ".", "length"...
Decodes all percentage characters in the string
[ "Decodes", "all", "percentage", "characters", "in", "the", "string" ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/javatools/parsers/Char.java#L808-L822
120,831
structr/structr
structr-core/src/main/java/javatools/parsers/Char.java
Char.decodeAmpersand
public static String decodeAmpersand(String s) { if(s==null || s.indexOf('&')==-1) return(s); StringBuilder result = new StringBuilder(); int[] eatLength = new int[1];// add this in order to multithread safe while (s.length() != 0) { char c = eatAmpersand(s, eatLength); if (eatLength[0] > 1)...
java
public static String decodeAmpersand(String s) { if(s==null || s.indexOf('&')==-1) return(s); StringBuilder result = new StringBuilder(); int[] eatLength = new int[1];// add this in order to multithread safe while (s.length() != 0) { char c = eatAmpersand(s, eatLength); if (eatLength[0] > 1)...
[ "public", "static", "String", "decodeAmpersand", "(", "String", "s", ")", "{", "if", "(", "s", "==", "null", "||", "s", ".", "indexOf", "(", "'", "'", ")", "==", "-", "1", ")", "return", "(", "s", ")", ";", "StringBuilder", "result", "=", "new", ...
Decodes all ampersand sequences in the string
[ "Decodes", "all", "ampersand", "sequences", "in", "the", "string" ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/javatools/parsers/Char.java#L955-L970
120,832
structr/structr
structr-core/src/main/java/javatools/parsers/Char.java
Char.decodeBackslash
public static String decodeBackslash(String s) { if(s==null || s.indexOf('\\')==-1) return(s); StringBuilder result = new StringBuilder(); int[] eatLength = new int[1]; while (s.length() != 0) { char c = eatBackslash(s, eatLength); if (eatLength[0] > 1) { result.append(c); s =...
java
public static String decodeBackslash(String s) { if(s==null || s.indexOf('\\')==-1) return(s); StringBuilder result = new StringBuilder(); int[] eatLength = new int[1]; while (s.length() != 0) { char c = eatBackslash(s, eatLength); if (eatLength[0] > 1) { result.append(c); s =...
[ "public", "static", "String", "decodeBackslash", "(", "String", "s", ")", "{", "if", "(", "s", "==", "null", "||", "s", ".", "indexOf", "(", "'", "'", ")", "==", "-", "1", ")", "return", "(", "s", ")", ";", "StringBuilder", "result", "=", "new", ...
Decodes all backslash characters in the string
[ "Decodes", "all", "backslash", "characters", "in", "the", "string" ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/javatools/parsers/Char.java#L973-L988
120,833
structr/structr
structr-core/src/main/java/javatools/parsers/Char.java
Char.encodeBackslash
public static String encodeBackslash(CharSequence s, Legal legal) { StringBuilder b=new StringBuilder((int)(s.length()*1.5)); for(int i=0;i<s.length();i++) { if(legal.isLegal(s.charAt(i))) { b.append(s.charAt(i)); } else { if(charToBackslash.containsKey(s.charAt(i))) { b.append(charToBackslash.get(s.cha...
java
public static String encodeBackslash(CharSequence s, Legal legal) { StringBuilder b=new StringBuilder((int)(s.length()*1.5)); for(int i=0;i<s.length();i++) { if(legal.isLegal(s.charAt(i))) { b.append(s.charAt(i)); } else { if(charToBackslash.containsKey(s.charAt(i))) { b.append(charToBackslash.get(s.cha...
[ "public", "static", "String", "encodeBackslash", "(", "CharSequence", "s", ",", "Legal", "legal", ")", "{", "StringBuilder", "b", "=", "new", "StringBuilder", "(", "(", "int", ")", "(", "s", ".", "length", "(", ")", "*", "1.5", ")", ")", ";", "for", ...
Encodes with backslash all illegal characters
[ "Encodes", "with", "backslash", "all", "illegal", "characters" ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/javatools/parsers/Char.java#L996-L1014
120,834
structr/structr
structr-core/src/main/java/javatools/parsers/Char.java
Char.eatBackslash
public static char eatBackslash(String a, int[] n) { if (!a.startsWith("\\")) { n[0] = 0; return ((char) 0); } // Unicodes BS u XXXX if (a.startsWith("\\u")) { try { n[0] = 6; return ((char) Integer.parseInt(a.substring(2, 6), 16)); } catch (Exception e) { ...
java
public static char eatBackslash(String a, int[] n) { if (!a.startsWith("\\")) { n[0] = 0; return ((char) 0); } // Unicodes BS u XXXX if (a.startsWith("\\u")) { try { n[0] = 6; return ((char) Integer.parseInt(a.substring(2, 6), 16)); } catch (Exception e) { ...
[ "public", "static", "char", "eatBackslash", "(", "String", "a", ",", "int", "[", "]", "n", ")", "{", "if", "(", "!", "a", ".", "startsWith", "(", "\"\\\\\"", ")", ")", "{", "n", "[", "0", "]", "=", "0", ";", "return", "(", "(", "char", ")", "...
Eats a backslash sequence from a String
[ "Eats", "a", "backslash", "sequence", "from", "a", "String" ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/javatools/parsers/Char.java#L1017-L1089
120,835
structr/structr
structr-core/src/main/java/javatools/parsers/Char.java
Char.decode
public static String decode(String s) { StringBuilder b = new StringBuilder(); int[] eatLength = new int[1]; while (s.length() > 0) { char c = eatPercentage(s, eatLength); if (eatLength[0] <= 0) { c = eatAmpersand(s, eatLength); if (eatLength[0] <= 0) { c = eatBackslash...
java
public static String decode(String s) { StringBuilder b = new StringBuilder(); int[] eatLength = new int[1]; while (s.length() > 0) { char c = eatPercentage(s, eatLength); if (eatLength[0] <= 0) { c = eatAmpersand(s, eatLength); if (eatLength[0] <= 0) { c = eatBackslash...
[ "public", "static", "String", "decode", "(", "String", "s", ")", "{", "StringBuilder", "b", "=", "new", "StringBuilder", "(", ")", ";", "int", "[", "]", "eatLength", "=", "new", "int", "[", "1", "]", ";", "while", "(", "s", ".", "length", "(", ")",...
Replaces all codes in a String by the 16 bit Unicode characters
[ "Replaces", "all", "codes", "in", "a", "String", "by", "the", "16", "bit", "Unicode", "characters" ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/javatools/parsers/Char.java#L1092-L1114
120,836
structr/structr
structr-core/src/main/java/javatools/parsers/Char.java
Char.encodeXmlAttribute
public static String encodeXmlAttribute(String str) { if (str == null) return null; int len = str.length(); if (len == 0) return str; StringBuffer encoded = new StringBuffer(); for (int i = 0; i < len; i++) { char c = str.charAt(i); if (c == '<') encoded.append("&lt;"); else if (c ...
java
public static String encodeXmlAttribute(String str) { if (str == null) return null; int len = str.length(); if (len == 0) return str; StringBuffer encoded = new StringBuffer(); for (int i = 0; i < len; i++) { char c = str.charAt(i); if (c == '<') encoded.append("&lt;"); else if (c ...
[ "public", "static", "String", "encodeXmlAttribute", "(", "String", "str", ")", "{", "if", "(", "str", "==", "null", ")", "return", "null", ";", "int", "len", "=", "str", ".", "length", "(", ")", ";", "if", "(", "len", "==", "0", ")", "return", "str...
Encodes a String with reserved XML characters into a valid xml string for attributes. @param str @return
[ "Encodes", "a", "String", "with", "reserved", "XML", "characters", "into", "a", "valid", "xml", "string", "for", "attributes", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/javatools/parsers/Char.java#L1185-L1200
120,837
structr/structr
structr-core/src/main/java/javatools/parsers/Char.java
Char.encodeURIPathComponent
public static String encodeURIPathComponent(String s) { StringBuilder result = new StringBuilder(); for (int i = 0; i < s.length(); i++) { result.append(Char.encodeURIPathComponent(s.charAt(i))); } return (result.toString()); }
java
public static String encodeURIPathComponent(String s) { StringBuilder result = new StringBuilder(); for (int i = 0; i < s.length(); i++) { result.append(Char.encodeURIPathComponent(s.charAt(i))); } return (result.toString()); }
[ "public", "static", "String", "encodeURIPathComponent", "(", "String", "s", ")", "{", "StringBuilder", "result", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "s", ".", "length", "(", ")", ";", "i", "++"...
Encodes a char to percentage code, if it is not a path character in the sense of URIs
[ "Encodes", "a", "char", "to", "percentage", "code", "if", "it", "is", "not", "a", "path", "character", "in", "the", "sense", "of", "URIs" ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/javatools/parsers/Char.java#L1254-L1260
120,838
structr/structr
structr-core/src/main/java/javatools/parsers/Char.java
Char.encodeURIPathComponentXML
public static String encodeURIPathComponentXML(String s) { StringBuilder result = new StringBuilder(); for (int i = 0; i < s.length(); i++) { if (s.charAt(i) == '&') result.append(Char.encodePercentage(s.charAt(i))); else if (s.charAt(i) == '"') result.append(Char.encodePercentage(s.charAt(i))); ...
java
public static String encodeURIPathComponentXML(String s) { StringBuilder result = new StringBuilder(); for (int i = 0; i < s.length(); i++) { if (s.charAt(i) == '&') result.append(Char.encodePercentage(s.charAt(i))); else if (s.charAt(i) == '"') result.append(Char.encodePercentage(s.charAt(i))); ...
[ "public", "static", "String", "encodeURIPathComponentXML", "(", "String", "s", ")", "{", "StringBuilder", "result", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "s", ".", "length", "(", ")", ";", "i", "...
Encodes a char to percentage code, if it is not a path character in the sense of XMLs
[ "Encodes", "a", "char", "to", "percentage", "code", "if", "it", "is", "not", "a", "path", "character", "in", "the", "sense", "of", "XMLs" ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/javatools/parsers/Char.java#L1263-L1271
120,839
structr/structr
structr-core/src/main/java/javatools/parsers/Char.java
Char.encodeUTF8
public static String encodeUTF8(String c) { StringBuilder r = new StringBuilder(); for (int i = 0; i < c.length(); i++) { r.append(encodeUTF8(c.charAt(i))); } return (r.toString()); }
java
public static String encodeUTF8(String c) { StringBuilder r = new StringBuilder(); for (int i = 0; i < c.length(); i++) { r.append(encodeUTF8(c.charAt(i))); } return (r.toString()); }
[ "public", "static", "String", "encodeUTF8", "(", "String", "c", ")", "{", "StringBuilder", "r", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "c", ".", "length", "(", ")", ";", "i", "++", ")", "{", ...
Encodes a String to UTF8
[ "Encodes", "a", "String", "to", "UTF8" ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/javatools/parsers/Char.java#L1279-L1285
120,840
structr/structr
structr-core/src/main/java/javatools/parsers/Char.java
Char.normalize
public static String normalize(String s) { StringBuilder b = new StringBuilder(); for (int i = 0; i < s.length(); i++) b.append(normalize(s.charAt(i))); return (b.toString()); }
java
public static String normalize(String s) { StringBuilder b = new StringBuilder(); for (int i = 0; i < s.length(); i++) b.append(normalize(s.charAt(i))); return (b.toString()); }
[ "public", "static", "String", "normalize", "(", "String", "s", ")", "{", "StringBuilder", "b", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "s", ".", "length", "(", ")", ";", "i", "++", ")", "b", ...
Normalizes all chars in a String to characters 0x20-0x7F
[ "Normalizes", "all", "chars", "in", "a", "String", "to", "characters", "0x20", "-", "0x7F" ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/javatools/parsers/Char.java#L1349-L1354
120,841
structr/structr
structr-core/src/main/java/javatools/parsers/Char.java
Char.cutLast
public static String cutLast(String s) { return (s.length() == 0 ? "" : s.substring(0, s.length() - 1)); }
java
public static String cutLast(String s) { return (s.length() == 0 ? "" : s.substring(0, s.length() - 1)); }
[ "public", "static", "String", "cutLast", "(", "String", "s", ")", "{", "return", "(", "s", ".", "length", "(", ")", "==", "0", "?", "\"\"", ":", "s", ".", "substring", "(", "0", ",", "s", ".", "length", "(", ")", "-", "1", ")", ")", ";", "}" ...
Returns the String without the last character
[ "Returns", "the", "String", "without", "the", "last", "character" ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/javatools/parsers/Char.java#L1362-L1364
120,842
structr/structr
structr-core/src/main/java/javatools/parsers/Char.java
Char.hexAll
public static String hexAll(String s) { StringBuilder result = new StringBuilder(); for (int i = 0; i < s.length(); i++) { result.append(Integer.toHexString(s.charAt(i)).toUpperCase()).append(' '); } return (result.toString()); }
java
public static String hexAll(String s) { StringBuilder result = new StringBuilder(); for (int i = 0; i < s.length(); i++) { result.append(Integer.toHexString(s.charAt(i)).toUpperCase()).append(' '); } return (result.toString()); }
[ "public", "static", "String", "hexAll", "(", "String", "s", ")", "{", "StringBuilder", "result", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "s", ".", "length", "(", ")", ";", "i", "++", ")", "{", ...
Returns the chars of a String in hex
[ "Returns", "the", "chars", "of", "a", "String", "in", "hex" ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/javatools/parsers/Char.java#L1378-L1384
120,843
structr/structr
structr-core/src/main/java/javatools/parsers/Char.java
Char.lowCaseFirst
public static String lowCaseFirst(String s) { if (s == null || s.length() == 0) return (s); return (Character.toLowerCase(s.charAt(0)) + s.substring(1)); }
java
public static String lowCaseFirst(String s) { if (s == null || s.length() == 0) return (s); return (Character.toLowerCase(s.charAt(0)) + s.substring(1)); }
[ "public", "static", "String", "lowCaseFirst", "(", "String", "s", ")", "{", "if", "(", "s", "==", "null", "||", "s", ".", "length", "(", ")", "==", "0", ")", "return", "(", "s", ")", ";", "return", "(", "Character", ".", "toLowerCase", "(", "s", ...
Lowcases the first character in a String
[ "Lowcases", "the", "first", "character", "in", "a", "String" ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/javatools/parsers/Char.java#L1404-L1407
120,844
structr/structr
structr-core/src/main/java/javatools/parsers/Char.java
Char.truncate
public static CharSequence truncate(CharSequence s, int len) { if (s.length() == len) return (s); if (s.length() > len) return (s.subSequence(0, len)); StringBuilder result = new StringBuilder(s); while (result.length() < len) result.append(' '); return (result); }
java
public static CharSequence truncate(CharSequence s, int len) { if (s.length() == len) return (s); if (s.length() > len) return (s.subSequence(0, len)); StringBuilder result = new StringBuilder(s); while (result.length() < len) result.append(' '); return (result); }
[ "public", "static", "CharSequence", "truncate", "(", "CharSequence", "s", ",", "int", "len", ")", "{", "if", "(", "s", ".", "length", "(", ")", "==", "len", ")", "return", "(", "s", ")", ";", "if", "(", "s", ".", "length", "(", ")", ">", "len", ...
Returns a string of the given length, fills with spaces if necessary
[ "Returns", "a", "string", "of", "the", "given", "length", "fills", "with", "spaces", "if", "necessary" ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/javatools/parsers/Char.java#L1410-L1417
120,845
structr/structr
structr-core/src/main/java/javatools/parsers/Char.java
Char.capitalize
public static String capitalize(String s) { StringBuilder result = new StringBuilder(); for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (i == 0 || i > 0 && !Character.isLetterOrDigit(s.charAt(i - 1))) c = Character.toUpperCase(c); else c = Character.toLowerCase(c); result...
java
public static String capitalize(String s) { StringBuilder result = new StringBuilder(); for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (i == 0 || i > 0 && !Character.isLetterOrDigit(s.charAt(i - 1))) c = Character.toUpperCase(c); else c = Character.toLowerCase(c); result...
[ "public", "static", "String", "capitalize", "(", "String", "s", ")", "{", "StringBuilder", "result", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "s", ".", "length", "(", ")", ";", "i", "++", ")", "...
Capitalizes words and lowercases the rest
[ "Capitalizes", "words", "and", "lowercases", "the", "rest" ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/javatools/parsers/Char.java#L1420-L1429
120,846
structr/structr
structr-core/src/main/java/javatools/parsers/Char.java
Char.endsWith
public static boolean endsWith(CharSequence s, String end) { return (s.length() >= end.length() && s.subSequence(s.length() - end.length(), s.length()).equals(end)); }
java
public static boolean endsWith(CharSequence s, String end) { return (s.length() >= end.length() && s.subSequence(s.length() - end.length(), s.length()).equals(end)); }
[ "public", "static", "boolean", "endsWith", "(", "CharSequence", "s", ",", "String", "end", ")", "{", "return", "(", "s", ".", "length", "(", ")", ">=", "end", ".", "length", "(", ")", "&&", "s", ".", "subSequence", "(", "s", ".", "length", "(", ")"...
TRUE if the Charsequence ends with the string
[ "TRUE", "if", "the", "Charsequence", "ends", "with", "the", "string" ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/javatools/parsers/Char.java#L1432-L1434
120,847
structr/structr
structr-ui/src/main/java/org/structr/web/auth/StructrOAuthClient.java
StructrOAuthClient.getServer
public static StructrOAuthClient getServer(final String name) { String configuredOauthServers = Settings.OAuthServers.getValue(); String[] authServers = configuredOauthServers.split(" "); for (String authServer : authServers) { if (authServer.equals(name)) { String authLocation = Settings.getOrCreate...
java
public static StructrOAuthClient getServer(final String name) { String configuredOauthServers = Settings.OAuthServers.getValue(); String[] authServers = configuredOauthServers.split(" "); for (String authServer : authServers) { if (authServer.equals(name)) { String authLocation = Settings.getOrCreate...
[ "public", "static", "StructrOAuthClient", "getServer", "(", "final", "String", "name", ")", "{", "String", "configuredOauthServers", "=", "Settings", ".", "OAuthServers", ".", "getValue", "(", ")", ";", "String", "[", "]", "authServers", "=", "configuredOauthServe...
Build an OAuth2 server from the configured values for the given name. @param name @return server
[ "Build", "an", "OAuth2", "server", "from", "the", "configured", "values", "for", "the", "given", "name", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-ui/src/main/java/org/structr/web/auth/StructrOAuthClient.java#L155-L203
120,848
structr/structr
structr-ui/src/main/java/org/structr/web/common/FileHelper.java
FileHelper.transformFile
public static <T extends File> T transformFile(final SecurityContext securityContext, final String uuid, final Class<T> fileType) throws FrameworkException, IOException { AbstractFile existingFile = getFileByUuid(securityContext, uuid); if (existingFile != null) { existingFile.unlockSystemPropertiesOnce(); ...
java
public static <T extends File> T transformFile(final SecurityContext securityContext, final String uuid, final Class<T> fileType) throws FrameworkException, IOException { AbstractFile existingFile = getFileByUuid(securityContext, uuid); if (existingFile != null) { existingFile.unlockSystemPropertiesOnce(); ...
[ "public", "static", "<", "T", "extends", "File", ">", "T", "transformFile", "(", "final", "SecurityContext", "securityContext", ",", "final", "String", "uuid", ",", "final", "Class", "<", "T", ">", "fileType", ")", "throws", "FrameworkException", ",", "IOExcep...
Transform an existing file into the target class. @param <T> @param securityContext @param uuid @param fileType @return transformed file @throws FrameworkException @throws IOException
[ "Transform", "an", "existing", "file", "into", "the", "target", "class", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-ui/src/main/java/org/structr/web/common/FileHelper.java#L79-L94
120,849
structr/structr
structr-ui/src/main/java/org/structr/web/common/FileHelper.java
FileHelper.createFileBase64
public static <T extends File> T createFileBase64(final SecurityContext securityContext, final String rawData, final Class<T> t) throws FrameworkException, IOException { Base64URIData uriData = new Base64URIData(rawData); return createFile(securityContext, uriData.getBinaryData(), uriData.getContentType(), t); ...
java
public static <T extends File> T createFileBase64(final SecurityContext securityContext, final String rawData, final Class<T> t) throws FrameworkException, IOException { Base64URIData uriData = new Base64URIData(rawData); return createFile(securityContext, uriData.getBinaryData(), uriData.getContentType(), t); ...
[ "public", "static", "<", "T", "extends", "File", ">", "T", "createFileBase64", "(", "final", "SecurityContext", "securityContext", ",", "final", "String", "rawData", ",", "final", "Class", "<", "T", ">", "t", ")", "throws", "FrameworkException", ",", "IOExcept...
Create a new image node from image data encoded in base64 format. If the given string is an uuid of an existing file, transform it into the target class. @param <T> @param securityContext @param rawData @param t defaults to File.class if null @return file @throws FrameworkException @throws IOException
[ "Create", "a", "new", "image", "node", "from", "image", "data", "encoded", "in", "base64", "format", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-ui/src/main/java/org/structr/web/common/FileHelper.java#L110-L116
120,850
structr/structr
structr-ui/src/main/java/org/structr/web/common/FileHelper.java
FileHelper.createFile
public static <T extends File> T createFile(final SecurityContext securityContext, final InputStream fileStream, final String contentType, final Class<T> fileType, final String name) throws FrameworkException, IOException { return createFile(securityContext, fileStream, contentType, fileType, name, null); }
java
public static <T extends File> T createFile(final SecurityContext securityContext, final InputStream fileStream, final String contentType, final Class<T> fileType, final String name) throws FrameworkException, IOException { return createFile(securityContext, fileStream, contentType, fileType, name, null); }
[ "public", "static", "<", "T", "extends", "File", ">", "T", "createFile", "(", "final", "SecurityContext", "securityContext", ",", "final", "InputStream", "fileStream", ",", "final", "String", "contentType", ",", "final", "Class", "<", "T", ">", "fileType", ","...
Create a new file node from the given input stream @param <T> @param securityContext @param fileStream @param contentType @param fileType defaults to File.class if null @param name @return file @throws FrameworkException @throws IOException
[ "Create", "a", "new", "file", "node", "from", "the", "given", "input", "stream" ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-ui/src/main/java/org/structr/web/common/FileHelper.java#L131-L136
120,851
structr/structr
structr-ui/src/main/java/org/structr/web/common/FileHelper.java
FileHelper.decodeAndSetFileData
public static void decodeAndSetFileData(final File file, final String rawData) throws FrameworkException, IOException { Base64URIData uriData = new Base64URIData(rawData); setFileData(file, uriData.getBinaryData(), uriData.getContentType(), true); }
java
public static void decodeAndSetFileData(final File file, final String rawData) throws FrameworkException, IOException { Base64URIData uriData = new Base64URIData(rawData); setFileData(file, uriData.getBinaryData(), uriData.getContentType(), true); }
[ "public", "static", "void", "decodeAndSetFileData", "(", "final", "File", "file", ",", "final", "String", "rawData", ")", "throws", "FrameworkException", ",", "IOException", "{", "Base64URIData", "uriData", "=", "new", "Base64URIData", "(", "rawData", ")", ";", ...
Decodes base64-encoded raw data into binary data and writes it to the given file. @param file @param rawData @throws FrameworkException @throws IOException
[ "Decodes", "base64", "-", "encoded", "raw", "data", "into", "binary", "data", "and", "writes", "it", "to", "the", "given", "file", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-ui/src/main/java/org/structr/web/common/FileHelper.java#L255-L259
120,852
structr/structr
structr-ui/src/main/java/org/structr/web/common/FileHelper.java
FileHelper.setFileData
public static void setFileData(final File file, final InputStream fileStream, final String contentType) throws FrameworkException, IOException { FileHelper.writeToFile(file, fileStream); setFileProperties(file, contentType); }
java
public static void setFileData(final File file, final InputStream fileStream, final String contentType) throws FrameworkException, IOException { FileHelper.writeToFile(file, fileStream); setFileProperties(file, contentType); }
[ "public", "static", "void", "setFileData", "(", "final", "File", "file", ",", "final", "InputStream", "fileStream", ",", "final", "String", "contentType", ")", "throws", "FrameworkException", ",", "IOException", "{", "FileHelper", ".", "writeToFile", "(", "file", ...
Write image data from the given InputStream to the given file node and set checksum and size. @param file @param fileStream @param contentType if null, try to auto-detect content type @throws FrameworkException @throws IOException
[ "Write", "image", "data", "from", "the", "given", "InputStream", "to", "the", "given", "file", "node", "and", "set", "checksum", "and", "size", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-ui/src/main/java/org/structr/web/common/FileHelper.java#L293-L297
120,853
structr/structr
structr-ui/src/main/java/org/structr/web/common/FileHelper.java
FileHelper.setFileProperties
public static void setFileProperties (final File file, final String contentType) throws IOException, FrameworkException { final java.io.File fileOnDisk = file.getFileOnDisk(false); final PropertyMap map = new PropertyMap(); map.put(StructrApp.key(File.class, "contentType"), contentType != null ? content...
java
public static void setFileProperties (final File file, final String contentType) throws IOException, FrameworkException { final java.io.File fileOnDisk = file.getFileOnDisk(false); final PropertyMap map = new PropertyMap(); map.put(StructrApp.key(File.class, "contentType"), contentType != null ? content...
[ "public", "static", "void", "setFileProperties", "(", "final", "File", "file", ",", "final", "String", "contentType", ")", "throws", "IOException", ",", "FrameworkException", "{", "final", "java", ".", "io", ".", "File", "fileOnDisk", "=", "file", ".", "getFil...
Set the contentType, checksum, size and version properties of the given fileNode @param file @param contentType if null, try to auto-detect content type @throws FrameworkException @throws IOException
[ "Set", "the", "contentType", "checksum", "size", "and", "version", "properties", "of", "the", "given", "fileNode" ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-ui/src/main/java/org/structr/web/common/FileHelper.java#L307-L319
120,854
structr/structr
structr-ui/src/main/java/org/structr/web/common/FileHelper.java
FileHelper.setFileProperties
public static void setFileProperties (File fileNode) throws FrameworkException { final PropertyMap properties = new PropertyMap(); String id = fileNode.getProperty(GraphObject.id); if (id == null) { final String newUuid = UUID.randomUUID().toString().replaceAll("[\\-]+", ""); id = newUuid; fileNode.u...
java
public static void setFileProperties (File fileNode) throws FrameworkException { final PropertyMap properties = new PropertyMap(); String id = fileNode.getProperty(GraphObject.id); if (id == null) { final String newUuid = UUID.randomUUID().toString().replaceAll("[\\-]+", ""); id = newUuid; fileNode.u...
[ "public", "static", "void", "setFileProperties", "(", "File", "fileNode", ")", "throws", "FrameworkException", "{", "final", "PropertyMap", "properties", "=", "new", "PropertyMap", "(", ")", ";", "String", "id", "=", "fileNode", ".", "getProperty", "(", "GraphOb...
Set the uuid and the path of a newly created fileNode @param fileNode @throws FrameworkException
[ "Set", "the", "uuid", "and", "the", "path", "of", "a", "newly", "created", "fileNode" ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-ui/src/main/java/org/structr/web/common/FileHelper.java#L327-L344
120,855
structr/structr
structr-ui/src/main/java/org/structr/web/common/FileHelper.java
FileHelper.getChecksums
private static PropertyMap getChecksums(final File file, final java.io.File fileOnDisk) throws IOException { final PropertyMap propertiesWithChecksums = new PropertyMap(); Folder parentFolder = file.getParent(); String checksums = null; while (parentFolder != null && checksums == null) { checksums = p...
java
private static PropertyMap getChecksums(final File file, final java.io.File fileOnDisk) throws IOException { final PropertyMap propertiesWithChecksums = new PropertyMap(); Folder parentFolder = file.getParent(); String checksums = null; while (parentFolder != null && checksums == null) { checksums = p...
[ "private", "static", "PropertyMap", "getChecksums", "(", "final", "File", "file", ",", "final", "java", ".", "io", ".", "File", "fileOnDisk", ")", "throws", "IOException", "{", "final", "PropertyMap", "propertiesWithChecksums", "=", "new", "PropertyMap", "(", ")...
Calculate checksums that are configured in settings of parent folder. @param file @param fileOnDisk @return @throws IOException
[ "Calculate", "checksums", "that", "are", "configured", "in", "settings", "of", "parent", "folder", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-ui/src/main/java/org/structr/web/common/FileHelper.java#L354-L391
120,856
structr/structr
structr-ui/src/main/java/org/structr/web/common/FileHelper.java
FileHelper.updateMetadata
public static void updateMetadata(final File file, final PropertyMap map) throws FrameworkException { updateMetadata(file, map, false); }
java
public static void updateMetadata(final File file, final PropertyMap map) throws FrameworkException { updateMetadata(file, map, false); }
[ "public", "static", "void", "updateMetadata", "(", "final", "File", "file", ",", "final", "PropertyMap", "map", ")", "throws", "FrameworkException", "{", "updateMetadata", "(", "file", ",", "map", ",", "false", ")", ";", "}" ]
Update checksums, content type, size and additional properties of the given file @param file the file @param map additional properties @throws FrameworkException
[ "Update", "checksums", "content", "type", "size", "and", "additional", "properties", "of", "the", "given", "file" ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-ui/src/main/java/org/structr/web/common/FileHelper.java#L399-L401
120,857
structr/structr
structr-ui/src/main/java/org/structr/web/common/FileHelper.java
FileHelper.writeToFile
public static void writeToFile(final File fileNode, final InputStream data) throws FrameworkException, IOException { setFileProperties(fileNode); try (final FileOutputStream out = new FileOutputStream(fileNode.getFileOnDisk())) { IOUtils.copy(data, out); } }
java
public static void writeToFile(final File fileNode, final InputStream data) throws FrameworkException, IOException { setFileProperties(fileNode); try (final FileOutputStream out = new FileOutputStream(fileNode.getFileOnDisk())) { IOUtils.copy(data, out); } }
[ "public", "static", "void", "writeToFile", "(", "final", "File", "fileNode", ",", "final", "InputStream", "data", ")", "throws", "FrameworkException", ",", "IOException", "{", "setFileProperties", "(", "fileNode", ")", ";", "try", "(", "final", "FileOutputStream",...
Write binary data from FileInputStream to a file and reference the file on disk at the given file node @param fileNode @param data The input stream from which to read the file data (Stream is not closed automatically - has to be handled by caller) @throws FrameworkException @throws IOException
[ "Write", "binary", "data", "from", "FileInputStream", "to", "a", "file", "and", "reference", "the", "file", "on", "disk", "at", "the", "given", "file", "node" ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-ui/src/main/java/org/structr/web/common/FileHelper.java#L565-L573
120,858
structr/structr
structr-ui/src/main/java/org/structr/web/common/FileHelper.java
FileHelper.getFileByAbsolutePath
public static AbstractFile getFileByAbsolutePath(final SecurityContext securityContext, final String absolutePath) { try { return StructrApp.getInstance(securityContext).nodeQuery(AbstractFile.class).and(StructrApp.key(AbstractFile.class, "path"), absolutePath).getFirst(); } catch (FrameworkException ex) { ...
java
public static AbstractFile getFileByAbsolutePath(final SecurityContext securityContext, final String absolutePath) { try { return StructrApp.getInstance(securityContext).nodeQuery(AbstractFile.class).and(StructrApp.key(AbstractFile.class, "path"), absolutePath).getFirst(); } catch (FrameworkException ex) { ...
[ "public", "static", "AbstractFile", "getFileByAbsolutePath", "(", "final", "SecurityContext", "securityContext", ",", "final", "String", "absolutePath", ")", "{", "try", "{", "return", "StructrApp", ".", "getInstance", "(", "securityContext", ")", ".", "nodeQuery", ...
Find a file by its absolute ancestor path. File may not be hidden or deleted. @param securityContext @param absolutePath @return file
[ "Find", "a", "file", "by", "its", "absolute", "ancestor", "path", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-ui/src/main/java/org/structr/web/common/FileHelper.java#L635-L647
120,859
structr/structr
structr-ui/src/main/java/org/structr/web/common/FileHelper.java
FileHelper.createFolderPath
public static Folder createFolderPath(final SecurityContext securityContext, final String path) throws FrameworkException { final App app = StructrApp.getInstance(securityContext); if (path == null) { return null; } Folder folder = (Folder) FileHelper.getFileByAbsolutePath(securityContext, path); if (...
java
public static Folder createFolderPath(final SecurityContext securityContext, final String path) throws FrameworkException { final App app = StructrApp.getInstance(securityContext); if (path == null) { return null; } Folder folder = (Folder) FileHelper.getFileByAbsolutePath(securityContext, path); if (...
[ "public", "static", "Folder", "createFolderPath", "(", "final", "SecurityContext", "securityContext", ",", "final", "String", "path", ")", "throws", "FrameworkException", "{", "final", "App", "app", "=", "StructrApp", ".", "getInstance", "(", "securityContext", ")",...
Create one folder per path item and return the last folder. F.e.: /a/b/c => Folder["name":"a"] --HAS_CHILD--> Folder["name":"b"] --HAS_CHILD--> Folder["name":"c"], returns Folder["name":"c"] @param securityContext @param path @return folder @throws FrameworkException
[ "Create", "one", "folder", "per", "path", "item", "and", "return", "the", "last", "folder", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-ui/src/main/java/org/structr/web/common/FileHelper.java#L720-L765
120,860
structr/structr
structr-core/src/main/java/javatools/parsers/PlingStemmer.java
PlingStemmer.noLatin
public static boolean noLatin(String s) { return(s.indexOf('h')>0 || s.indexOf('j')>0 || s.indexOf('k')>0 || s.indexOf('w')>0 || s.indexOf('y')>0 || s.indexOf('z')>0 || s.indexOf("ou")>0 || s.indexOf("sh")>0 || s.indexOf("ch")>0 || s.endsWith("aus")); }
java
public static boolean noLatin(String s) { return(s.indexOf('h')>0 || s.indexOf('j')>0 || s.indexOf('k')>0 || s.indexOf('w')>0 || s.indexOf('y')>0 || s.indexOf('z')>0 || s.indexOf("ou")>0 || s.indexOf("sh")>0 || s.indexOf("ch")>0 || s.endsWith("aus")); }
[ "public", "static", "boolean", "noLatin", "(", "String", "s", ")", "{", "return", "(", "s", ".", "indexOf", "(", "'", "'", ")", ">", "0", "||", "s", ".", "indexOf", "(", "'", "'", ")", ">", "0", "||", "s", ".", "indexOf", "(", "'", "'", ")", ...
Returns true if a word is probably not Latin
[ "Returns", "true", "if", "a", "word", "is", "probably", "not", "Latin" ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/javatools/parsers/PlingStemmer.java#L97-L102
120,861
structr/structr
structr-core/src/main/java/org/structr/core/graph/GraphObjectModificationState.java
GraphObjectModificationState.updateChangeLog
public void updateChangeLog(final Principal user, final Verb verb, final PropertyKey key, final Object previousValue, final Object newValue) { if ((Settings.ChangelogEnabled.getValue() || Settings.UserChangelogEnabled.getValue()) && key != null) { final String name = key.jsonName(); if (!hiddenPropertiesInAu...
java
public void updateChangeLog(final Principal user, final Verb verb, final PropertyKey key, final Object previousValue, final Object newValue) { if ((Settings.ChangelogEnabled.getValue() || Settings.UserChangelogEnabled.getValue()) && key != null) { final String name = key.jsonName(); if (!hiddenPropertiesInAu...
[ "public", "void", "updateChangeLog", "(", "final", "Principal", "user", ",", "final", "Verb", "verb", ",", "final", "PropertyKey", "key", ",", "final", "Object", "previousValue", ",", "final", "Object", "newValue", ")", "{", "if", "(", "(", "Settings", ".", ...
Update changelog for Verb.change
[ "Update", "changelog", "for", "Verb", ".", "change" ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/core/graph/GraphObjectModificationState.java#L484-L520
120,862
structr/structr
structr-core/src/main/java/org/structr/core/graph/GraphObjectModificationState.java
GraphObjectModificationState.updateChangeLog
public void updateChangeLog(final Principal user, final Verb verb, final String object) { if ((Settings.ChangelogEnabled.getValue() || Settings.UserChangelogEnabled.getValue())) { final JsonObject obj = new JsonObject(); obj.add("time", toElement(System.currentTimeMillis())); if (user != null) { obj....
java
public void updateChangeLog(final Principal user, final Verb verb, final String object) { if ((Settings.ChangelogEnabled.getValue() || Settings.UserChangelogEnabled.getValue())) { final JsonObject obj = new JsonObject(); obj.add("time", toElement(System.currentTimeMillis())); if (user != null) { obj....
[ "public", "void", "updateChangeLog", "(", "final", "Principal", "user", ",", "final", "Verb", "verb", ",", "final", "String", "object", ")", "{", "if", "(", "(", "Settings", ".", "ChangelogEnabled", ".", "getValue", "(", ")", "||", "Settings", ".", "UserCh...
Update changelog for Verb.create and Verb.delete
[ "Update", "changelog", "for", "Verb", ".", "create", "and", "Verb", ".", "delete" ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/core/graph/GraphObjectModificationState.java#L576-L617
120,863
structr/structr
structr-core/src/main/java/org/structr/core/converter/PropertyConverter.java
PropertyConverter.convertForSorting
public Comparable convertForSorting(S source) throws FrameworkException { if(source != null) { if (source instanceof Comparable) { return (Comparable)source; } // fallback return source.toString(); } return null; }
java
public Comparable convertForSorting(S source) throws FrameworkException { if(source != null) { if (source instanceof Comparable) { return (Comparable)source; } // fallback return source.toString(); } return null; }
[ "public", "Comparable", "convertForSorting", "(", "S", "source", ")", "throws", "FrameworkException", "{", "if", "(", "source", "!=", "null", ")", "{", "if", "(", "source", "instanceof", "Comparable", ")", "{", "return", "(", "Comparable", ")", "source", ";"...
Convert from source type to Comparable to allow a more fine-grained control over the sorted results. Override this method to modify sorting behaviour of entities. @param source @return converted source @throws org.structr.common.error.FrameworkException
[ "Convert", "from", "source", "type", "to", "Comparable", "to", "allow", "a", "more", "fine", "-", "grained", "control", "over", "the", "sorted", "results", ".", "Override", "this", "method", "to", "modify", "sorting", "behaviour", "of", "entities", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/core/converter/PropertyConverter.java#L77-L91
120,864
structr/structr
structr-core/src/main/java/org/structr/schema/compiler/ClassFileManager.java
ClassFileManager.getClassLoader
@Override public ClassLoader getClassLoader(final Location location) { return new SecureClassLoader() { @Override protected Class<?> findClass(String name) throws ClassNotFoundException { final JavaClassObject obj = objects.get(name); if (obj != null) { byte[] b = obj.getBytes();...
java
@Override public ClassLoader getClassLoader(final Location location) { return new SecureClassLoader() { @Override protected Class<?> findClass(String name) throws ClassNotFoundException { final JavaClassObject obj = objects.get(name); if (obj != null) { byte[] b = obj.getBytes();...
[ "@", "Override", "public", "ClassLoader", "getClassLoader", "(", "final", "Location", "location", ")", "{", "return", "new", "SecureClassLoader", "(", ")", "{", "@", "Override", "protected", "Class", "<", "?", ">", "findClass", "(", "String", "name", ")", "t...
Will be used by us to get the class loader for our compiled class. It creates an anonymous class extending the SecureClassLoader which uses the byte code created by the compiler and stored in the JavaClassObject, and returns the Class for it @param location @return class loader
[ "Will", "be", "used", "by", "us", "to", "get", "the", "class", "loader", "for", "our", "compiled", "class", ".", "It", "creates", "an", "anonymous", "class", "extending", "the", "SecureClassLoader", "which", "uses", "the", "byte", "code", "created", "by", ...
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/schema/compiler/ClassFileManager.java#L61-L79
120,865
structr/structr
structr-core/src/main/java/org/structr/schema/compiler/ClassFileManager.java
ClassFileManager.getJavaFileForOutput
@Override public JavaFileObject getJavaFileForOutput(final Location location, final String className, final Kind kind, final FileObject sibling) throws IOException { JavaClassObject obj = new JavaClassObject(className, kind); objects.put(className, obj); return obj; }
java
@Override public JavaFileObject getJavaFileForOutput(final Location location, final String className, final Kind kind, final FileObject sibling) throws IOException { JavaClassObject obj = new JavaClassObject(className, kind); objects.put(className, obj); return obj; }
[ "@", "Override", "public", "JavaFileObject", "getJavaFileForOutput", "(", "final", "Location", "location", ",", "final", "String", "className", ",", "final", "Kind", "kind", ",", "final", "FileObject", "sibling", ")", "throws", "IOException", "{", "JavaClassObject",...
Gives the compiler an instance of the JavaClassObject so that the compiler can write the byte code into it. @param location @param className @param kind @param sibling @return file object @throws java.io.IOException
[ "Gives", "the", "compiler", "an", "instance", "of", "the", "JavaClassObject", "so", "that", "the", "compiler", "can", "write", "the", "byte", "code", "into", "it", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/schema/compiler/ClassFileManager.java#L91-L99
120,866
structr/structr
structr-core/src/main/java/org/structr/core/scheduler/JobQueueManager.java
JobQueueManager.startJob
public boolean startJob(final Long jobId) { final ScheduledJob job = removeFromQueueInternal(jobId); if (job != null) { activeJobs.put(jobId, job); job.startJob(); return true; } else { return false; } }
java
public boolean startJob(final Long jobId) { final ScheduledJob job = removeFromQueueInternal(jobId); if (job != null) { activeJobs.put(jobId, job); job.startJob(); return true; } else { return false; } }
[ "public", "boolean", "startJob", "(", "final", "Long", "jobId", ")", "{", "final", "ScheduledJob", "job", "=", "removeFromQueueInternal", "(", "jobId", ")", ";", "if", "(", "job", "!=", "null", ")", "{", "activeJobs", ".", "put", "(", "jobId", ",", "job"...
Starts an import job if it exists. Returns true if it is started. @param jobId Job to start @return boolean "job started"
[ "Starts", "an", "import", "job", "if", "it", "exists", ".", "Returns", "true", "if", "it", "is", "started", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/core/scheduler/JobQueueManager.java#L80-L91
120,867
structr/structr
structr-core/src/main/java/org/structr/module/JarConfigurationProvider.java
JarConfigurationProvider.getRelationClassCandidatesForRelType
private List<Class<? extends RelationshipInterface>> getRelationClassCandidatesForRelType(final String relType) { List<Class<? extends RelationshipInterface>> candidates = new ArrayList(); for (final Class<? extends RelationshipInterface> candidate : getRelationshipEntities().values()) { Relation rel = instan...
java
private List<Class<? extends RelationshipInterface>> getRelationClassCandidatesForRelType(final String relType) { List<Class<? extends RelationshipInterface>> candidates = new ArrayList(); for (final Class<? extends RelationshipInterface> candidate : getRelationshipEntities().values()) { Relation rel = instan...
[ "private", "List", "<", "Class", "<", "?", "extends", "RelationshipInterface", ">", ">", "getRelationClassCandidatesForRelType", "(", "final", "String", "relType", ")", "{", "List", "<", "Class", "<", "?", "extends", "RelationshipInterface", ">", ">", "candidates"...
Return a list of all relation entity classes filtered by relationship type. @param relType @return classes
[ "Return", "a", "list", "of", "all", "relation", "entity", "classes", "filtered", "by", "relationship", "type", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/module/JarConfigurationProvider.java#L345-L365
120,868
structr/structr
structr-core/src/main/java/org/structr/module/JarConfigurationProvider.java
JarConfigurationProvider.findNearestMatchingRelationClass
private Class findNearestMatchingRelationClass(final String sourceTypeName, final String relType, final String targetTypeName) { final Class sourceType = getNodeEntityClass(sourceTypeName); final Class targetType = getNodeEntityClass(targetTypeName); final Map<Integer, Class> candidat...
java
private Class findNearestMatchingRelationClass(final String sourceTypeName, final String relType, final String targetTypeName) { final Class sourceType = getNodeEntityClass(sourceTypeName); final Class targetType = getNodeEntityClass(targetTypeName); final Map<Integer, Class> candidat...
[ "private", "Class", "findNearestMatchingRelationClass", "(", "final", "String", "sourceTypeName", ",", "final", "String", "relType", ",", "final", "String", "targetTypeName", ")", "{", "final", "Class", "sourceType", "=", "getNodeEntityClass", "(", "sourceTypeName", "...
Find the most specialized relation class matching the given parameters. If no direct match is found (source and target type are equal), we count the levels of inheritance, including interfaces. @param sourceTypeName @param relType @param targetTypeName @param rel @param candidate @return class
[ "Find", "the", "most", "specialized", "relation", "class", "matching", "the", "given", "parameters", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/module/JarConfigurationProvider.java#L381-L410
120,869
structr/structr
structr-core/src/main/java/org/structr/module/JarConfigurationProvider.java
JarConfigurationProvider.registerEntityCreationTransformation
@Override public void registerEntityCreationTransformation(Class type, Transformation<GraphObject> transformation) { final Set<Transformation<GraphObject>> transformations = getEntityCreationTransformationsForType(type); if (!transformations.contains(transformation)) { transformations.add(transformation); }...
java
@Override public void registerEntityCreationTransformation(Class type, Transformation<GraphObject> transformation) { final Set<Transformation<GraphObject>> transformations = getEntityCreationTransformationsForType(type); if (!transformations.contains(transformation)) { transformations.add(transformation); }...
[ "@", "Override", "public", "void", "registerEntityCreationTransformation", "(", "Class", "type", ",", "Transformation", "<", "GraphObject", ">", "transformation", ")", "{", "final", "Set", "<", "Transformation", "<", "GraphObject", ">", ">", "transformations", "=", ...
Register a transformation that will be applied to every newly created entity of a given type. @param type the type of the entities for which the transformation should be applied @param transformation the transformation to apply on every entity
[ "Register", "a", "transformation", "that", "will", "be", "applied", "to", "every", "newly", "created", "entity", "of", "a", "given", "type", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/module/JarConfigurationProvider.java#L649-L657
120,870
structr/structr
structr-core/src/main/java/org/structr/module/JarConfigurationProvider.java
JarConfigurationProvider.registerPropertyGroup
@Override public void registerPropertyGroup(Class type, PropertyKey key, PropertyGroup propertyGroup) { getPropertyGroupMapForType(type).put(key.dbName(), propertyGroup); }
java
@Override public void registerPropertyGroup(Class type, PropertyKey key, PropertyGroup propertyGroup) { getPropertyGroupMapForType(type).put(key.dbName(), propertyGroup); }
[ "@", "Override", "public", "void", "registerPropertyGroup", "(", "Class", "type", ",", "PropertyKey", "key", ",", "PropertyGroup", "propertyGroup", ")", "{", "getPropertyGroupMapForType", "(", "type", ")", ".", "put", "(", "key", ".", "dbName", "(", ")", ",", ...
Registers a property group for the given key of the given entity type. A property group can be used to combine a set of properties into an object. @param type the type of the entities for which the property group should be registered @param key the property key under which the property group should be visible @param p...
[ "Registers", "a", "property", "group", "for", "the", "given", "key", "of", "the", "given", "entity", "type", ".", "A", "property", "group", "can", "be", "used", "to", "combine", "a", "set", "of", "properties", "into", "an", "object", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/module/JarConfigurationProvider.java#L715-L718
120,871
structr/structr
structr-core/src/main/java/org/structr/module/JarConfigurationProvider.java
JarConfigurationProvider.getResourcesToScan
private Set<String> getResourcesToScan() { final String classPath = System.getProperty("java.class.path"); final Set<String> modules = new TreeSet<>(); final Pattern pattern = Pattern.compile(".*(structr).*(war|jar)"); final Matcher matcher = pattern.matcher(""); for (final String jarPath : class...
java
private Set<String> getResourcesToScan() { final String classPath = System.getProperty("java.class.path"); final Set<String> modules = new TreeSet<>(); final Pattern pattern = Pattern.compile(".*(structr).*(war|jar)"); final Matcher matcher = pattern.matcher(""); for (final String jarPath : class...
[ "private", "Set", "<", "String", ">", "getResourcesToScan", "(", ")", "{", "final", "String", "classPath", "=", "System", ".", "getProperty", "(", "\"java.class.path\"", ")", ";", "final", "Set", "<", "String", ">", "modules", "=", "new", "TreeSet", "<>", ...
Scans the class path and returns a Set containing all structr modules. @return a Set of active module names
[ "Scans", "the", "class", "path", "and", "returns", "a", "Set", "containing", "all", "structr", "modules", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/module/JarConfigurationProvider.java#L1351-L1393
120,872
structr/structr
structr-ui/src/main/java/org/structr/web/servlet/DeploymentServlet.java
DeploymentServlet.unzip
private void unzip(final File file, final String outputDir) throws IOException { try (final ZipFile zipFile = new ZipFile(file)) { final Enumeration<? extends ZipEntry> entries = zipFile.entries(); while (entries.hasMoreElements()) { final ZipEntry entry = entries.nextElement(); final File targetFil...
java
private void unzip(final File file, final String outputDir) throws IOException { try (final ZipFile zipFile = new ZipFile(file)) { final Enumeration<? extends ZipEntry> entries = zipFile.entries(); while (entries.hasMoreElements()) { final ZipEntry entry = entries.nextElement(); final File targetFil...
[ "private", "void", "unzip", "(", "final", "File", "file", ",", "final", "String", "outputDir", ")", "throws", "IOException", "{", "try", "(", "final", "ZipFile", "zipFile", "=", "new", "ZipFile", "(", "file", ")", ")", "{", "final", "Enumeration", "<", "...
Unzip given file to given output directory. @param file @param outputDir @throws IOException
[ "Unzip", "given", "file", "to", "given", "output", "directory", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-ui/src/main/java/org/structr/web/servlet/DeploymentServlet.java#L273-L301
120,873
structr/structr
structr-rest/src/main/java/org/structr/rest/servlet/ResourceHelper.java
ResourceHelper.parsePath
public static List<Resource> parsePath(final SecurityContext securityContext, final HttpServletRequest request, final Map<Pattern, Class<? extends Resource>> resourceMap, final Value<String> propertyView) throws FrameworkException { final String path = request.getPathInfo(); // intercept empty path and send 204 N...
java
public static List<Resource> parsePath(final SecurityContext securityContext, final HttpServletRequest request, final Map<Pattern, Class<? extends Resource>> resourceMap, final Value<String> propertyView) throws FrameworkException { final String path = request.getPathInfo(); // intercept empty path and send 204 N...
[ "public", "static", "List", "<", "Resource", ">", "parsePath", "(", "final", "SecurityContext", "securityContext", ",", "final", "HttpServletRequest", "request", ",", "final", "Map", "<", "Pattern", ",", "Class", "<", "?", "extends", "Resource", ">", ">", "res...
Parse the request path and match with possible resource patterns @param securityContext @param request @param resourceMap @param propertyView @return resourceChain @throws FrameworkException
[ "Parse", "the", "request", "path", "and", "match", "with", "possible", "resource", "patterns" ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-rest/src/main/java/org/structr/rest/servlet/ResourceHelper.java#L60-L160
120,874
structr/structr
structr-rest/src/main/java/org/structr/rest/servlet/ResourceHelper.java
ResourceHelper.optimizeNestedResourceChain
public static Resource optimizeNestedResourceChain(final SecurityContext securityContext, final HttpServletRequest request, final Map<Pattern, Class<? extends Resource>> resourceMap, final Value<String> propertyView) throws FrameworkException { final List<Resource> resourceChain = ResourceHelper.parsePath(securityCo...
java
public static Resource optimizeNestedResourceChain(final SecurityContext securityContext, final HttpServletRequest request, final Map<Pattern, Class<? extends Resource>> resourceMap, final Value<String> propertyView) throws FrameworkException { final List<Resource> resourceChain = ResourceHelper.parsePath(securityCo...
[ "public", "static", "Resource", "optimizeNestedResourceChain", "(", "final", "SecurityContext", "securityContext", ",", "final", "HttpServletRequest", "request", ",", "final", "Map", "<", "Pattern", ",", "Class", "<", "?", "extends", "Resource", ">", ">", "resourceM...
Optimize the resource chain by trying to combine two resources to a new one @param securityContext @param request @param resourceMap @param propertyView @return finalResource @throws FrameworkException
[ "Optimize", "the", "resource", "chain", "by", "trying", "to", "combine", "two", "resources", "to", "a", "new", "one" ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-rest/src/main/java/org/structr/rest/servlet/ResourceHelper.java#L172-L255
120,875
structr/structr
structr-core/src/main/java/org/structr/schema/action/Function.java
Function.logException
protected void logException (final Object caller, final Throwable t, final Object[] parameters) { logException(t, "{}: Exception in '{}' for parameters: {}", new Object[] { getReplacement(), caller, getParametersAsString(parameters) }); }
java
protected void logException (final Object caller, final Throwable t, final Object[] parameters) { logException(t, "{}: Exception in '{}' for parameters: {}", new Object[] { getReplacement(), caller, getParametersAsString(parameters) }); }
[ "protected", "void", "logException", "(", "final", "Object", "caller", ",", "final", "Throwable", "t", ",", "final", "Object", "[", "]", "parameters", ")", "{", "logException", "(", "t", ",", "\"{}: Exception in '{}' for parameters: {}\"", ",", "new", "Object", ...
Logging of an Exception in a function with a simple message outputting the name and call parameters of the function @param caller The element that caused the error @param t The thrown Exception @param parameters The method parameters
[ "Logging", "of", "an", "Exception", "in", "a", "function", "with", "a", "simple", "message", "outputting", "the", "name", "and", "call", "parameters", "of", "the", "function" ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/schema/action/Function.java#L98-L100
120,876
structr/structr
structr-core/src/main/java/org/structr/schema/action/Function.java
Function.logException
protected void logException (final Throwable t, final String msg, final Object[] messageParams) { logger.error(msg, messageParams, t); }
java
protected void logException (final Throwable t, final String msg, final Object[] messageParams) { logger.error(msg, messageParams, t); }
[ "protected", "void", "logException", "(", "final", "Throwable", "t", ",", "final", "String", "msg", ",", "final", "Object", "[", "]", "messageParams", ")", "{", "logger", ".", "error", "(", "msg", ",", "messageParams", ",", "t", ")", ";", "}" ]
Logging of an Exception in a function with custom message and message parameters. @param t The thrown Exception @param msg The message to be printed @param messageParams The parameters for the message
[ "Logging", "of", "an", "Exception", "in", "a", "function", "with", "custom", "message", "and", "message", "parameters", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/schema/action/Function.java#L109-L111
120,877
structr/structr
structr-core/src/main/java/org/structr/schema/action/Function.java
Function.assertArrayHasLengthAndAllElementsNotNull
protected void assertArrayHasLengthAndAllElementsNotNull(final Object[] array, final Integer length) throws ArgumentCountException, ArgumentNullException { if (array.length != length) { throw ArgumentCountException.notEqual(array.length, length); } for (final Object element : array) { if (element == null...
java
protected void assertArrayHasLengthAndAllElementsNotNull(final Object[] array, final Integer length) throws ArgumentCountException, ArgumentNullException { if (array.length != length) { throw ArgumentCountException.notEqual(array.length, length); } for (final Object element : array) { if (element == null...
[ "protected", "void", "assertArrayHasLengthAndAllElementsNotNull", "(", "final", "Object", "[", "]", "array", ",", "final", "Integer", "length", ")", "throws", "ArgumentCountException", ",", "ArgumentNullException", "{", "if", "(", "array", ".", "length", "!=", "leng...
Test if the given object array has exact the given length and all its elements are not null. @param array @param length @throws ArgumentCountException in case of wrong number of parameters @throws ArgumentNullException in case of a null parameter
[ "Test", "if", "the", "given", "object", "array", "has", "exact", "the", "given", "length", "and", "all", "its", "elements", "are", "not", "null", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/schema/action/Function.java#L169-L181
120,878
structr/structr
structr-core/src/main/java/org/structr/common/geo/GeoHelper.java
GeoHelper.createLocation
public static Location createLocation(final GeoCodingResult coords) throws FrameworkException { final PropertyMap props = new PropertyMap(); double latitude = coords.getLatitude(); double longitude = coords.getLongitude(); String type = Location.class.getSimpleName(); props.put(Ab...
java
public static Location createLocation(final GeoCodingResult coords) throws FrameworkException { final PropertyMap props = new PropertyMap(); double latitude = coords.getLatitude(); double longitude = coords.getLongitude(); String type = Location.class.getSimpleName(); props.put(Ab...
[ "public", "static", "Location", "createLocation", "(", "final", "GeoCodingResult", "coords", ")", "throws", "FrameworkException", "{", "final", "PropertyMap", "props", "=", "new", "PropertyMap", "(", ")", ";", "double", "latitude", "=", "coords", ".", "getLatitude...
Creates a Location entity for the given geocoding result and returns it. @param coords @return a Location entity for the given geocoding result @throws FrameworkException
[ "Creates", "a", "Location", "entity", "for", "the", "given", "geocoding", "result", "and", "returns", "it", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/common/geo/GeoHelper.java#L59-L71
120,879
structr/structr
structr-core/src/main/java/org/structr/common/geo/GeoHelper.java
GeoHelper.geocode
public static GeoCodingResult geocode(final String street, final String house, String postalCode, final String city, final String state, final String country) throws FrameworkException { final String language = Settings.GeocodingLanguage.getValue(); final String cacheKey = cacheKey(street, house, postalCode, cit...
java
public static GeoCodingResult geocode(final String street, final String house, String postalCode, final String city, final String state, final String country) throws FrameworkException { final String language = Settings.GeocodingLanguage.getValue(); final String cacheKey = cacheKey(street, house, postalCode, cit...
[ "public", "static", "GeoCodingResult", "geocode", "(", "final", "String", "street", ",", "final", "String", "house", ",", "String", "postalCode", ",", "final", "String", "city", ",", "final", "String", "state", ",", "final", "String", "country", ")", "throws",...
Tries do find a geo location for the given address using the GeoCodingProvider specified in the configuration file. @param country the country to search for, may be null @param state the state to search for, may be null @param city the city to search for, may be null @param street the street to search for, may be null...
[ "Tries", "do", "find", "a", "geo", "location", "for", "the", "given", "address", "using", "the", "GeoCodingProvider", "specified", "in", "the", "configuration", "file", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/common/geo/GeoHelper.java#L99-L129
120,880
structr/structr
structr-rest/src/main/java/org/structr/rest/auth/AuthHelper.java
AuthHelper.isConfirmationKeyValid
public static boolean isConfirmationKeyValid(final String confirmationKey, final Integer validityPeriod) { final String[] parts = confirmationKey.split("!"); if (parts.length == 2) { final long confirmationKeyCreated = Long.parseLong(parts[1]); final long maxValidity = confirmationKeyCreated + v...
java
public static boolean isConfirmationKeyValid(final String confirmationKey, final Integer validityPeriod) { final String[] parts = confirmationKey.split("!"); if (parts.length == 2) { final long confirmationKeyCreated = Long.parseLong(parts[1]); final long maxValidity = confirmationKeyCreated + v...
[ "public", "static", "boolean", "isConfirmationKeyValid", "(", "final", "String", "confirmationKey", ",", "final", "Integer", "validityPeriod", ")", "{", "final", "String", "[", "]", "parts", "=", "confirmationKey", ".", "split", "(", "\"!\"", ")", ";", "if", "...
Determines if the key is valid or not. If the key has no timestamp the configuration setting for keys without timestamp is used @param confirmationKey The confirmation key to check @param validityPeriod The validity period for the key (in minutes) @return
[ "Determines", "if", "the", "key", "is", "valid", "or", "not", ".", "If", "the", "key", "has", "no", "timestamp", "the", "configuration", "setting", "for", "keys", "without", "timestamp", "is", "used" ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-rest/src/main/java/org/structr/rest/auth/AuthHelper.java#L268-L281
120,881
structr/structr
structr-rest/src/main/java/org/structr/rest/servlet/CsvServlet.java
CsvServlet.writeCsv
public static void writeCsv(final ResultStream<GraphObject> result, final Writer out, final String propertyView) throws IOException { final StringBuilder row = new StringBuilder(); boolean headerWritten = false; for (final GraphObject obj : result) { // Write column headers if (!headerWritten...
java
public static void writeCsv(final ResultStream<GraphObject> result, final Writer out, final String propertyView) throws IOException { final StringBuilder row = new StringBuilder(); boolean headerWritten = false; for (final GraphObject obj : result) { // Write column headers if (!headerWritten...
[ "public", "static", "void", "writeCsv", "(", "final", "ResultStream", "<", "GraphObject", ">", "result", ",", "final", "Writer", "out", ",", "final", "String", "propertyView", ")", "throws", "IOException", "{", "final", "StringBuilder", "row", "=", "new", "Str...
Write list of objects to output @param result @param out @param propertyView @throws IOException
[ "Write", "list", "of", "objects", "to", "output" ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-rest/src/main/java/org/structr/rest/servlet/CsvServlet.java#L607-L661
120,882
structr/structr
structr-core/src/main/java/org/structr/common/EntityAndPropertiesContainer.java
EntityAndPropertiesContainer.init
@Override public void init(SecurityContext securityContext, Node dbNode, Class type, final long transactionId) { throw new UnsupportedOperationException("Not supported by this container."); }
java
@Override public void init(SecurityContext securityContext, Node dbNode, Class type, final long transactionId) { throw new UnsupportedOperationException("Not supported by this container."); }
[ "@", "Override", "public", "void", "init", "(", "SecurityContext", "securityContext", ",", "Node", "dbNode", ",", "Class", "type", ",", "final", "long", "transactionId", ")", "{", "throw", "new", "UnsupportedOperationException", "(", "\"Not supported by this container...
dummy implementation of NodeInterface
[ "dummy", "implementation", "of", "NodeInterface" ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/common/EntityAndPropertiesContainer.java#L86-L89
120,883
structr/structr
structr-modules/structr-advanced-mail-module/src/main/java/org/structr/mail/service/MailService.java
MailService.extractFileAttachment
private File extractFileAttachment(final Mailbox mb, final Part p) { File file = null; try { final Class fileClass = p.getContentType().toLowerCase().startsWith("image/") ? Image.class : File.class; final App app = StructrApp.getInstance(); try (final Tx tx = app.tx()) { org.structr.web.entity.Fo...
java
private File extractFileAttachment(final Mailbox mb, final Part p) { File file = null; try { final Class fileClass = p.getContentType().toLowerCase().startsWith("image/") ? Image.class : File.class; final App app = StructrApp.getInstance(); try (final Tx tx = app.tx()) { org.structr.web.entity.Fo...
[ "private", "File", "extractFileAttachment", "(", "final", "Mailbox", "mb", ",", "final", "Part", "p", ")", "{", "File", "file", "=", "null", ";", "try", "{", "final", "Class", "fileClass", "=", "p", ".", "getContentType", "(", ")", ".", "toLowerCase", "(...
Returns attachment UUID to append to the mail to be created
[ "Returns", "attachment", "UUID", "to", "append", "to", "the", "mail", "to", "be", "created" ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-modules/structr-advanced-mail-module/src/main/java/org/structr/mail/service/MailService.java#L322-L366
120,884
structr/structr
structr-core/src/main/java/org/structr/core/graph/Tx.java
Tx.setSecurityContext
public void setSecurityContext(final SecurityContext sc) { if (securityContext == null) { if (sc.isSuperUserSecurityContext() == Boolean.FALSE) { securityContext = sc; } } }
java
public void setSecurityContext(final SecurityContext sc) { if (securityContext == null) { if (sc.isSuperUserSecurityContext() == Boolean.FALSE) { securityContext = sc; } } }
[ "public", "void", "setSecurityContext", "(", "final", "SecurityContext", "sc", ")", "{", "if", "(", "securityContext", "==", "null", ")", "{", "if", "(", "sc", ".", "isSuperUserSecurityContext", "(", ")", "==", "Boolean", ".", "FALSE", ")", "{", "securityCon...
Allow setting the securityContext if it was null. Important for Login transactions. @param sc
[ "Allow", "setting", "the", "securityContext", "if", "it", "was", "null", ".", "Important", "for", "Login", "transactions", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/core/graph/Tx.java#L119-L128
120,885
structr/structr
structr-rest/src/main/java/org/structr/rest/resource/LogResource.java
LogResource.findInterval
private long findInterval(final String dateFormat) { final long max = TimeUnit.DAYS.toMillis(365); final long step = TimeUnit.SECONDS.toMillis(60); try { final SimpleDateFormat format = new SimpleDateFormat(dateFormat); final long initial = format.parse(format.format(3600)).getTime(); for (long i = i...
java
private long findInterval(final String dateFormat) { final long max = TimeUnit.DAYS.toMillis(365); final long step = TimeUnit.SECONDS.toMillis(60); try { final SimpleDateFormat format = new SimpleDateFormat(dateFormat); final long initial = format.parse(format.format(3600)).getTime(); for (long i = i...
[ "private", "long", "findInterval", "(", "final", "String", "dateFormat", ")", "{", "final", "long", "max", "=", "TimeUnit", ".", "DAYS", ".", "toMillis", "(", "365", ")", ";", "final", "long", "step", "=", "TimeUnit", ".", "SECONDS", ".", "toMillis", "("...
This method takes a date format and finds the time interval that it represents.
[ "This", "method", "takes", "a", "date", "format", "and", "finds", "the", "time", "interval", "that", "it", "represents", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-rest/src/main/java/org/structr/rest/resource/LogResource.java#L654-L680
120,886
structr/structr
structr-core/src/main/java/org/structr/common/SecurityContext.java
SecurityContext.getEffectiveLocale
public Locale getEffectiveLocale() { // Priority 5: Default locale Locale locale = Locale.getDefault(); boolean userHasLocaleString = false; if (cachedUser != null) { // Priority 2: User locale final String userLocaleString = cachedUser.getLocale(); if (userLocaleString != null) { userHasLocale...
java
public Locale getEffectiveLocale() { // Priority 5: Default locale Locale locale = Locale.getDefault(); boolean userHasLocaleString = false; if (cachedUser != null) { // Priority 2: User locale final String userLocaleString = cachedUser.getLocale(); if (userLocaleString != null) { userHasLocale...
[ "public", "Locale", "getEffectiveLocale", "(", ")", "{", "// Priority 5: Default locale", "Locale", "locale", "=", "Locale", ".", "getDefault", "(", ")", ";", "boolean", "userHasLocaleString", "=", "false", ";", "if", "(", "cachedUser", "!=", "null", ")", "{", ...
Determine the effective locale for this request. Priority 1: URL parameter "locale" Priority 2: User locale Priority 3: Cookie locale Priority 4: Browser locale Priority 5: Default locale @return locale
[ "Determine", "the", "effective", "locale", "for", "this", "request", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/common/SecurityContext.java#L707-L775
120,887
structr/structr
structr-db-driver-api/src/main/java/org/structr/api/service/Command.java
Command.setArgument
public final void setArgument(final String key, final Object value) { if (key != null && value != null) { this.arguments.put(key, value); } }
java
public final void setArgument(final String key, final Object value) { if (key != null && value != null) { this.arguments.put(key, value); } }
[ "public", "final", "void", "setArgument", "(", "final", "String", "key", ",", "final", "Object", "value", ")", "{", "if", "(", "key", "!=", "null", "&&", "value", "!=", "null", ")", "{", "this", ".", "arguments", ".", "put", "(", "key", ",", "value",...
Sets an argument for this command. @param key the key @param value the value
[ "Sets", "an", "argument", "for", "this", "command", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-db-driver-api/src/main/java/org/structr/api/service/Command.java#L75-L80
120,888
structr/structr
structr-core/src/main/java/org/structr/core/auth/HashHelper.java
HashHelper.getHash
public static String getHash(final String password, final String salt) { if (StringUtils.isEmpty(salt)) { return getSimpleHash(password); } return DigestUtils.sha512Hex(DigestUtils.sha512Hex(password).concat(salt)); }
java
public static String getHash(final String password, final String salt) { if (StringUtils.isEmpty(salt)) { return getSimpleHash(password); } return DigestUtils.sha512Hex(DigestUtils.sha512Hex(password).concat(salt)); }
[ "public", "static", "String", "getHash", "(", "final", "String", "password", ",", "final", "String", "salt", ")", "{", "if", "(", "StringUtils", ".", "isEmpty", "(", "salt", ")", ")", "{", "return", "getSimpleHash", "(", "password", ")", ";", "}", "retur...
Calculate a SHA-512 hash of the given password string. If salt is given, use salt. @param password @param salt @return hash
[ "Calculate", "a", "SHA", "-", "512", "hash", "of", "the", "given", "password", "string", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/core/auth/HashHelper.java#L38-L48
120,889
structr/structr
structr-ui/src/main/java/org/structr/web/servlet/HtmlServlet.java
HtmlServlet.notFound
private Page notFound(final HttpServletResponse response, final SecurityContext securityContext) throws IOException, FrameworkException { final List<Page> errorPages = StructrApp.getInstance(securityContext).nodeQuery(Page.class).and(StructrApp.key(Page.class, "showOnErrorCodes"), "404", false).getAsList(); for (...
java
private Page notFound(final HttpServletResponse response, final SecurityContext securityContext) throws IOException, FrameworkException { final List<Page> errorPages = StructrApp.getInstance(securityContext).nodeQuery(Page.class).and(StructrApp.key(Page.class, "showOnErrorCodes"), "404", false).getAsList(); for (...
[ "private", "Page", "notFound", "(", "final", "HttpServletResponse", "response", ",", "final", "SecurityContext", "securityContext", ")", "throws", "IOException", ",", "FrameworkException", "{", "final", "List", "<", "Page", ">", "errorPages", "=", "StructrApp", ".",...
Handle 404 Not Found First, search the first page which handles the 404. If none found, issue the container's 404 error. @param response @param securityContext @param renderContext @throws IOException @throws FrameworkException
[ "Handle", "404", "Not", "Found" ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-ui/src/main/java/org/structr/web/servlet/HtmlServlet.java#L937-L954
120,890
structr/structr
structr-ui/src/main/java/org/structr/web/servlet/HtmlServlet.java
HtmlServlet.findFirstNodeByName
private AbstractNode findFirstNodeByName(final SecurityContext securityContext, final HttpServletRequest request, final String path) throws FrameworkException { final String name = PathHelper.getName(path); if (!name.isEmpty()) { logger.debug("Requested name: {}", name); final Query query ...
java
private AbstractNode findFirstNodeByName(final SecurityContext securityContext, final HttpServletRequest request, final String path) throws FrameworkException { final String name = PathHelper.getName(path); if (!name.isEmpty()) { logger.debug("Requested name: {}", name); final Query query ...
[ "private", "AbstractNode", "findFirstNodeByName", "(", "final", "SecurityContext", "securityContext", ",", "final", "HttpServletRequest", "request", ",", "final", "String", "path", ")", "throws", "FrameworkException", "{", "final", "String", "name", "=", "PathHelper", ...
Find first node whose name matches the last part of the given path @param securityContext @param request @param path @return node @throws FrameworkException
[ "Find", "first", "node", "whose", "name", "matches", "the", "last", "part", "of", "the", "given", "path" ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-ui/src/main/java/org/structr/web/servlet/HtmlServlet.java#L965-L993
120,891
structr/structr
structr-ui/src/main/java/org/structr/web/servlet/HtmlServlet.java
HtmlServlet.findNodeByUuid
private AbstractNode findNodeByUuid(final SecurityContext securityContext, final String uuid) throws FrameworkException { if (!uuid.isEmpty()) { logger.debug("Requested id: {}", uuid); return (AbstractNode) StructrApp.getInstance(securityContext).getNodeById(uuid); } return null; }
java
private AbstractNode findNodeByUuid(final SecurityContext securityContext, final String uuid) throws FrameworkException { if (!uuid.isEmpty()) { logger.debug("Requested id: {}", uuid); return (AbstractNode) StructrApp.getInstance(securityContext).getNodeById(uuid); } return null; }
[ "private", "AbstractNode", "findNodeByUuid", "(", "final", "SecurityContext", "securityContext", ",", "final", "String", "uuid", ")", "throws", "FrameworkException", "{", "if", "(", "!", "uuid", ".", "isEmpty", "(", ")", ")", "{", "logger", ".", "debug", "(", ...
Find node by uuid @param securityContext @param request @param uuid @return node @throws FrameworkException
[ "Find", "node", "by", "uuid" ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-ui/src/main/java/org/structr/web/servlet/HtmlServlet.java#L1004-L1014
120,892
structr/structr
structr-ui/src/main/java/org/structr/web/servlet/HtmlServlet.java
HtmlServlet.findFile
private File findFile(final SecurityContext securityContext, final HttpServletRequest request, final String path) throws FrameworkException { List<Linkable> entryPoints = findPossibleEntryPoints(securityContext, request, path); // If no results were found, try to replace whitespace by '+' or '%20' if (entryPoin...
java
private File findFile(final SecurityContext securityContext, final HttpServletRequest request, final String path) throws FrameworkException { List<Linkable> entryPoints = findPossibleEntryPoints(securityContext, request, path); // If no results were found, try to replace whitespace by '+' or '%20' if (entryPoin...
[ "private", "File", "findFile", "(", "final", "SecurityContext", "securityContext", ",", "final", "HttpServletRequest", "request", ",", "final", "String", "path", ")", "throws", "FrameworkException", "{", "List", "<", "Linkable", ">", "entryPoints", "=", "findPossibl...
Find a file with its name matching last path part @param securityContext @param request @param path @return file @throws FrameworkException
[ "Find", "a", "file", "with", "its", "name", "matching", "last", "path", "part" ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-ui/src/main/java/org/structr/web/servlet/HtmlServlet.java#L1025-L1046
120,893
structr/structr
structr-ui/src/main/java/org/structr/web/servlet/HtmlServlet.java
HtmlServlet.findPage
private Page findPage(final SecurityContext securityContext, List<Page> pages, final String path, final EditMode edit) throws FrameworkException { if (pages == null) { pages = StructrApp.getInstance(securityContext).nodeQuery(Page.class).getAsList(); Collections.sort(pages, new GraphObjectComparator(StructrAp...
java
private Page findPage(final SecurityContext securityContext, List<Page> pages, final String path, final EditMode edit) throws FrameworkException { if (pages == null) { pages = StructrApp.getInstance(securityContext).nodeQuery(Page.class).getAsList(); Collections.sort(pages, new GraphObjectComparator(StructrAp...
[ "private", "Page", "findPage", "(", "final", "SecurityContext", "securityContext", ",", "List", "<", "Page", ">", "pages", ",", "final", "String", "path", ",", "final", "EditMode", "edit", ")", "throws", "FrameworkException", "{", "if", "(", "pages", "==", "...
Find a page with matching path. To be compatible with older versions, fallback to name-only lookup. @param securityContext @param pages @param path @param edit @return page @throws FrameworkException
[ "Find", "a", "page", "with", "matching", "path", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-ui/src/main/java/org/structr/web/servlet/HtmlServlet.java#L1060-L1098
120,894
structr/structr
structr-ui/src/main/java/org/structr/web/servlet/HtmlServlet.java
HtmlServlet.findIndexPage
private Page findIndexPage(final SecurityContext securityContext, List<Page> pages, final EditMode edit) throws FrameworkException { final PropertyKey<Integer> positionKey = StructrApp.key(Page.class, "position"); if (pages == null) { pages = StructrApp.getInstance(securityContext).nodeQuery(Page.class).getAs...
java
private Page findIndexPage(final SecurityContext securityContext, List<Page> pages, final EditMode edit) throws FrameworkException { final PropertyKey<Integer> positionKey = StructrApp.key(Page.class, "position"); if (pages == null) { pages = StructrApp.getInstance(securityContext).nodeQuery(Page.class).getAs...
[ "private", "Page", "findIndexPage", "(", "final", "SecurityContext", "securityContext", ",", "List", "<", "Page", ">", "pages", ",", "final", "EditMode", "edit", ")", "throws", "FrameworkException", "{", "final", "PropertyKey", "<", "Integer", ">", "positionKey", ...
Find the page with the lowest non-empty position value which is visible in the current security context and for the given site. @param securityContext @param pages @param edit @return page @throws FrameworkException
[ "Find", "the", "page", "with", "the", "lowest", "non", "-", "empty", "position", "value", "which", "is", "visible", "in", "the", "current", "security", "context", "and", "for", "the", "given", "site", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-ui/src/main/java/org/structr/web/servlet/HtmlServlet.java#L1110-L1129
120,895
structr/structr
structr-ui/src/main/java/org/structr/web/servlet/HtmlServlet.java
HtmlServlet.checkRegistration
private boolean checkRegistration(final Authenticator auth, final HttpServletRequest request, final HttpServletResponse response, final String path) throws FrameworkException, IOException { logger.debug("Checking registration ..."); final String key = request.getParameter(CONFIRM_KEY_KEY); if (StringUtils.isEm...
java
private boolean checkRegistration(final Authenticator auth, final HttpServletRequest request, final HttpServletResponse response, final String path) throws FrameworkException, IOException { logger.debug("Checking registration ..."); final String key = request.getParameter(CONFIRM_KEY_KEY); if (StringUtils.isEm...
[ "private", "boolean", "checkRegistration", "(", "final", "Authenticator", "auth", ",", "final", "HttpServletRequest", "request", ",", "final", "HttpServletResponse", "response", ",", "final", "String", "path", ")", "throws", "FrameworkException", ",", "IOException", "...
This method checks if the current request is a user registration confirmation, usually triggered by a user clicking on a confirmation link in an e-mail. @param request @param response @param path @return true if the registration was successful @throws FrameworkException @throws IOException
[ "This", "method", "checks", "if", "the", "current", "request", "is", "a", "user", "registration", "confirmation", "usually", "triggered", "by", "a", "user", "clicking", "on", "a", "confirmation", "link", "in", "an", "e", "-", "mail", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-ui/src/main/java/org/structr/web/servlet/HtmlServlet.java#L1143-L1215
120,896
structr/structr
structr-ui/src/main/java/org/structr/web/servlet/HtmlServlet.java
HtmlServlet.isVisibleForSite
private boolean isVisibleForSite(final HttpServletRequest request, final Page page) { final Site site = page.getSite(); if (site == null) { return true; } final String serverName = request.getServerName(); final int serverPort = request.getServerPort(); if (StringUtils.isNotBlank(serverName) && !s...
java
private boolean isVisibleForSite(final HttpServletRequest request, final Page page) { final Site site = page.getSite(); if (site == null) { return true; } final String serverName = request.getServerName(); final int serverPort = request.getServerPort(); if (StringUtils.isNotBlank(serverName) && !s...
[ "private", "boolean", "isVisibleForSite", "(", "final", "HttpServletRequest", "request", ",", "final", "Page", "page", ")", "{", "final", "Site", "site", "=", "page", ".", "getSite", "(", ")", ";", "if", "(", "site", "==", "null", ")", "{", "return", "tr...
Check if the given page is visible for the requested site defined by a hostname and a port. @param request @param page @return
[ "Check", "if", "the", "given", "page", "is", "visible", "for", "the", "requested", "site", "defined", "by", "a", "hostname", "and", "a", "port", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-ui/src/main/java/org/structr/web/servlet/HtmlServlet.java#L1617-L1640
120,897
structr/structr
structr-rest/src/main/java/org/structr/rest/auth/SessionHelper.java
SessionHelper.clearSession
public static void clearSession(final String sessionId) { if (StringUtils.isBlank(sessionId)) { return; } final App app = StructrApp.getInstance(); final PropertyKey<String[]> sessionIdKey = StructrApp.key(Principal.class, "sessionIds"); final Query<Principal> query ...
java
public static void clearSession(final String sessionId) { if (StringUtils.isBlank(sessionId)) { return; } final App app = StructrApp.getInstance(); final PropertyKey<String[]> sessionIdKey = StructrApp.key(Principal.class, "sessionIds"); final Query<Principal> query ...
[ "public", "static", "void", "clearSession", "(", "final", "String", "sessionId", ")", "{", "if", "(", "StringUtils", ".", "isBlank", "(", "sessionId", ")", ")", "{", "return", ";", "}", "final", "App", "app", "=", "StructrApp", ".", "getInstance", "(", "...
Make sure the given sessionId is not set for any user. @param sessionId
[ "Make", "sure", "the", "given", "sessionId", "is", "not", "set", "for", "any", "user", "." ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-rest/src/main/java/org/structr/rest/auth/SessionHelper.java#L116-L137
120,898
structr/structr
structr-rest/src/main/java/org/structr/rest/auth/SessionHelper.java
SessionHelper.clearInvalidSessions
public static void clearInvalidSessions(final Principal user) { logger.info("Clearing invalid sessions for user {} ({})", user.getName(), user.getUuid()); final PropertyKey<String[]> sessionIdKey = StructrApp.key(Principal.class, "sessionIds"); final String[] sessionIds = user.getProperty(session...
java
public static void clearInvalidSessions(final Principal user) { logger.info("Clearing invalid sessions for user {} ({})", user.getName(), user.getUuid()); final PropertyKey<String[]> sessionIdKey = StructrApp.key(Principal.class, "sessionIds"); final String[] sessionIds = user.getProperty(session...
[ "public", "static", "void", "clearInvalidSessions", "(", "final", "Principal", "user", ")", "{", "logger", ".", "info", "(", "\"Clearing invalid sessions for user {} ({})\"", ",", "user", ".", "getName", "(", ")", ",", "user", ".", "getUuid", "(", ")", ")", ";...
Remove old sessionIds of the given user @param user
[ "Remove", "old", "sessionIds", "of", "the", "given", "user" ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-rest/src/main/java/org/structr/rest/auth/SessionHelper.java#L144-L170
120,899
structr/structr
structr-neo4j-bolt-driver/src/main/java/org/structr/bolt/wrapper/NodeWrapper.java
NodeWrapper.evaluateCustomQuery
public boolean evaluateCustomQuery(final String customQuery, final Map<String, Object> parameters) { final SessionTransaction tx = db.getCurrentTransaction(); boolean result = false; try { result = tx.getBoolean(customQuery, parameters); } catch (Exception ignore) {} return result; }
java
public boolean evaluateCustomQuery(final String customQuery, final Map<String, Object> parameters) { final SessionTransaction tx = db.getCurrentTransaction(); boolean result = false; try { result = tx.getBoolean(customQuery, parameters); } catch (Exception ignore) {} return result; }
[ "public", "boolean", "evaluateCustomQuery", "(", "final", "String", "customQuery", ",", "final", "Map", "<", "String", ",", "Object", ">", "parameters", ")", "{", "final", "SessionTransaction", "tx", "=", "db", ".", "getCurrentTransaction", "(", ")", ";", "boo...
Evaluate a custom query and return result as a boolean value @param customQuery @param parameters @return
[ "Evaluate", "a", "custom", "query", "and", "return", "result", "as", "a", "boolean", "value" ]
c111a1d0c0201c7fea5574ed69aa5a5053185a97
https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-neo4j-bolt-driver/src/main/java/org/structr/bolt/wrapper/NodeWrapper.java#L292-L303