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 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
ModeShape/modeshape | modeshape-common/src/main/java/org/modeshape/common/util/Reflection.java | Reflection.convertArgumentClassesToPrimitives | public static List<Class<?>> convertArgumentClassesToPrimitives( Class<?>... arguments ) {
if (arguments == null || arguments.length == 0) return Collections.emptyList();
List<Class<?>> result = new ArrayList<Class<?>>(arguments.length);
for (Class<?> clazz : arguments) {
if (clazz =... | java | public static List<Class<?>> convertArgumentClassesToPrimitives( Class<?>... arguments ) {
if (arguments == null || arguments.length == 0) return Collections.emptyList();
List<Class<?>> result = new ArrayList<Class<?>>(arguments.length);
for (Class<?> clazz : arguments) {
if (clazz =... | [
"public",
"static",
"List",
"<",
"Class",
"<",
"?",
">",
">",
"convertArgumentClassesToPrimitives",
"(",
"Class",
"<",
"?",
">",
"...",
"arguments",
")",
"{",
"if",
"(",
"arguments",
"==",
"null",
"||",
"arguments",
".",
"length",
"==",
"0",
")",
"return... | Convert any argument classes to primitives.
@param arguments the list of argument classes.
@return the list of Class instances in which any classes that could be represented by primitives (e.g., Boolean) were
replaced with the primitive classes (e.g., Boolean.TYPE). | [
"Convert",
"any",
"argument",
"classes",
"to",
"primitives",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/util/Reflection.java#L102-L119 | train |
ModeShape/modeshape | modeshape-common/src/main/java/org/modeshape/common/util/Reflection.java | Reflection.getClassName | public static String getClassName( final Class<?> clazz ) {
final String fullName = clazz.getName();
final int fullNameLength = fullName.length();
// Check for array ('[') or the class/interface marker ('L') ...
int numArrayDimensions = 0;
while (numArrayDimensions < fullNameLen... | java | public static String getClassName( final Class<?> clazz ) {
final String fullName = clazz.getName();
final int fullNameLength = fullName.length();
// Check for array ('[') or the class/interface marker ('L') ...
int numArrayDimensions = 0;
while (numArrayDimensions < fullNameLen... | [
"public",
"static",
"String",
"getClassName",
"(",
"final",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"final",
"String",
"fullName",
"=",
"clazz",
".",
"getName",
"(",
")",
";",
"final",
"int",
"fullNameLength",
"=",
"fullName",
".",
"length",
"(",
")",... | Returns the name of the class. The result will be the fully-qualified class name, or the readable form for arrays and
primitive types.
@param clazz the class for which the class name is to be returned.
@return the readable name of the class. | [
"Returns",
"the",
"name",
"of",
"the",
"class",
".",
"The",
"result",
"will",
"be",
"the",
"fully",
"-",
"qualified",
"class",
"name",
"or",
"the",
"readable",
"form",
"for",
"arrays",
"and",
"primitive",
"types",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/util/Reflection.java#L128-L202 | train |
ModeShape/modeshape | modeshape-common/src/main/java/org/modeshape/common/util/Reflection.java | Reflection.setValue | public static void setValue(Object instance, String fieldName, Object value) {
try {
Field f = findFieldRecursively(instance.getClass(), fieldName);
if (f == null)
throw new NoSuchMethodException("Cannot find field " + fieldName + " on " + instance.getClass() + " or super... | java | public static void setValue(Object instance, String fieldName, Object value) {
try {
Field f = findFieldRecursively(instance.getClass(), fieldName);
if (f == null)
throw new NoSuchMethodException("Cannot find field " + fieldName + " on " + instance.getClass() + " or super... | [
"public",
"static",
"void",
"setValue",
"(",
"Object",
"instance",
",",
"String",
"fieldName",
",",
"Object",
"value",
")",
"{",
"try",
"{",
"Field",
"f",
"=",
"findFieldRecursively",
"(",
"instance",
".",
"getClass",
"(",
")",
",",
"fieldName",
")",
";",
... | Sets the value of a field of an object instance via reflection
@param instance to inspect
@param fieldName name of field to set
@param value the value to set | [
"Sets",
"the",
"value",
"of",
"a",
"field",
"of",
"an",
"object",
"instance",
"via",
"reflection"
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/util/Reflection.java#L211-L221 | train |
ModeShape/modeshape | modeshape-common/src/main/java/org/modeshape/common/util/Reflection.java | Reflection.findMethod | public static Method findMethod(Class<?> type, String methodName) {
try {
return type.getDeclaredMethod(methodName);
} catch (NoSuchMethodException e) {
if (type.equals(Object.class) || type.isInterface()) {
throw new RuntimeException(e);
}
... | java | public static Method findMethod(Class<?> type, String methodName) {
try {
return type.getDeclaredMethod(methodName);
} catch (NoSuchMethodException e) {
if (type.equals(Object.class) || type.isInterface()) {
throw new RuntimeException(e);
}
... | [
"public",
"static",
"Method",
"findMethod",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"String",
"methodName",
")",
"{",
"try",
"{",
"return",
"type",
".",
"getDeclaredMethod",
"(",
"methodName",
")",
";",
"}",
"catch",
"(",
"NoSuchMethodException",
"e",
")... | Searches for a method with a given name in a class.
@param type a {@link Class} instance; never null
@param methodName the name of the method to search for; never null
@return a {@link Method} instance if the method is found | [
"Searches",
"for",
"a",
"method",
"with",
"a",
"given",
"name",
"in",
"a",
"class",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/util/Reflection.java#L249-L258 | train |
ModeShape/modeshape | modeshape-common/src/main/java/org/modeshape/common/util/Reflection.java | Reflection.findMethods | public Method[] findMethods( Pattern methodNamePattern ) {
final Method[] allMethods = this.targetClass.getMethods();
final List<Method> result = new ArrayList<Method>();
for (int i = 0; i < allMethods.length; i++) {
final Method m = allMethods[i];
if (methodNamePattern.m... | java | public Method[] findMethods( Pattern methodNamePattern ) {
final Method[] allMethods = this.targetClass.getMethods();
final List<Method> result = new ArrayList<Method>();
for (int i = 0; i < allMethods.length; i++) {
final Method m = allMethods[i];
if (methodNamePattern.m... | [
"public",
"Method",
"[",
"]",
"findMethods",
"(",
"Pattern",
"methodNamePattern",
")",
"{",
"final",
"Method",
"[",
"]",
"allMethods",
"=",
"this",
".",
"targetClass",
".",
"getMethods",
"(",
")",
";",
"final",
"List",
"<",
"Method",
">",
"result",
"=",
... | Find the methods on the target class that matches the supplied method name.
@param methodNamePattern the regular expression pattern for the name of the method that is to be found.
@return the Method objects that have a matching name, or an empty array if there are no methods that have a matching name. | [
"Find",
"the",
"methods",
"on",
"the",
"target",
"class",
"that",
"matches",
"the",
"supplied",
"method",
"name",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/util/Reflection.java#L384-L394 | train |
ModeShape/modeshape | modeshape-common/src/main/java/org/modeshape/common/util/Reflection.java | Reflection.invokeGetterMethodOnTarget | public Object invokeGetterMethodOnTarget( String javaPropertyName,
Object target )
throws NoSuchMethodException, SecurityException, IllegalArgumentException, IllegalAccessException,
InvocationTargetException {
String[] methodNamesArray = findMethodNa... | java | public Object invokeGetterMethodOnTarget( String javaPropertyName,
Object target )
throws NoSuchMethodException, SecurityException, IllegalArgumentException, IllegalAccessException,
InvocationTargetException {
String[] methodNamesArray = findMethodNa... | [
"public",
"Object",
"invokeGetterMethodOnTarget",
"(",
"String",
"javaPropertyName",
",",
"Object",
"target",
")",
"throws",
"NoSuchMethodException",
",",
"SecurityException",
",",
"IllegalArgumentException",
",",
"IllegalAccessException",
",",
"InvocationTargetException",
"{... | Find and execute the getter method on the target class for the supplied property name. If no such method is found, a
NoSuchMethodException is thrown.
@param javaPropertyName the name of the property whose getter is to be invoked, in the order they are to be tried
@param target the object on which the method is to be i... | [
"Find",
"and",
"execute",
"the",
"getter",
"method",
"on",
"the",
"target",
"class",
"for",
"the",
"supplied",
"property",
"name",
".",
"If",
"no",
"such",
"method",
"is",
"found",
"a",
"NoSuchMethodException",
"is",
"thrown",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/util/Reflection.java#L633-L647 | train |
ModeShape/modeshape | modeshape-common/src/main/java/org/modeshape/common/util/Reflection.java | Reflection.setProperty | public void setProperty( Object target,
Property property,
Object value )
throws SecurityException, IllegalArgumentException, NoSuchMethodException, IllegalAccessException,
InvocationTargetException {
CheckArg.isNotNull(target, "target");... | java | public void setProperty( Object target,
Property property,
Object value )
throws SecurityException, IllegalArgumentException, NoSuchMethodException, IllegalAccessException,
InvocationTargetException {
CheckArg.isNotNull(target, "target");... | [
"public",
"void",
"setProperty",
"(",
"Object",
"target",
",",
"Property",
"property",
",",
"Object",
"value",
")",
"throws",
"SecurityException",
",",
"IllegalArgumentException",
",",
"NoSuchMethodException",
",",
"IllegalAccessException",
",",
"InvocationTargetException... | Set the property on the supplied target object to the specified value.
@param target the target on which the setter is to be called; may not be null
@param property the property that is to be set on the target
@param value the new value for the property
@throws NoSuchMethodException if a matching method is not found.
... | [
"Set",
"the",
"property",
"on",
"the",
"supplied",
"target",
"object",
"to",
"the",
"specified",
"value",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/util/Reflection.java#L1105-L1114 | train |
ModeShape/modeshape | modeshape-common/src/main/java/org/modeshape/common/util/Reflection.java | Reflection.getProperty | public Object getProperty( Object target,
Property property )
throws SecurityException, IllegalArgumentException, NoSuchMethodException, IllegalAccessException,
InvocationTargetException {
CheckArg.isNotNull(target, "target");
CheckArg.isNotNull(property, "... | java | public Object getProperty( Object target,
Property property )
throws SecurityException, IllegalArgumentException, NoSuchMethodException, IllegalAccessException,
InvocationTargetException {
CheckArg.isNotNull(target, "target");
CheckArg.isNotNull(property, "... | [
"public",
"Object",
"getProperty",
"(",
"Object",
"target",
",",
"Property",
"property",
")",
"throws",
"SecurityException",
",",
"IllegalArgumentException",
",",
"NoSuchMethodException",
",",
"IllegalAccessException",
",",
"InvocationTargetException",
"{",
"CheckArg",
".... | Get current value for the property on the supplied target object.
@param target the target on which the setter is to be called; may not be null
@param property the property that is to be set on the target
@return the current value for the property; may be null
@throws NoSuchMethodException if a matching method is not ... | [
"Get",
"current",
"value",
"for",
"the",
"property",
"on",
"the",
"supplied",
"target",
"object",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/util/Reflection.java#L1128-L1136 | train |
ModeShape/modeshape | modeshape-common/src/main/java/org/modeshape/common/util/Reflection.java | Reflection.getPropertyAsString | public String getPropertyAsString( Object target,
Property property )
throws SecurityException, IllegalArgumentException, NoSuchMethodException, IllegalAccessException,
InvocationTargetException {
Object value = getProperty(target, property);
String... | java | public String getPropertyAsString( Object target,
Property property )
throws SecurityException, IllegalArgumentException, NoSuchMethodException, IllegalAccessException,
InvocationTargetException {
Object value = getProperty(target, property);
String... | [
"public",
"String",
"getPropertyAsString",
"(",
"Object",
"target",
",",
"Property",
"property",
")",
"throws",
"SecurityException",
",",
"IllegalArgumentException",
",",
"NoSuchMethodException",
",",
"IllegalAccessException",
",",
"InvocationTargetException",
"{",
"Object"... | Get current value represented as a string for the property on the supplied target object.
@param target the target on which the setter is to be called; may not be null
@param property the property that is to be set on the target
@return the current value for the property; may be null
@throws NoSuchMethodException if a... | [
"Get",
"current",
"value",
"represented",
"as",
"a",
"string",
"for",
"the",
"property",
"on",
"the",
"supplied",
"target",
"object",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/util/Reflection.java#L1150-L1158 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/cache/NodeKey.java | NodeKey.getSourceKey | public String getSourceKey() {
if (sourceKey == null) {
// Value is idempotent, so it's okay to do this without synchronizing ...
sourceKey = key.substring(SOURCE_START_INDEX, SOURCE_END_INDEX);
}
return sourceKey;
} | java | public String getSourceKey() {
if (sourceKey == null) {
// Value is idempotent, so it's okay to do this without synchronizing ...
sourceKey = key.substring(SOURCE_START_INDEX, SOURCE_END_INDEX);
}
return sourceKey;
} | [
"public",
"String",
"getSourceKey",
"(",
")",
"{",
"if",
"(",
"sourceKey",
"==",
"null",
")",
"{",
"// Value is idempotent, so it's okay to do this without synchronizing ...",
"sourceKey",
"=",
"key",
".",
"substring",
"(",
"SOURCE_START_INDEX",
",",
"SOURCE_END_INDEX",
... | Get the multi-character key uniquely identifying the repository's storage source in which this node appears.
@return the source key; never null and always contains at least one character | [
"Get",
"the",
"multi",
"-",
"character",
"key",
"uniquely",
"identifying",
"the",
"repository",
"s",
"storage",
"source",
"in",
"which",
"this",
"node",
"appears",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/cache/NodeKey.java#L151-L157 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/cache/NodeKey.java | NodeKey.getWorkspaceKey | public String getWorkspaceKey() {
if (workspaceKey == null) {
// Value is idempotent, so it's okay to do this without synchronizing ...
workspaceKey = key.substring(WORKSPACE_START_INDEX, WORKSPACE_END_INDEX);
}
return workspaceKey;
} | java | public String getWorkspaceKey() {
if (workspaceKey == null) {
// Value is idempotent, so it's okay to do this without synchronizing ...
workspaceKey = key.substring(WORKSPACE_START_INDEX, WORKSPACE_END_INDEX);
}
return workspaceKey;
} | [
"public",
"String",
"getWorkspaceKey",
"(",
")",
"{",
"if",
"(",
"workspaceKey",
"==",
"null",
")",
"{",
"// Value is idempotent, so it's okay to do this without synchronizing ...",
"workspaceKey",
"=",
"key",
".",
"substring",
"(",
"WORKSPACE_START_INDEX",
",",
"WORKSPAC... | Get the multi-character key uniquely identifying the workspace in which the node appears.
@return the workspace key; never null and always contains at least one character | [
"Get",
"the",
"multi",
"-",
"character",
"key",
"uniquely",
"identifying",
"the",
"workspace",
"in",
"which",
"the",
"node",
"appears",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/cache/NodeKey.java#L164-L170 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/QueryBuilder.java | QueryBuilder.union | public QueryBuilder union() {
this.firstQuery = query();
this.firstQuerySetOperation = Operation.UNION;
this.firstQueryAll = false;
clear(false);
return this;
} | java | public QueryBuilder union() {
this.firstQuery = query();
this.firstQuerySetOperation = Operation.UNION;
this.firstQueryAll = false;
clear(false);
return this;
} | [
"public",
"QueryBuilder",
"union",
"(",
")",
"{",
"this",
".",
"firstQuery",
"=",
"query",
"(",
")",
";",
"this",
".",
"firstQuerySetOperation",
"=",
"Operation",
".",
"UNION",
";",
"this",
".",
"firstQueryAll",
"=",
"false",
";",
"clear",
"(",
"false",
... | Perform a UNION between the query as defined prior to this method and the query that will be defined following this method.
@return this builder object, for convenience in method chaining | [
"Perform",
"a",
"UNION",
"between",
"the",
"query",
"as",
"defined",
"prior",
"to",
"this",
"method",
"and",
"the",
"query",
"that",
"will",
"be",
"defined",
"following",
"this",
"method",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/QueryBuilder.java#L621-L627 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/QueryBuilder.java | QueryBuilder.unionAll | public QueryBuilder unionAll() {
this.firstQuery = query();
this.firstQuerySetOperation = Operation.UNION;
this.firstQueryAll = true;
clear(false);
return this;
} | java | public QueryBuilder unionAll() {
this.firstQuery = query();
this.firstQuerySetOperation = Operation.UNION;
this.firstQueryAll = true;
clear(false);
return this;
} | [
"public",
"QueryBuilder",
"unionAll",
"(",
")",
"{",
"this",
".",
"firstQuery",
"=",
"query",
"(",
")",
";",
"this",
".",
"firstQuerySetOperation",
"=",
"Operation",
".",
"UNION",
";",
"this",
".",
"firstQueryAll",
"=",
"true",
";",
"clear",
"(",
"false",
... | Perform a UNION ALL between the query as defined prior to this method and the query that will be defined following this
method.
@return this builder object, for convenience in method chaining | [
"Perform",
"a",
"UNION",
"ALL",
"between",
"the",
"query",
"as",
"defined",
"prior",
"to",
"this",
"method",
"and",
"the",
"query",
"that",
"will",
"be",
"defined",
"following",
"this",
"method",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/QueryBuilder.java#L635-L641 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/QueryBuilder.java | QueryBuilder.intersect | public QueryBuilder intersect() {
this.firstQuery = query();
this.firstQuerySetOperation = Operation.INTERSECT;
this.firstQueryAll = false;
clear(false);
return this;
} | java | public QueryBuilder intersect() {
this.firstQuery = query();
this.firstQuerySetOperation = Operation.INTERSECT;
this.firstQueryAll = false;
clear(false);
return this;
} | [
"public",
"QueryBuilder",
"intersect",
"(",
")",
"{",
"this",
".",
"firstQuery",
"=",
"query",
"(",
")",
";",
"this",
".",
"firstQuerySetOperation",
"=",
"Operation",
".",
"INTERSECT",
";",
"this",
".",
"firstQueryAll",
"=",
"false",
";",
"clear",
"(",
"fa... | Perform an INTERSECT between the query as defined prior to this method and the query that will be defined following this
method.
@return this builder object, for convenience in method chaining | [
"Perform",
"an",
"INTERSECT",
"between",
"the",
"query",
"as",
"defined",
"prior",
"to",
"this",
"method",
"and",
"the",
"query",
"that",
"will",
"be",
"defined",
"following",
"this",
"method",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/QueryBuilder.java#L649-L655 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/QueryBuilder.java | QueryBuilder.intersectAll | public QueryBuilder intersectAll() {
this.firstQuery = query();
this.firstQuerySetOperation = Operation.INTERSECT;
this.firstQueryAll = true;
clear(false);
return this;
} | java | public QueryBuilder intersectAll() {
this.firstQuery = query();
this.firstQuerySetOperation = Operation.INTERSECT;
this.firstQueryAll = true;
clear(false);
return this;
} | [
"public",
"QueryBuilder",
"intersectAll",
"(",
")",
"{",
"this",
".",
"firstQuery",
"=",
"query",
"(",
")",
";",
"this",
".",
"firstQuerySetOperation",
"=",
"Operation",
".",
"INTERSECT",
";",
"this",
".",
"firstQueryAll",
"=",
"true",
";",
"clear",
"(",
"... | Perform an INTERSECT ALL between the query as defined prior to this method and the query that will be defined following
this method.
@return this builder object, for convenience in method chaining | [
"Perform",
"an",
"INTERSECT",
"ALL",
"between",
"the",
"query",
"as",
"defined",
"prior",
"to",
"this",
"method",
"and",
"the",
"query",
"that",
"will",
"be",
"defined",
"following",
"this",
"method",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/QueryBuilder.java#L663-L669 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/QueryBuilder.java | QueryBuilder.except | public QueryBuilder except() {
this.firstQuery = query();
this.firstQuerySetOperation = Operation.EXCEPT;
this.firstQueryAll = false;
clear(false);
return this;
} | java | public QueryBuilder except() {
this.firstQuery = query();
this.firstQuerySetOperation = Operation.EXCEPT;
this.firstQueryAll = false;
clear(false);
return this;
} | [
"public",
"QueryBuilder",
"except",
"(",
")",
"{",
"this",
".",
"firstQuery",
"=",
"query",
"(",
")",
";",
"this",
".",
"firstQuerySetOperation",
"=",
"Operation",
".",
"EXCEPT",
";",
"this",
".",
"firstQueryAll",
"=",
"false",
";",
"clear",
"(",
"false",
... | Perform an EXCEPT between the query as defined prior to this method and the query that will be defined following this
method.
@return this builder object, for convenience in method chaining | [
"Perform",
"an",
"EXCEPT",
"between",
"the",
"query",
"as",
"defined",
"prior",
"to",
"this",
"method",
"and",
"the",
"query",
"that",
"will",
"be",
"defined",
"following",
"this",
"method",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/QueryBuilder.java#L677-L683 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/QueryBuilder.java | QueryBuilder.exceptAll | public QueryBuilder exceptAll() {
this.firstQuery = query();
this.firstQuerySetOperation = Operation.EXCEPT;
this.firstQueryAll = true;
clear(false);
return this;
} | java | public QueryBuilder exceptAll() {
this.firstQuery = query();
this.firstQuerySetOperation = Operation.EXCEPT;
this.firstQueryAll = true;
clear(false);
return this;
} | [
"public",
"QueryBuilder",
"exceptAll",
"(",
")",
"{",
"this",
".",
"firstQuery",
"=",
"query",
"(",
")",
";",
"this",
".",
"firstQuerySetOperation",
"=",
"Operation",
".",
"EXCEPT",
";",
"this",
".",
"firstQueryAll",
"=",
"true",
";",
"clear",
"(",
"false"... | Perform an EXCEPT ALL between the query as defined prior to this method and the query that will be defined following this
method.
@return this builder object, for convenience in method chaining | [
"Perform",
"an",
"EXCEPT",
"ALL",
"between",
"the",
"query",
"as",
"defined",
"prior",
"to",
"this",
"method",
"and",
"the",
"query",
"that",
"will",
"be",
"defined",
"following",
"this",
"method",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/QueryBuilder.java#L691-L697 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/spi/index/provider/IndexChangeAdapters.java | IndexChangeAdapters.forMultipleColumns | public static IndexChangeAdapter forMultipleColumns( ExecutionContext context,
NodeTypePredicate matcher,
String workspaceName,
ProvidedIndex<?> inde... | java | public static IndexChangeAdapter forMultipleColumns( ExecutionContext context,
NodeTypePredicate matcher,
String workspaceName,
ProvidedIndex<?> inde... | [
"public",
"static",
"IndexChangeAdapter",
"forMultipleColumns",
"(",
"ExecutionContext",
"context",
",",
"NodeTypePredicate",
"matcher",
",",
"String",
"workspaceName",
",",
"ProvidedIndex",
"<",
"?",
">",
"index",
",",
"Iterable",
"<",
"IndexChangeAdapter",
">",
"ada... | Creates a composite change adapter which handles the case when an index has multiple columns.
@param context the execution context; may not be null
@param matcher the node type matcher used to determine which nodes should be included in the index; may not be null
@param workspaceName the name of the workspace; may not... | [
"Creates",
"a",
"composite",
"change",
"adapter",
"which",
"handles",
"the",
"case",
"when",
"an",
"index",
"has",
"multiple",
"columns",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/spi/index/provider/IndexChangeAdapters.java#L63-L69 | train |
ModeShape/modeshape | sequencers/modeshape-sequencer-audio/src/main/java/org/modeshape/sequencer/audio/AudioMetadata.java | AudioMetadata.checkSupportedAudio | private boolean checkSupportedAudio() {
AudioHeader header = audioFile.getAudioHeader();
bitrate = header.getBitRateAsNumber();
sampleRate = header.getSampleRateAsNumber();
channels = header.getChannels();
if (header.getChannels().toLowerCase().contains("stereo")) {
c... | java | private boolean checkSupportedAudio() {
AudioHeader header = audioFile.getAudioHeader();
bitrate = header.getBitRateAsNumber();
sampleRate = header.getSampleRateAsNumber();
channels = header.getChannels();
if (header.getChannels().toLowerCase().contains("stereo")) {
c... | [
"private",
"boolean",
"checkSupportedAudio",
"(",
")",
"{",
"AudioHeader",
"header",
"=",
"audioFile",
".",
"getAudioHeader",
"(",
")",
";",
"bitrate",
"=",
"header",
".",
"getBitRateAsNumber",
"(",
")",
";",
"sampleRate",
"=",
"header",
".",
"getSampleRateAsNum... | Parse tags common for all audio files. | [
"Parse",
"tags",
"common",
"for",
"all",
"audio",
"files",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/sequencers/modeshape-sequencer-audio/src/main/java/org/modeshape/sequencer/audio/AudioMetadata.java#L175-L215 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/index/local/LocalUniqueIndex.java | LocalUniqueIndex.create | static <T> LocalUniqueIndex<T> create( String name,
String workspaceName,
DB db,
Converter<T> converter,
BTreeKeySerializer<T> valueSerializer,
... | java | static <T> LocalUniqueIndex<T> create( String name,
String workspaceName,
DB db,
Converter<T> converter,
BTreeKeySerializer<T> valueSerializer,
... | [
"static",
"<",
"T",
">",
"LocalUniqueIndex",
"<",
"T",
">",
"create",
"(",
"String",
"name",
",",
"String",
"workspaceName",
",",
"DB",
"db",
",",
"Converter",
"<",
"T",
">",
"converter",
",",
"BTreeKeySerializer",
"<",
"T",
">",
"valueSerializer",
",",
... | Create a new index that allows only a single value for each unique key.
@param name the name of the index; may not be null or empty
@param workspaceName the name of the workspace; may not be null
@param db the database in which the index information is to be stored; may not be null
@param converter the converter from ... | [
"Create",
"a",
"new",
"index",
"that",
"allows",
"only",
"a",
"single",
"value",
"for",
"each",
"unique",
"key",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/index/local/LocalUniqueIndex.java#L48-L55 | train |
ModeShape/modeshape | index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/EsIndexColumn.java | EsIndexColumn.columnValue | protected Object columnValue(Object value) {
switch (type) {
case PATH:
case NAME:
case STRING:
case REFERENCE:
case SIMPLEREFERENCE:
case WEAKREFERENCE:
case URI:
return valueFactories.getStringFactory().create(... | java | protected Object columnValue(Object value) {
switch (type) {
case PATH:
case NAME:
case STRING:
case REFERENCE:
case SIMPLEREFERENCE:
case WEAKREFERENCE:
case URI:
return valueFactories.getStringFactory().create(... | [
"protected",
"Object",
"columnValue",
"(",
"Object",
"value",
")",
"{",
"switch",
"(",
"type",
")",
"{",
"case",
"PATH",
":",
"case",
"NAME",
":",
"case",
"STRING",
":",
"case",
"REFERENCE",
":",
"case",
"SIMPLEREFERENCE",
":",
"case",
"WEAKREFERENCE",
":"... | Converts representation of the given value using type conversation rules
between JCR type of this column and Elasticsearch core type of this column.
@param value value to be converted.
@return converted value. | [
"Converts",
"representation",
"of",
"the",
"given",
"value",
"using",
"type",
"conversation",
"rules",
"between",
"JCR",
"type",
"of",
"this",
"column",
"and",
"Elasticsearch",
"core",
"type",
"of",
"this",
"column",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/EsIndexColumn.java#L114-L129 | train |
ModeShape/modeshape | index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/EsIndexColumn.java | EsIndexColumn.cast | protected Object cast(Object value) {
switch (type) {
case STRING :
return valueFactories.getStringFactory().create(value);
case LONG :
return valueFactories.getLongFactory().create(value);
case NAME :
return valueFactories.getNa... | java | protected Object cast(Object value) {
switch (type) {
case STRING :
return valueFactories.getStringFactory().create(value);
case LONG :
return valueFactories.getLongFactory().create(value);
case NAME :
return valueFactories.getNa... | [
"protected",
"Object",
"cast",
"(",
"Object",
"value",
")",
"{",
"switch",
"(",
"type",
")",
"{",
"case",
"STRING",
":",
"return",
"valueFactories",
".",
"getStringFactory",
"(",
")",
".",
"create",
"(",
"value",
")",
";",
"case",
"LONG",
":",
"return",
... | Converts given value to the value of JCR type of this column.
@param value value to be converted.
@return converted value. | [
"Converts",
"given",
"value",
"to",
"the",
"value",
"of",
"JCR",
"type",
"of",
"this",
"column",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/EsIndexColumn.java#L154-L179 | train |
ModeShape/modeshape | index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/client/EsClient.java | EsClient.indexExists | public boolean indexExists(String name) throws IOException {
CloseableHttpClient client = HttpClients.createDefault();
HttpHead head = new HttpHead(String.format("http://%s:%d/%s", host, port, name));
try {
CloseableHttpResponse response = client.execute(head);
return res... | java | public boolean indexExists(String name) throws IOException {
CloseableHttpClient client = HttpClients.createDefault();
HttpHead head = new HttpHead(String.format("http://%s:%d/%s", host, port, name));
try {
CloseableHttpResponse response = client.execute(head);
return res... | [
"public",
"boolean",
"indexExists",
"(",
"String",
"name",
")",
"throws",
"IOException",
"{",
"CloseableHttpClient",
"client",
"=",
"HttpClients",
".",
"createDefault",
"(",
")",
";",
"HttpHead",
"head",
"=",
"new",
"HttpHead",
"(",
"String",
".",
"format",
"(... | Tests for the index existence with specified name.
@param name the name of the index to test.
@return true if index with given name exists and false otherwise.
@throws IOException communication exception. | [
"Tests",
"for",
"the",
"index",
"existence",
"with",
"specified",
"name",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/client/EsClient.java#L60-L69 | train |
ModeShape/modeshape | index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/client/EsClient.java | EsClient.createIndex | public boolean createIndex(String name, String type, EsRequest mappings) throws IOException {
if (indexExists(name)) {
return true;
}
CloseableHttpClient client = HttpClients.createDefault();
HttpPost method = new HttpPost(String.format("http://%s:%d/%s", host, port, name));... | java | public boolean createIndex(String name, String type, EsRequest mappings) throws IOException {
if (indexExists(name)) {
return true;
}
CloseableHttpClient client = HttpClients.createDefault();
HttpPost method = new HttpPost(String.format("http://%s:%d/%s", host, port, name));... | [
"public",
"boolean",
"createIndex",
"(",
"String",
"name",
",",
"String",
"type",
",",
"EsRequest",
"mappings",
")",
"throws",
"IOException",
"{",
"if",
"(",
"indexExists",
"(",
"name",
")",
")",
"{",
"return",
"true",
";",
"}",
"CloseableHttpClient",
"clien... | Creates new index.
@param name the name of the index to test.
@param type index type
@param mappings field mapping definition.
@return true if index was created.
@throws IOException communication exception. | [
"Creates",
"new",
"index",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/client/EsClient.java#L80-L95 | train |
ModeShape/modeshape | index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/client/EsClient.java | EsClient.deleteIndex | public boolean deleteIndex(String name) throws IOException {
CloseableHttpClient client = HttpClients.createDefault();
HttpDelete delete = new HttpDelete(String.format("http://%s:%d/%s", host, port, name));
try {
CloseableHttpResponse resp = client.execute(delete);
return... | java | public boolean deleteIndex(String name) throws IOException {
CloseableHttpClient client = HttpClients.createDefault();
HttpDelete delete = new HttpDelete(String.format("http://%s:%d/%s", host, port, name));
try {
CloseableHttpResponse resp = client.execute(delete);
return... | [
"public",
"boolean",
"deleteIndex",
"(",
"String",
"name",
")",
"throws",
"IOException",
"{",
"CloseableHttpClient",
"client",
"=",
"HttpClients",
".",
"createDefault",
"(",
")",
";",
"HttpDelete",
"delete",
"=",
"new",
"HttpDelete",
"(",
"String",
".",
"format"... | Deletes index.
@param name the name of the index to be deleted.
@return true if index was deleted.
@throws IOException | [
"Deletes",
"index",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/client/EsClient.java#L104-L113 | train |
ModeShape/modeshape | index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/client/EsClient.java | EsClient.storeDocument | public boolean storeDocument(String name, String type, String id,
EsRequest doc) throws IOException {
CloseableHttpClient client = HttpClients.createDefault();
HttpPost method = new HttpPost(String.format("http://%s:%d/%s/%s/%s", host, port, name, type, id));
try {
String... | java | public boolean storeDocument(String name, String type, String id,
EsRequest doc) throws IOException {
CloseableHttpClient client = HttpClients.createDefault();
HttpPost method = new HttpPost(String.format("http://%s:%d/%s/%s/%s", host, port, name, type, id));
try {
String... | [
"public",
"boolean",
"storeDocument",
"(",
"String",
"name",
",",
"String",
"type",
",",
"String",
"id",
",",
"EsRequest",
"doc",
")",
"throws",
"IOException",
"{",
"CloseableHttpClient",
"client",
"=",
"HttpClients",
".",
"createDefault",
"(",
")",
";",
"Http... | Indexes document.
@param name the name of the index.
@param type index type
@param id document id
@param doc document
@return true if document was indexed.
@throws IOException | [
"Indexes",
"document",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/client/EsClient.java#L125-L138 | train |
ModeShape/modeshape | index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/client/EsClient.java | EsClient.getDocument | public EsRequest getDocument(String name, String type, String id) throws IOException {
CloseableHttpClient client = HttpClients.createDefault();
HttpGet method = new HttpGet(String.format("http://%s:%d/%s/%s/%s", host, port, name, type, id));
try {
CloseableHttpResponse resp = client... | java | public EsRequest getDocument(String name, String type, String id) throws IOException {
CloseableHttpClient client = HttpClients.createDefault();
HttpGet method = new HttpGet(String.format("http://%s:%d/%s/%s/%s", host, port, name, type, id));
try {
CloseableHttpResponse resp = client... | [
"public",
"EsRequest",
"getDocument",
"(",
"String",
"name",
",",
"String",
"type",
",",
"String",
"id",
")",
"throws",
"IOException",
"{",
"CloseableHttpClient",
"client",
"=",
"HttpClients",
".",
"createDefault",
"(",
")",
";",
"HttpGet",
"method",
"=",
"new... | Searches indexed document.
@param name index name.
@param type index type.
@param id document identifier.
@return document if it was found or null.
@throws IOException | [
"Searches",
"indexed",
"document",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/client/EsClient.java#L149-L168 | train |
ModeShape/modeshape | index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/client/EsClient.java | EsClient.deleteDocument | public boolean deleteDocument(String name, String type, String id) throws IOException {
CloseableHttpClient client = HttpClients.createDefault();
HttpDelete delete = new HttpDelete(String.format("http://%s:%d/%s/%s/%s", host, port, name, type, id));
try {
return client.execute(delete... | java | public boolean deleteDocument(String name, String type, String id) throws IOException {
CloseableHttpClient client = HttpClients.createDefault();
HttpDelete delete = new HttpDelete(String.format("http://%s:%d/%s/%s/%s", host, port, name, type, id));
try {
return client.execute(delete... | [
"public",
"boolean",
"deleteDocument",
"(",
"String",
"name",
",",
"String",
"type",
",",
"String",
"id",
")",
"throws",
"IOException",
"{",
"CloseableHttpClient",
"client",
"=",
"HttpClients",
".",
"createDefault",
"(",
")",
";",
"HttpDelete",
"delete",
"=",
... | Deletes document.
@param name index name.
@param type index type.
@param id document id
@return true if it was deleted.
@throws IOException | [
"Deletes",
"document",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/client/EsClient.java#L179-L187 | train |
ModeShape/modeshape | index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/client/EsClient.java | EsClient.deleteAll | public void deleteAll(String name, String type) throws IOException {
CloseableHttpClient client = HttpClients.createDefault();
HttpPost method = new HttpPost(String.format("http://%s:%d/%s/%s", host, port, name, type));
try {
EsRequest query = new EsRequest();
query.put("... | java | public void deleteAll(String name, String type) throws IOException {
CloseableHttpClient client = HttpClients.createDefault();
HttpPost method = new HttpPost(String.format("http://%s:%d/%s/%s", host, port, name, type));
try {
EsRequest query = new EsRequest();
query.put("... | [
"public",
"void",
"deleteAll",
"(",
"String",
"name",
",",
"String",
"type",
")",
"throws",
"IOException",
"{",
"CloseableHttpClient",
"client",
"=",
"HttpClients",
".",
"createDefault",
"(",
")",
";",
"HttpPost",
"method",
"=",
"new",
"HttpPost",
"(",
"String... | Deletes all documents.
@param name index name
@param type index type.
@throws IOException | [
"Deletes",
"all",
"documents",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/client/EsClient.java#L196-L213 | train |
ModeShape/modeshape | index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/client/EsClient.java | EsClient.flush | public void flush(String name) throws IOException {
CloseableHttpClient client = HttpClients.createDefault();
HttpPost method = new HttpPost(String.format("http://%s:%d/%s/_flush", host, port, name));
try {
CloseableHttpResponse resp = client.execute(method);
int status =... | java | public void flush(String name) throws IOException {
CloseableHttpClient client = HttpClients.createDefault();
HttpPost method = new HttpPost(String.format("http://%s:%d/%s/_flush", host, port, name));
try {
CloseableHttpResponse resp = client.execute(method);
int status =... | [
"public",
"void",
"flush",
"(",
"String",
"name",
")",
"throws",
"IOException",
"{",
"CloseableHttpClient",
"client",
"=",
"HttpClients",
".",
"createDefault",
"(",
")",
";",
"HttpPost",
"method",
"=",
"new",
"HttpPost",
"(",
"String",
".",
"format",
"(",
"\... | Flushes index data.
@param name index name.
@throws IOException | [
"Flushes",
"index",
"data",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/client/EsClient.java#L221-L233 | train |
ModeShape/modeshape | index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/client/EsClient.java | EsClient.search | public EsResponse search(String name, String type, EsRequest query) throws IOException {
CloseableHttpClient client = HttpClients.createDefault();
HttpPost method = new HttpPost(String.format("http://%s:%d/%s/%s/_search", host, port, name, type));
try {
StringEntity requestEntity = n... | java | public EsResponse search(String name, String type, EsRequest query) throws IOException {
CloseableHttpClient client = HttpClients.createDefault();
HttpPost method = new HttpPost(String.format("http://%s:%d/%s/%s/_search", host, port, name, type));
try {
StringEntity requestEntity = n... | [
"public",
"EsResponse",
"search",
"(",
"String",
"name",
",",
"String",
"type",
",",
"EsRequest",
"query",
")",
"throws",
"IOException",
"{",
"CloseableHttpClient",
"client",
"=",
"HttpClients",
".",
"createDefault",
"(",
")",
";",
"HttpPost",
"method",
"=",
"... | Executes query.
@param name index name.
@param type index type.
@param query query to be executed
@return search results in json format.
@throws IOException | [
"Executes",
"query",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/index-providers/modeshape-elasticsearch-index-provider/src/main/java/org/modeshape/jcr/index/elasticsearch/client/EsClient.java#L264-L280 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/value/basic/AbstractPath.java | AbstractPath.doGetString | protected String doGetString( NamespaceRegistry namespaceRegistry,
TextEncoder encoder,
TextEncoder delimiterEncoder ) {
if (encoder == null) encoder = DEFAULT_ENCODER;
final String delimiter = delimiterEncoder != null ? delimiterEncode... | java | protected String doGetString( NamespaceRegistry namespaceRegistry,
TextEncoder encoder,
TextEncoder delimiterEncoder ) {
if (encoder == null) encoder = DEFAULT_ENCODER;
final String delimiter = delimiterEncoder != null ? delimiterEncode... | [
"protected",
"String",
"doGetString",
"(",
"NamespaceRegistry",
"namespaceRegistry",
",",
"TextEncoder",
"encoder",
",",
"TextEncoder",
"delimiterEncoder",
")",
"{",
"if",
"(",
"encoder",
"==",
"null",
")",
"encoder",
"=",
"DEFAULT_ENCODER",
";",
"final",
"String",
... | Method that creates the string representation. This method works two different ways depending upon whether the namespace
registry is provided.
@param namespaceRegistry
@param encoder
@param delimiterEncoder
@return this path as a string | [
"Method",
"that",
"creates",
"the",
"string",
"representation",
".",
"This",
"method",
"works",
"two",
"different",
"ways",
"depending",
"upon",
"whether",
"the",
"namespace",
"registry",
"is",
"provided",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/value/basic/AbstractPath.java#L227-L251 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/JcrLockManager.java | JcrLockManager.lock | public Lock lock( AbstractJcrNode node,
boolean isDeep,
boolean isSessionScoped,
long timeoutHint,
String ownerInfo )
throws LockException, AccessDeniedException, InvalidItemStateException, RepositoryException {
if (... | java | public Lock lock( AbstractJcrNode node,
boolean isDeep,
boolean isSessionScoped,
long timeoutHint,
String ownerInfo )
throws LockException, AccessDeniedException, InvalidItemStateException, RepositoryException {
if (... | [
"public",
"Lock",
"lock",
"(",
"AbstractJcrNode",
"node",
",",
"boolean",
"isDeep",
",",
"boolean",
"isSessionScoped",
",",
"long",
"timeoutHint",
",",
"String",
"ownerInfo",
")",
"throws",
"LockException",
",",
"AccessDeniedException",
",",
"InvalidItemStateException... | Attempt to obtain a lock on the supplied node.
@param node the node; may not be null
@param isDeep true if the lock should be a deep lock
@param isSessionScoped true if the lock should be scoped to the session
@param timeoutHint desired lock timeout in seconds (servers are free to ignore this value); specify {@link Lo... | [
"Attempt",
"to",
"obtain",
"a",
"lock",
"on",
"the",
"supplied",
"node",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/JcrLockManager.java#L256-L277 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/xpath/XPathParser.java | XPathParser.removeQuotes | protected String removeQuotes( String text ) {
assert text != null;
if (text.length() > 2) {
char first = text.charAt(0);
// Need to remove these only if they are paired ...
if (first == '"' || first == '\'') {
int indexOfLast = text.length() - 1;
... | java | protected String removeQuotes( String text ) {
assert text != null;
if (text.length() > 2) {
char first = text.charAt(0);
// Need to remove these only if they are paired ...
if (first == '"' || first == '\'') {
int indexOfLast = text.length() - 1;
... | [
"protected",
"String",
"removeQuotes",
"(",
"String",
"text",
")",
"{",
"assert",
"text",
"!=",
"null",
";",
"if",
"(",
"text",
".",
"length",
"(",
")",
">",
"2",
")",
"{",
"char",
"first",
"=",
"text",
".",
"charAt",
"(",
"0",
")",
";",
"// Need t... | Remove any leading and trailing single-quotes or double-quotes from the supplied text.
@param text the input text; may not be null
@return the text without leading and trailing quotes, or <code>text</code> if there were no square brackets or quotes | [
"Remove",
"any",
"leading",
"and",
"trailing",
"single",
"-",
"quotes",
"or",
"double",
"-",
"quotes",
"from",
"the",
"supplied",
"text",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/xpath/XPathParser.java#L747-L761 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/BackupDocumentWriter.java | BackupDocumentWriter.write | public void write( Document document ) {
assert document != null;
++count;
++totalCount;
if (count > maxDocumentsPerFile) {
// Close the stream (we'll open a new one later in the method) ...
close();
count = 1;
}
try {
if (s... | java | public void write( Document document ) {
assert document != null;
++count;
++totalCount;
if (count > maxDocumentsPerFile) {
// Close the stream (we'll open a new one later in the method) ...
close();
count = 1;
}
try {
if (s... | [
"public",
"void",
"write",
"(",
"Document",
"document",
")",
"{",
"assert",
"document",
"!=",
"null",
";",
"++",
"count",
";",
"++",
"totalCount",
";",
"if",
"(",
"count",
">",
"maxDocumentsPerFile",
")",
"{",
"// Close the stream (we'll open a new one later in th... | Append the supplied document to the files.
@param document the document to be written; may not be null | [
"Append",
"the",
"supplied",
"document",
"to",
"the",
"files",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/BackupDocumentWriter.java#L71-L98 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/model/Query.java | Query.constrainedBy | public Query constrainedBy( Constraint constraint ) {
return new Query(source, constraint, orderings(), columns, getLimits(), distinct);
} | java | public Query constrainedBy( Constraint constraint ) {
return new Query(source, constraint, orderings(), columns, getLimits(), distinct);
} | [
"public",
"Query",
"constrainedBy",
"(",
"Constraint",
"constraint",
")",
"{",
"return",
"new",
"Query",
"(",
"source",
",",
"constraint",
",",
"orderings",
"(",
")",
",",
"columns",
",",
"getLimits",
"(",
")",
",",
"distinct",
")",
";",
"}"
] | Create a copy of this query, but one that uses the supplied constraint.
@param constraint the constraint that should be used; never null
@return the copy of the query that uses the supplied constraint; never null | [
"Create",
"a",
"copy",
"of",
"this",
"query",
"but",
"one",
"that",
"uses",
"the",
"supplied",
"constraint",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/model/Query.java#L177-L179 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/model/Query.java | Query.orderedBy | public Query orderedBy( List<Ordering> orderings ) {
return new Query(source, constraint, orderings, columns, getLimits(), distinct);
} | java | public Query orderedBy( List<Ordering> orderings ) {
return new Query(source, constraint, orderings, columns, getLimits(), distinct);
} | [
"public",
"Query",
"orderedBy",
"(",
"List",
"<",
"Ordering",
">",
"orderings",
")",
"{",
"return",
"new",
"Query",
"(",
"source",
",",
"constraint",
",",
"orderings",
",",
"columns",
",",
"getLimits",
"(",
")",
",",
"distinct",
")",
";",
"}"
] | Create a copy of this query, but one whose results should be ordered by the supplied orderings.
@param orderings the result ordering specification that should be used; never null
@return the copy of the query that uses the supplied ordering; never null | [
"Create",
"a",
"copy",
"of",
"this",
"query",
"but",
"one",
"whose",
"results",
"should",
"be",
"ordered",
"by",
"the",
"supplied",
"orderings",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/model/Query.java#L187-L189 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/model/Query.java | Query.returning | public Query returning( List<Column> columns ) {
return new Query(source, constraint, orderings(), columns, getLimits(), distinct);
} | java | public Query returning( List<Column> columns ) {
return new Query(source, constraint, orderings(), columns, getLimits(), distinct);
} | [
"public",
"Query",
"returning",
"(",
"List",
"<",
"Column",
">",
"columns",
")",
"{",
"return",
"new",
"Query",
"(",
"source",
",",
"constraint",
",",
"orderings",
"(",
")",
",",
"columns",
",",
"getLimits",
"(",
")",
",",
"distinct",
")",
";",
"}"
] | Create a copy of this query, but that returns results with the supplied columns.
@param columns the columns of the results; may not be null
@return the copy of the query returning the supplied result columns; never null | [
"Create",
"a",
"copy",
"of",
"this",
"query",
"but",
"that",
"returns",
"results",
"with",
"the",
"supplied",
"columns",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/model/Query.java#L209-L211 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/model/Query.java | Query.adding | public Query adding( Column... columns ) {
List<Column> newColumns = null;
if (this.columns != null) {
newColumns = new ArrayList<Column>(this.columns);
for (Column column : columns) {
newColumns.add(column);
}
} else {
newColumns =... | java | public Query adding( Column... columns ) {
List<Column> newColumns = null;
if (this.columns != null) {
newColumns = new ArrayList<Column>(this.columns);
for (Column column : columns) {
newColumns.add(column);
}
} else {
newColumns =... | [
"public",
"Query",
"adding",
"(",
"Column",
"...",
"columns",
")",
"{",
"List",
"<",
"Column",
">",
"newColumns",
"=",
"null",
";",
"if",
"(",
"this",
".",
"columns",
"!=",
"null",
")",
"{",
"newColumns",
"=",
"new",
"ArrayList",
"<",
"Column",
">",
... | Create a copy of this query, but that returns results that include the columns specified by this query as well as the
supplied columns.
@param columns the additional columns that should be included in the the results; may not be null
@return the copy of the query returning the supplied result columns; never null | [
"Create",
"a",
"copy",
"of",
"this",
"query",
"but",
"that",
"returns",
"results",
"that",
"include",
"the",
"columns",
"specified",
"by",
"this",
"query",
"as",
"well",
"as",
"the",
"supplied",
"columns",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/model/Query.java#L240-L251 | train |
ModeShape/modeshape | web/modeshape-web-explorer/src/main/java/org/modeshape/web/client/Console.java | Console.getCredentials | private void getCredentials() {
jcrService.getUserName(new BaseCallback<String>() {
@Override
public void onSuccess(String name) {
showMainForm(name);
}
});
} | java | private void getCredentials() {
jcrService.getUserName(new BaseCallback<String>() {
@Override
public void onSuccess(String name) {
showMainForm(name);
}
});
} | [
"private",
"void",
"getCredentials",
"(",
")",
"{",
"jcrService",
".",
"getUserName",
"(",
"new",
"BaseCallback",
"<",
"String",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"onSuccess",
"(",
"String",
"name",
")",
"{",
"showMainForm",
"(",
"name... | Checks user's credentials. | [
"Checks",
"user",
"s",
"credentials",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/web/modeshape-web-explorer/src/main/java/org/modeshape/web/client/Console.java#L94-L101 | train |
ModeShape/modeshape | web/modeshape-web-explorer/src/main/java/org/modeshape/web/client/Console.java | Console.loadNodeSpecifiedByURL | public void loadNodeSpecifiedByURL() {
repositoriesList.select(jcrURL.getRepository(), jcrURL.getWorkspace(), jcrURL.getPath(), true);
} | java | public void loadNodeSpecifiedByURL() {
repositoriesList.select(jcrURL.getRepository(), jcrURL.getWorkspace(), jcrURL.getPath(), true);
} | [
"public",
"void",
"loadNodeSpecifiedByURL",
"(",
")",
"{",
"repositoriesList",
".",
"select",
"(",
"jcrURL",
".",
"getRepository",
"(",
")",
",",
"jcrURL",
".",
"getWorkspace",
"(",
")",
",",
"jcrURL",
".",
"getPath",
"(",
")",
",",
"true",
")",
";",
"}"... | Reconstructs URL and points browser to the requested node path. | [
"Reconstructs",
"URL",
"and",
"points",
"browser",
"to",
"the",
"requested",
"node",
"path",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/web/modeshape-web-explorer/src/main/java/org/modeshape/web/client/Console.java#L106-L108 | train |
ModeShape/modeshape | web/modeshape-web-explorer/src/main/java/org/modeshape/web/client/Console.java | Console.showMainForm | public void showMainForm(String userName) {
align();
changeUserName(userName);
mainForm.addMember(header);
mainForm.addMember(repositoryHeader);
mainForm.addMember(viewPort);
mainForm.addMember(strut(30));
mainForm.addMember(footer);
setLayou... | java | public void showMainForm(String userName) {
align();
changeUserName(userName);
mainForm.addMember(header);
mainForm.addMember(repositoryHeader);
mainForm.addMember(viewPort);
mainForm.addMember(strut(30));
mainForm.addMember(footer);
setLayou... | [
"public",
"void",
"showMainForm",
"(",
"String",
"userName",
")",
"{",
"align",
"(",
")",
";",
"changeUserName",
"(",
"userName",
")",
";",
"mainForm",
".",
"addMember",
"(",
"header",
")",
";",
"mainForm",
".",
"addMember",
"(",
"repositoryHeader",
")",
"... | Shows main page for the logged in user.
@param userName the name of the user. | [
"Shows",
"main",
"page",
"for",
"the",
"logged",
"in",
"user",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/web/modeshape-web-explorer/src/main/java/org/modeshape/web/client/Console.java#L133-L149 | train |
ModeShape/modeshape | web/modeshape-web-explorer/src/main/java/org/modeshape/web/client/Console.java | Console.changeRepositoryInURL | public void changeRepositoryInURL(String name, boolean changeHistory) {
jcrURL.setRepository(name);
if (changeHistory) {
htmlHistory.newItem(jcrURL.toString(), false);
}
} | java | public void changeRepositoryInURL(String name, boolean changeHistory) {
jcrURL.setRepository(name);
if (changeHistory) {
htmlHistory.newItem(jcrURL.toString(), false);
}
} | [
"public",
"void",
"changeRepositoryInURL",
"(",
"String",
"name",
",",
"boolean",
"changeHistory",
")",
"{",
"jcrURL",
".",
"setRepository",
"(",
"name",
")",
";",
"if",
"(",
"changeHistory",
")",
"{",
"htmlHistory",
".",
"newItem",
"(",
"jcrURL",
".",
"toSt... | Changes repository name in URL displayed by browser.
@param name the name of the repository.
@param changeHistory if true store URL changes in history. | [
"Changes",
"repository",
"name",
"in",
"URL",
"displayed",
"by",
"browser",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/web/modeshape-web-explorer/src/main/java/org/modeshape/web/client/Console.java#L250-L255 | train |
ModeShape/modeshape | web/modeshape-web-explorer/src/main/java/org/modeshape/web/client/Console.java | Console.changeWorkspaceInURL | public void changeWorkspaceInURL(String name, boolean changeHistory) {
jcrURL.setWorkspace(name);
if (changeHistory) {
htmlHistory.newItem(jcrURL.toString(), false);
}
} | java | public void changeWorkspaceInURL(String name, boolean changeHistory) {
jcrURL.setWorkspace(name);
if (changeHistory) {
htmlHistory.newItem(jcrURL.toString(), false);
}
} | [
"public",
"void",
"changeWorkspaceInURL",
"(",
"String",
"name",
",",
"boolean",
"changeHistory",
")",
"{",
"jcrURL",
".",
"setWorkspace",
"(",
"name",
")",
";",
"if",
"(",
"changeHistory",
")",
"{",
"htmlHistory",
".",
"newItem",
"(",
"jcrURL",
".",
"toStri... | Changes workspace in the URL displayed by browser.
@param name the name of the repository.
@param changeHistory if true store URL changes in browser's history. | [
"Changes",
"workspace",
"in",
"the",
"URL",
"displayed",
"by",
"browser",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/web/modeshape-web-explorer/src/main/java/org/modeshape/web/client/Console.java#L263-L268 | train |
ModeShape/modeshape | web/modeshape-web-explorer/src/main/java/org/modeshape/web/client/Console.java | Console.changePathInURL | public void changePathInURL(String path, boolean changeHistory) {
jcrURL.setPath(path);
if (changeHistory) {
htmlHistory.newItem(jcrURL.toString(), false);
}
} | java | public void changePathInURL(String path, boolean changeHistory) {
jcrURL.setPath(path);
if (changeHistory) {
htmlHistory.newItem(jcrURL.toString(), false);
}
} | [
"public",
"void",
"changePathInURL",
"(",
"String",
"path",
",",
"boolean",
"changeHistory",
")",
"{",
"jcrURL",
".",
"setPath",
"(",
"path",
")",
";",
"if",
"(",
"changeHistory",
")",
"{",
"htmlHistory",
".",
"newItem",
"(",
"jcrURL",
".",
"toString",
"("... | Changes node path in the URL displayed by browser.
@param path the path to the node.
@param changeHistory if true store URL changes in browser's history. | [
"Changes",
"node",
"path",
"in",
"the",
"URL",
"displayed",
"by",
"browser",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/web/modeshape-web-explorer/src/main/java/org/modeshape/web/client/Console.java#L276-L281 | train |
ModeShape/modeshape | web/modeshape-web-explorer/src/main/java/org/modeshape/web/client/Console.java | Console.showRepositories | public void showRepositories(Collection<RepositoryName> names) {
repositoriesList.show(names);
display(repositoriesList);
this.hideRepository();
} | java | public void showRepositories(Collection<RepositoryName> names) {
repositoriesList.show(names);
display(repositoriesList);
this.hideRepository();
} | [
"public",
"void",
"showRepositories",
"(",
"Collection",
"<",
"RepositoryName",
">",
"names",
")",
"{",
"repositoriesList",
".",
"show",
"(",
"names",
")",
";",
"display",
"(",
"repositoriesList",
")",
";",
"this",
".",
"hideRepository",
"(",
")",
";",
"}"
] | Displays list of availables repositories.
@param names names of repositories. | [
"Displays",
"list",
"of",
"availables",
"repositories",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/web/modeshape-web-explorer/src/main/java/org/modeshape/web/client/Console.java#L294-L298 | train |
ModeShape/modeshape | web/modeshape-web-explorer/src/main/java/org/modeshape/web/client/Console.java | Console.displayContent | public void displayContent(String repository, String workspace, String path,
boolean changeHistory) {
contents.show(repository, workspace, path, changeHistory);
displayRepository(repository);
display(contents);
changeRepositoryInURL(repository, changeHistory);
} | java | public void displayContent(String repository, String workspace, String path,
boolean changeHistory) {
contents.show(repository, workspace, path, changeHistory);
displayRepository(repository);
display(contents);
changeRepositoryInURL(repository, changeHistory);
} | [
"public",
"void",
"displayContent",
"(",
"String",
"repository",
",",
"String",
"workspace",
",",
"String",
"path",
",",
"boolean",
"changeHistory",
")",
"{",
"contents",
".",
"show",
"(",
"repository",
",",
"workspace",
",",
"path",
",",
"changeHistory",
")",... | Displays node for the given repository, workspace and path.
@param repository the name of the repository.
@param workspace the name of workspace.
@param path the path to the node.
@param changeHistory store changes in browser history. | [
"Displays",
"node",
"for",
"the",
"given",
"repository",
"workspace",
"and",
"path",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/web/modeshape-web-explorer/src/main/java/org/modeshape/web/client/Console.java#L308-L314 | train |
ModeShape/modeshape | modeshape-jcr-api/src/main/java/org/modeshape/jcr/api/JcrTools.java | JcrTools.removeAllChildren | public int removeAllChildren( Node node ) throws RepositoryException {
isNotNull(node, "node");
int childrenRemoved = 0;
NodeIterator iter = node.getNodes();
while (iter.hasNext()) {
Node child = iter.nextNode();
child.remove();
++childrenRemoved;
... | java | public int removeAllChildren( Node node ) throws RepositoryException {
isNotNull(node, "node");
int childrenRemoved = 0;
NodeIterator iter = node.getNodes();
while (iter.hasNext()) {
Node child = iter.nextNode();
child.remove();
++childrenRemoved;
... | [
"public",
"int",
"removeAllChildren",
"(",
"Node",
"node",
")",
"throws",
"RepositoryException",
"{",
"isNotNull",
"(",
"node",
",",
"\"node\"",
")",
";",
"int",
"childrenRemoved",
"=",
"0",
";",
"NodeIterator",
"iter",
"=",
"node",
".",
"getNodes",
"(",
")"... | Remove all children from the specified node
@param node
@return the number of children removed.
@throws RepositoryException
@throws IllegalArgumentException if the node argument is null | [
"Remove",
"all",
"children",
"from",
"the",
"specified",
"node"
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr-api/src/main/java/org/modeshape/jcr/api/JcrTools.java#L77-L87 | train |
ModeShape/modeshape | modeshape-jcr-api/src/main/java/org/modeshape/jcr/api/JcrTools.java | JcrTools.getNode | public Node getNode( Node node,
String relativePath,
boolean required ) throws RepositoryException {
isNotNull(node, "node");
isNotNull(relativePath, "relativePath");
Node result = null;
try {
result = node.getNode(relativePat... | java | public Node getNode( Node node,
String relativePath,
boolean required ) throws RepositoryException {
isNotNull(node, "node");
isNotNull(relativePath, "relativePath");
Node result = null;
try {
result = node.getNode(relativePat... | [
"public",
"Node",
"getNode",
"(",
"Node",
"node",
",",
"String",
"relativePath",
",",
"boolean",
"required",
")",
"throws",
"RepositoryException",
"{",
"isNotNull",
"(",
"node",
",",
"\"node\"",
")",
";",
"isNotNull",
"(",
"relativePath",
",",
"\"relativePath\""... | Get the node under a specified node at a location defined by the specified relative path. If node is required, then a
problem is created and added to the Problems list.
@param node a parent node from which to obtain a node relative to. may not be null
@param relativePath the path of the desired node. may not be null
@... | [
"Get",
"the",
"node",
"under",
"a",
"specified",
"node",
"at",
"a",
"location",
"defined",
"by",
"the",
"specified",
"relative",
"path",
".",
"If",
"node",
"is",
"required",
"then",
"a",
"problem",
"is",
"created",
"and",
"added",
"to",
"the",
"Problems",
... | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr-api/src/main/java/org/modeshape/jcr/api/JcrTools.java#L111-L126 | train |
ModeShape/modeshape | modeshape-jcr-api/src/main/java/org/modeshape/jcr/api/JcrTools.java | JcrTools.getReadable | public String getReadable( Node node ) {
if (node == null) return "";
try {
return node.getPath();
} catch (RepositoryException err) {
return node.toString();
}
} | java | public String getReadable( Node node ) {
if (node == null) return "";
try {
return node.getPath();
} catch (RepositoryException err) {
return node.toString();
}
} | [
"public",
"String",
"getReadable",
"(",
"Node",
"node",
")",
"{",
"if",
"(",
"node",
"==",
"null",
")",
"return",
"\"\"",
";",
"try",
"{",
"return",
"node",
".",
"getPath",
"(",
")",
";",
"}",
"catch",
"(",
"RepositoryException",
"err",
")",
"{",
"re... | Get the readable string form for a specified node.
@param node the node to obtain the readable string form. may be null
@return the readable string form for a specified node. | [
"Get",
"the",
"readable",
"string",
"form",
"for",
"a",
"specified",
"node",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr-api/src/main/java/org/modeshape/jcr/api/JcrTools.java#L134-L141 | train |
ModeShape/modeshape | modeshape-jcr-api/src/main/java/org/modeshape/jcr/api/JcrTools.java | JcrTools.findOrCreateNode | public Node findOrCreateNode( Session session,
String path,
String nodeType ) throws RepositoryException {
return findOrCreateNode(session, path, nodeType, nodeType);
} | java | public Node findOrCreateNode( Session session,
String path,
String nodeType ) throws RepositoryException {
return findOrCreateNode(session, path, nodeType, nodeType);
} | [
"public",
"Node",
"findOrCreateNode",
"(",
"Session",
"session",
",",
"String",
"path",
",",
"String",
"nodeType",
")",
"throws",
"RepositoryException",
"{",
"return",
"findOrCreateNode",
"(",
"session",
",",
"path",
",",
"nodeType",
",",
"nodeType",
")",
";",
... | Get or create a node at the specified path and node type.
@param session the JCR session. may not be null
@param path the path of the desired node to be found or created. may not be null
@param nodeType the node type. may be null
@return the existing or newly created node
@throws RepositoryException
@throws IllegalArg... | [
"Get",
"or",
"create",
"a",
"node",
"at",
"the",
"specified",
"path",
"and",
"node",
"type",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr-api/src/main/java/org/modeshape/jcr/api/JcrTools.java#L354-L358 | train |
ModeShape/modeshape | modeshape-jcr-api/src/main/java/org/modeshape/jcr/api/JcrTools.java | JcrTools.findOrCreateChild | public Node findOrCreateChild( Node parent,
String name ) throws RepositoryException {
return findOrCreateChild(parent, name, null);
} | java | public Node findOrCreateChild( Node parent,
String name ) throws RepositoryException {
return findOrCreateChild(parent, name, null);
} | [
"public",
"Node",
"findOrCreateChild",
"(",
"Node",
"parent",
",",
"String",
"name",
")",
"throws",
"RepositoryException",
"{",
"return",
"findOrCreateChild",
"(",
"parent",
",",
"name",
",",
"null",
")",
";",
"}"
] | Get or create a node with the specified node under the specified parent node.
@param parent the parent node. may not be null
@param name the name of the child node. may not be null
@return the existing or newly created child node
@throws RepositoryException
@throws IllegalArgumentException if either the parent or name... | [
"Get",
"or",
"create",
"a",
"node",
"with",
"the",
"specified",
"node",
"under",
"the",
"specified",
"parent",
"node",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr-api/src/main/java/org/modeshape/jcr/api/JcrTools.java#L460-L463 | train |
ModeShape/modeshape | modeshape-jcr-api/src/main/java/org/modeshape/jcr/api/JcrTools.java | JcrTools.findOrCreateChild | public Node findOrCreateChild( Node parent,
String name,
String nodeType ) throws RepositoryException {
return findOrCreateNode(parent, name, nodeType, nodeType);
} | java | public Node findOrCreateChild( Node parent,
String name,
String nodeType ) throws RepositoryException {
return findOrCreateNode(parent, name, nodeType, nodeType);
} | [
"public",
"Node",
"findOrCreateChild",
"(",
"Node",
"parent",
",",
"String",
"name",
",",
"String",
"nodeType",
")",
"throws",
"RepositoryException",
"{",
"return",
"findOrCreateNode",
"(",
"parent",
",",
"name",
",",
"nodeType",
",",
"nodeType",
")",
";",
"}"... | Get or create a node with the specified node and node type under the specified parent node.
@param parent the parent node. may not be null
@param name the name of the child node. may not be null
@param nodeType the node type. may be null
@return the existing or newly created child node
@throws RepositoryException | [
"Get",
"or",
"create",
"a",
"node",
"with",
"the",
"specified",
"node",
"and",
"node",
"type",
"under",
"the",
"specified",
"parent",
"node",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr-api/src/main/java/org/modeshape/jcr/api/JcrTools.java#L474-L478 | train |
ModeShape/modeshape | modeshape-jcr-api/src/main/java/org/modeshape/jcr/api/JcrTools.java | JcrTools.onEachNode | public void onEachNode( Session session,
boolean includeSystemNodes,
NodeOperation operation ) throws Exception {
Node node = session.getRootNode();
operation.run(node);
NodeIterator iter = node.getNodes();
while (iter.hasNext()) {
... | java | public void onEachNode( Session session,
boolean includeSystemNodes,
NodeOperation operation ) throws Exception {
Node node = session.getRootNode();
operation.run(node);
NodeIterator iter = node.getNodes();
while (iter.hasNext()) {
... | [
"public",
"void",
"onEachNode",
"(",
"Session",
"session",
",",
"boolean",
"includeSystemNodes",
",",
"NodeOperation",
"operation",
")",
"throws",
"Exception",
"{",
"Node",
"node",
"=",
"session",
".",
"getRootNode",
"(",
")",
";",
"operation",
".",
"run",
"("... | Execute the supplied operation on each node in the workspace accessible by the supplied session.
@param session the session
@param includeSystemNodes true if all nodes under "/jcr:system" should be included, or false if the system nodes should be
excluded
@param operation the operation
@throws Exception the exception ... | [
"Execute",
"the",
"supplied",
"operation",
"on",
"each",
"node",
"in",
"the",
"workspace",
"accessible",
"by",
"the",
"supplied",
"session",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr-api/src/main/java/org/modeshape/jcr/api/JcrTools.java#L865-L877 | train |
ModeShape/modeshape | sequencers/modeshape-sequencer-ddl/src/main/java/org/modeshape/sequencer/ddl/node/AstNodeFactory.java | AstNodeFactory.getChildrenForType | public List<AstNode> getChildrenForType( AstNode astNode,
String nodeType ) {
CheckArg.isNotNull(astNode, "astNode");
CheckArg.isNotNull(nodeType, "nodeType");
List<AstNode> childrenOfType = new ArrayList<AstNode>();
for (AstNode child : astN... | java | public List<AstNode> getChildrenForType( AstNode astNode,
String nodeType ) {
CheckArg.isNotNull(astNode, "astNode");
CheckArg.isNotNull(nodeType, "nodeType");
List<AstNode> childrenOfType = new ArrayList<AstNode>();
for (AstNode child : astN... | [
"public",
"List",
"<",
"AstNode",
">",
"getChildrenForType",
"(",
"AstNode",
"astNode",
",",
"String",
"nodeType",
")",
"{",
"CheckArg",
".",
"isNotNull",
"(",
"astNode",
",",
"\"astNode\"",
")",
";",
"CheckArg",
".",
"isNotNull",
"(",
"nodeType",
",",
"\"no... | Utility method to obtain the children of a given node that match the given type
@param astNode the parent node; may not be null
@param nodeType the type property of the target child node; may not be null
@return the list of typed nodes (may be empty) | [
"Utility",
"method",
"to",
"obtain",
"the",
"children",
"of",
"a",
"given",
"node",
"that",
"match",
"the",
"given",
"type"
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/sequencers/modeshape-sequencer-ddl/src/main/java/org/modeshape/sequencer/ddl/node/AstNodeFactory.java#L105-L120 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/SequencingRunner.java | SequencingRunner.findOutputNodes | private List<AbstractJcrNode> findOutputNodes( AbstractJcrNode rootOutputNode ) throws RepositoryException {
if (rootOutputNode.isNew()) {
return Arrays.asList(rootOutputNode);
}
// if the node was not new, we need to find the new sequenced nodes
List<AbstractJcrNode> nodes ... | java | private List<AbstractJcrNode> findOutputNodes( AbstractJcrNode rootOutputNode ) throws RepositoryException {
if (rootOutputNode.isNew()) {
return Arrays.asList(rootOutputNode);
}
// if the node was not new, we need to find the new sequenced nodes
List<AbstractJcrNode> nodes ... | [
"private",
"List",
"<",
"AbstractJcrNode",
">",
"findOutputNodes",
"(",
"AbstractJcrNode",
"rootOutputNode",
")",
"throws",
"RepositoryException",
"{",
"if",
"(",
"rootOutputNode",
".",
"isNew",
"(",
")",
")",
"{",
"return",
"Arrays",
".",
"asList",
"(",
"rootOu... | Finds the top nodes which have been created during the sequencing process, based on the original output node. It is
important that this is called before the session is saved, because it uses the new flag.
@param rootOutputNode the node under which the output of the sequencing process was written to.
@return the first ... | [
"Finds",
"the",
"top",
"nodes",
"which",
"have",
"been",
"created",
"during",
"the",
"sequencing",
"process",
"based",
"on",
"the",
"original",
"output",
"node",
".",
"It",
"is",
"important",
"that",
"this",
"is",
"called",
"before",
"the",
"session",
"is",
... | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/SequencingRunner.java#L365-L380 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/SequencingRunner.java | SequencingRunner.removeExistingOutputNodes | private void removeExistingOutputNodes( AbstractJcrNode parentOfOutput,
String outputNodeName,
String selectedPath,
String logMsg ) throws RepositoryException {
// Determine if the... | java | private void removeExistingOutputNodes( AbstractJcrNode parentOfOutput,
String outputNodeName,
String selectedPath,
String logMsg ) throws RepositoryException {
// Determine if the... | [
"private",
"void",
"removeExistingOutputNodes",
"(",
"AbstractJcrNode",
"parentOfOutput",
",",
"String",
"outputNodeName",
",",
"String",
"selectedPath",
",",
"String",
"logMsg",
")",
"throws",
"RepositoryException",
"{",
"// Determine if there is an existing output node ...",
... | Remove any existing nodes that were generated by previous sequencing operations of the node at the selected path.
@param parentOfOutput the parent of the output; may not be null
@param outputNodeName the name of the output node; may not be null or empty
@param selectedPath the path of the node that was selected for se... | [
"Remove",
"any",
"existing",
"nodes",
"that",
"were",
"generated",
"by",
"previous",
"sequencing",
"operations",
"of",
"the",
"node",
"at",
"the",
"selected",
"path",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/SequencingRunner.java#L412-L437 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/value/binary/CassandraBinaryStore.java | CassandraBinaryStore.contentExists | private boolean contentExists( BinaryKey key,
boolean alive ) throws BinaryStoreException {
try {
String query = "SELECT payload from modeshape.binary where cid='" + key.toString() + "'";
query = alive ? query + " and usage=1;" : query + " and usage = 0... | java | private boolean contentExists( BinaryKey key,
boolean alive ) throws BinaryStoreException {
try {
String query = "SELECT payload from modeshape.binary where cid='" + key.toString() + "'";
query = alive ? query + " and usage=1;" : query + " and usage = 0... | [
"private",
"boolean",
"contentExists",
"(",
"BinaryKey",
"key",
",",
"boolean",
"alive",
")",
"throws",
"BinaryStoreException",
"{",
"try",
"{",
"String",
"query",
"=",
"\"SELECT payload from modeshape.binary where cid='\"",
"+",
"key",
".",
"toString",
"(",
")",
"+... | Test content for existence.
@param key content identifier
@param alive true inside used content and false for checking within content marked as unused.
@return true if content found
@throws BinaryStoreException | [
"Test",
"content",
"for",
"existence",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/value/binary/CassandraBinaryStore.java#L298-L308 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/value/binary/CassandraBinaryStore.java | CassandraBinaryStore.buffer | private ByteBuffer buffer( InputStream stream ) throws IOException {
stream.reset();
ByteArrayOutputStream bout = new ByteArrayOutputStream();
IoUtil.write(stream, bout);
return ByteBuffer.wrap(bout.toByteArray());
} | java | private ByteBuffer buffer( InputStream stream ) throws IOException {
stream.reset();
ByteArrayOutputStream bout = new ByteArrayOutputStream();
IoUtil.write(stream, bout);
return ByteBuffer.wrap(bout.toByteArray());
} | [
"private",
"ByteBuffer",
"buffer",
"(",
"InputStream",
"stream",
")",
"throws",
"IOException",
"{",
"stream",
".",
"reset",
"(",
")",
";",
"ByteArrayOutputStream",
"bout",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"IoUtil",
".",
"write",
"(",
"stream... | Converts input stream into ByteBuffer.
@param stream
@return the byte buffer
@throws IOException | [
"Converts",
"input",
"stream",
"into",
"ByteBuffer",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/value/binary/CassandraBinaryStore.java#L317-L322 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/model/Visitors.java | Visitors.getSelectorAliasesByName | public static Map<SelectorName, SelectorName> getSelectorAliasesByName( Visitable visitable ) {
// Find all of the selectors that have aliases ...
final Map<SelectorName, SelectorName> result = new HashMap<SelectorName, SelectorName>();
Visitors.visitAll(visitable, new Visitors.AbstractVisitor()... | java | public static Map<SelectorName, SelectorName> getSelectorAliasesByName( Visitable visitable ) {
// Find all of the selectors that have aliases ...
final Map<SelectorName, SelectorName> result = new HashMap<SelectorName, SelectorName>();
Visitors.visitAll(visitable, new Visitors.AbstractVisitor()... | [
"public",
"static",
"Map",
"<",
"SelectorName",
",",
"SelectorName",
">",
"getSelectorAliasesByName",
"(",
"Visitable",
"visitable",
")",
"{",
"// Find all of the selectors that have aliases ...",
"final",
"Map",
"<",
"SelectorName",
",",
"SelectorName",
">",
"result",
... | Get a map of the selector aliases keyed by their names.
@param visitable the object to be visited
@return the map from the selector names to their alias (or name if there is no alias); never null but possibly empty | [
"Get",
"a",
"map",
"of",
"the",
"selector",
"aliases",
"keyed",
"by",
"their",
"names",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/model/Visitors.java#L222-L241 | train |
ModeShape/modeshape | sequencers/modeshape-sequencer-images/src/main/java/org/modeshape/sequencer/image/ImageMetadata.java | ImageMetadata.getComment | public String getComment( int index ) {
if (comments == null || index < 0 || index >= comments.size()) {
throw new IllegalArgumentException("Not a valid comment index: " + index);
}
return comments.elementAt(index);
} | java | public String getComment( int index ) {
if (comments == null || index < 0 || index >= comments.size()) {
throw new IllegalArgumentException("Not a valid comment index: " + index);
}
return comments.elementAt(index);
} | [
"public",
"String",
"getComment",
"(",
"int",
"index",
")",
"{",
"if",
"(",
"comments",
"==",
"null",
"||",
"index",
"<",
"0",
"||",
"index",
">=",
"comments",
".",
"size",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Not a val... | Returns the index'th comment retrieved from the file.
@param index int index of comment to return
@return the comment at the supplied index
@throws IllegalArgumentException if index is smaller than 0 or larger than or equal to the number of comments retrieved
@see #getNumberOfComments | [
"Returns",
"the",
"index",
"th",
"comment",
"retrieved",
"from",
"the",
"file",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/sequencers/modeshape-sequencer-images/src/main/java/org/modeshape/sequencer/image/ImageMetadata.java#L717-L722 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/security/acl/AccessControlEntryImpl.java | AccessControlEntryImpl.hasPrivileges | protected boolean hasPrivileges( Privilege[] privileges ) {
for (Privilege p : privileges) {
if (!contains(this.privileges, p)) {
return false;
}
}
return true;
} | java | protected boolean hasPrivileges( Privilege[] privileges ) {
for (Privilege p : privileges) {
if (!contains(this.privileges, p)) {
return false;
}
}
return true;
} | [
"protected",
"boolean",
"hasPrivileges",
"(",
"Privilege",
"[",
"]",
"privileges",
")",
"{",
"for",
"(",
"Privilege",
"p",
":",
"privileges",
")",
"{",
"if",
"(",
"!",
"contains",
"(",
"this",
".",
"privileges",
",",
"p",
")",
")",
"{",
"return",
"fals... | Tests given privileges.
@param privileges privileges for testing.
@return true if this entry contains all given privileges | [
"Tests",
"given",
"privileges",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/security/acl/AccessControlEntryImpl.java#L72-L79 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/security/acl/AccessControlEntryImpl.java | AccessControlEntryImpl.addIfNotPresent | protected boolean addIfNotPresent( Privilege[] privileges ) {
ArrayList<Privilege> list = new ArrayList<Privilege>();
Collections.addAll(list, privileges);
boolean res = combineRecursively(list, privileges);
this.privileges.addAll(list);
return res;
} | java | protected boolean addIfNotPresent( Privilege[] privileges ) {
ArrayList<Privilege> list = new ArrayList<Privilege>();
Collections.addAll(list, privileges);
boolean res = combineRecursively(list, privileges);
this.privileges.addAll(list);
return res;
} | [
"protected",
"boolean",
"addIfNotPresent",
"(",
"Privilege",
"[",
"]",
"privileges",
")",
"{",
"ArrayList",
"<",
"Privilege",
">",
"list",
"=",
"new",
"ArrayList",
"<",
"Privilege",
">",
"(",
")",
";",
"Collections",
".",
"addAll",
"(",
"list",
",",
"privi... | Adds specified privileges to this entry.
@param privileges privileges to add.
@return true if at least one of privileges was added. | [
"Adds",
"specified",
"privileges",
"to",
"this",
"entry",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/security/acl/AccessControlEntryImpl.java#L97-L105 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/security/acl/AccessControlEntryImpl.java | AccessControlEntryImpl.combineRecursively | protected boolean combineRecursively( List<Privilege> list,
Privilege[] privileges ) {
boolean res = false;
for (Privilege p : privileges) {
if (p.isAggregate()) {
res = combineRecursively(list, p.getAggregatePrivileges());
... | java | protected boolean combineRecursively( List<Privilege> list,
Privilege[] privileges ) {
boolean res = false;
for (Privilege p : privileges) {
if (p.isAggregate()) {
res = combineRecursively(list, p.getAggregatePrivileges());
... | [
"protected",
"boolean",
"combineRecursively",
"(",
"List",
"<",
"Privilege",
">",
"list",
",",
"Privilege",
"[",
"]",
"privileges",
")",
"{",
"boolean",
"res",
"=",
"false",
";",
"for",
"(",
"Privilege",
"p",
":",
"privileges",
")",
"{",
"if",
"(",
"p",
... | Adds specified privileges to the given list.
@param list the result list of combined privileges.
@param privileges privileges to add.
@return true if at least one of privileges was added. | [
"Adds",
"specified",
"privileges",
"to",
"the",
"given",
"list",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/security/acl/AccessControlEntryImpl.java#L114-L127 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/engine/ScanningQueryEngine.java | ScanningQueryEngine.createNodeSequenceForSource | protected NodeSequence createNodeSequenceForSource( QueryCommand originalQuery,
QueryContext context,
PlanNode sourceNode,
Columns columns,
... | java | protected NodeSequence createNodeSequenceForSource( QueryCommand originalQuery,
QueryContext context,
PlanNode sourceNode,
Columns columns,
... | [
"protected",
"NodeSequence",
"createNodeSequenceForSource",
"(",
"QueryCommand",
"originalQuery",
",",
"QueryContext",
"context",
",",
"PlanNode",
"sourceNode",
",",
"Columns",
"columns",
",",
"QuerySources",
"sources",
")",
"{",
"// The indexes should already be in the corre... | Create a node sequence for the given source.
@param originalQuery the original query command; may not be null
@param context the context in which the query is to be executed; may not be null
@param sourceNode the {@link Type#SOURCE} plan node for one part of a query; may not be null
@param columns the result column de... | [
"Create",
"a",
"node",
"sequence",
"for",
"the",
"given",
"source",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/engine/ScanningQueryEngine.java#L951-L973 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/engine/ScanningQueryEngine.java | ScanningQueryEngine.createNodeSequenceForSource | protected NodeSequence createNodeSequenceForSource( QueryCommand originalQuery,
QueryContext context,
PlanNode sourceNode,
IndexPlan index,
... | java | protected NodeSequence createNodeSequenceForSource( QueryCommand originalQuery,
QueryContext context,
PlanNode sourceNode,
IndexPlan index,
... | [
"protected",
"NodeSequence",
"createNodeSequenceForSource",
"(",
"QueryCommand",
"originalQuery",
",",
"QueryContext",
"context",
",",
"PlanNode",
"sourceNode",
",",
"IndexPlan",
"index",
",",
"Columns",
"columns",
",",
"QuerySources",
"sources",
")",
"{",
"if",
"(",
... | Create a node sequence for the given index
@param originalQuery the original query command; may not be null
@param context the context in which the query is to be executed; may not be null
@param sourceNode the {@link Type#SOURCE} plan node for one part of a query; may not be null
@param index the {@link IndexPlan} sp... | [
"Create",
"a",
"node",
"sequence",
"for",
"the",
"given",
"index"
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/engine/ScanningQueryEngine.java#L986-L1023 | train |
ModeShape/modeshape | web/modeshape-web-cmis/src/main/java/org/modeshape/cmis/JcrMsVersion.java | JcrMsVersion.getHash | private String getHash() {
try {
Node contentNode = getContextNode();
Property data = contentNode.getProperty(Property.JCR_DATA);
Binary bin = (Binary) data.getBinary();
return String.format("{%s}%s", HASH_ALGORITHM, bin.getHexHash());
} catch (RepositoryE... | java | private String getHash() {
try {
Node contentNode = getContextNode();
Property data = contentNode.getProperty(Property.JCR_DATA);
Binary bin = (Binary) data.getBinary();
return String.format("{%s}%s", HASH_ALGORITHM, bin.getHexHash());
} catch (RepositoryE... | [
"private",
"String",
"getHash",
"(",
")",
"{",
"try",
"{",
"Node",
"contentNode",
"=",
"getContextNode",
"(",
")",
";",
"Property",
"data",
"=",
"contentNode",
".",
"getProperty",
"(",
"Property",
".",
"JCR_DATA",
")",
";",
"Binary",
"bin",
"=",
"(",
"Bi... | Get the hexadecimal form of the SHA-1 hash of the contents.
@return the hexadecimal form of hash, or a null string if the hash could not be computed or is not known | [
"Get",
"the",
"hexadecimal",
"form",
"of",
"the",
"SHA",
"-",
"1",
"hash",
"of",
"the",
"contents",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/web/modeshape-web-cmis/src/main/java/org/modeshape/cmis/JcrMsVersion.java#L110-L119 | train |
ModeShape/modeshape | web/modeshape-web-explorer/src/main/java/org/modeshape/web/client/contents/WorkspacePanel.java | WorkspacePanel.setWorkspaceNames | public void setWorkspaceNames(String[] values) {
col2.combo.setValueMap(values);
if (values.length > 0) {
col2.combo.setValue(values[0]);
}
} | java | public void setWorkspaceNames(String[] values) {
col2.combo.setValueMap(values);
if (values.length > 0) {
col2.combo.setValue(values[0]);
}
} | [
"public",
"void",
"setWorkspaceNames",
"(",
"String",
"[",
"]",
"values",
")",
"{",
"col2",
".",
"combo",
".",
"setValueMap",
"(",
"values",
")",
";",
"if",
"(",
"values",
".",
"length",
">",
"0",
")",
"{",
"col2",
".",
"combo",
".",
"setValue",
"(",... | Assigns workspace names to the combo box into column 2.
@param values | [
"Assigns",
"workspace",
"names",
"to",
"the",
"combo",
"box",
"into",
"column",
"2",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/web/modeshape-web-explorer/src/main/java/org/modeshape/web/client/contents/WorkspacePanel.java#L85-L90 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/JcrVersionHistoryNode.java | JcrVersionHistoryNode.versionLabelsFor | private Set<String> versionLabelsFor( Version version ) throws RepositoryException {
if (!version.getParent().equals(this)) {
throw new VersionException(JcrI18n.invalidVersion.text(version.getPath(), getPath()));
}
String versionId = version.getIdentifier();
PropertyIterator... | java | private Set<String> versionLabelsFor( Version version ) throws RepositoryException {
if (!version.getParent().equals(this)) {
throw new VersionException(JcrI18n.invalidVersion.text(version.getPath(), getPath()));
}
String versionId = version.getIdentifier();
PropertyIterator... | [
"private",
"Set",
"<",
"String",
">",
"versionLabelsFor",
"(",
"Version",
"version",
")",
"throws",
"RepositoryException",
"{",
"if",
"(",
"!",
"version",
".",
"getParent",
"(",
")",
".",
"equals",
"(",
"this",
")",
")",
"{",
"throw",
"new",
"VersionExcept... | Returns the version labels that point to the given version
@param version the version for which the labels should be retrieved
@return the set of version labels for that version; never null
@throws RepositoryException if an error occurs accessing the repository | [
"Returns",
"the",
"version",
"labels",
"that",
"point",
"to",
"the",
"given",
"version"
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/JcrVersionHistoryNode.java#L136-L153 | train |
ModeShape/modeshape | modeshape-jca/src/main/java/org/modeshape/jca/JcrConnectionRequestInfo.java | JcrConnectionRequestInfo.computeCredsHashCode | private int computeCredsHashCode( Credentials c ) {
if (c instanceof SimpleCredentials) {
return computeSimpleCredsHashCode((SimpleCredentials)c);
}
return c.hashCode();
} | java | private int computeCredsHashCode( Credentials c ) {
if (c instanceof SimpleCredentials) {
return computeSimpleCredsHashCode((SimpleCredentials)c);
}
return c.hashCode();
} | [
"private",
"int",
"computeCredsHashCode",
"(",
"Credentials",
"c",
")",
"{",
"if",
"(",
"c",
"instanceof",
"SimpleCredentials",
")",
"{",
"return",
"computeSimpleCredsHashCode",
"(",
"(",
"SimpleCredentials",
")",
"c",
")",
";",
"}",
"return",
"c",
".",
"hashC... | Returns Credentials instance hash code. Handles instances of SimpleCredentials in a special way.
@param c the credentials
@return the hash code | [
"Returns",
"Credentials",
"instance",
"hash",
"code",
".",
"Handles",
"instances",
"of",
"SimpleCredentials",
"in",
"a",
"special",
"way",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jca/src/main/java/org/modeshape/jca/JcrConnectionRequestInfo.java#L197-L202 | train |
ModeShape/modeshape | sequencers/modeshape-sequencer-ddl/src/main/java/org/modeshape/sequencer/ddl/node/AstNode.java | AstNode.getSameNameSiblingIndex | public int getSameNameSiblingIndex() {
int snsIndex = 1;
if (this.parent == null) {
return snsIndex;
}
// Go through all the children ...
for (AstNode sibling : this.parent.getChildren()) {
if (sibling == this) {
break;
}
... | java | public int getSameNameSiblingIndex() {
int snsIndex = 1;
if (this.parent == null) {
return snsIndex;
}
// Go through all the children ...
for (AstNode sibling : this.parent.getChildren()) {
if (sibling == this) {
break;
}
... | [
"public",
"int",
"getSameNameSiblingIndex",
"(",
")",
"{",
"int",
"snsIndex",
"=",
"1",
";",
"if",
"(",
"this",
".",
"parent",
"==",
"null",
")",
"{",
"return",
"snsIndex",
";",
"}",
"// Go through all the children ...",
"for",
"(",
"AstNode",
"sibling",
":"... | Get the current same-name-sibling index.
@return the SNS index, or 1 if this is the first sibling with the same name | [
"Get",
"the",
"current",
"same",
"-",
"name",
"-",
"sibling",
"index",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/sequencers/modeshape-sequencer-ddl/src/main/java/org/modeshape/sequencer/ddl/node/AstNode.java#L114-L129 | train |
ModeShape/modeshape | sequencers/modeshape-sequencer-ddl/src/main/java/org/modeshape/sequencer/ddl/node/AstNode.java | AstNode.getAbsolutePath | public String getAbsolutePath() {
StringBuilder pathBuilder = new StringBuilder("/").append(this.getName());
AstNode parent = this.getParent();
while (parent != null) {
pathBuilder.insert(0, "/" + parent.getName());
parent = parent.getParent();
}
return pa... | java | public String getAbsolutePath() {
StringBuilder pathBuilder = new StringBuilder("/").append(this.getName());
AstNode parent = this.getParent();
while (parent != null) {
pathBuilder.insert(0, "/" + parent.getName());
parent = parent.getParent();
}
return pa... | [
"public",
"String",
"getAbsolutePath",
"(",
")",
"{",
"StringBuilder",
"pathBuilder",
"=",
"new",
"StringBuilder",
"(",
"\"/\"",
")",
".",
"append",
"(",
"this",
".",
"getName",
"(",
")",
")",
";",
"AstNode",
"parent",
"=",
"this",
".",
"getParent",
"(",
... | Get the current path of this node
@return the path of this node; never null | [
"Get",
"the",
"current",
"path",
"of",
"this",
"node"
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/sequencers/modeshape-sequencer-ddl/src/main/java/org/modeshape/sequencer/ddl/node/AstNode.java#L136-L144 | train |
ModeShape/modeshape | sequencers/modeshape-sequencer-ddl/src/main/java/org/modeshape/sequencer/ddl/node/AstNode.java | AstNode.setProperty | public AstNode setProperty( String name,
Object value ) {
CheckArg.isNotNull(name, "name");
CheckArg.isNotNull(value, "value");
properties.put(name, value);
return this;
} | java | public AstNode setProperty( String name,
Object value ) {
CheckArg.isNotNull(name, "name");
CheckArg.isNotNull(value, "value");
properties.put(name, value);
return this;
} | [
"public",
"AstNode",
"setProperty",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"CheckArg",
".",
"isNotNull",
"(",
"name",
",",
"\"name\"",
")",
";",
"CheckArg",
".",
"isNotNull",
"(",
"value",
",",
"\"value\"",
")",
";",
"properties",
".",
... | Set the property with the given name to the supplied value. Any existing property with the same name will be replaced.
@param name the name of the property; may not be null
@param value the value of the property; may not be null
@return this node, for method chaining purposes | [
"Set",
"the",
"property",
"with",
"the",
"given",
"name",
"to",
"the",
"supplied",
"value",
".",
"Any",
"existing",
"property",
"with",
"the",
"same",
"name",
"will",
"be",
"replaced",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/sequencers/modeshape-sequencer-ddl/src/main/java/org/modeshape/sequencer/ddl/node/AstNode.java#L163-L169 | train |
ModeShape/modeshape | sequencers/modeshape-sequencer-ddl/src/main/java/org/modeshape/sequencer/ddl/node/AstNode.java | AstNode.setProperty | public AstNode setProperty( String name,
Object... values ) {
CheckArg.isNotNull(name, "name");
CheckArg.isNotNull(values, "value");
if (values.length != 0) {
properties.put(name, Arrays.asList(values));
}
return this;
} | java | public AstNode setProperty( String name,
Object... values ) {
CheckArg.isNotNull(name, "name");
CheckArg.isNotNull(values, "value");
if (values.length != 0) {
properties.put(name, Arrays.asList(values));
}
return this;
} | [
"public",
"AstNode",
"setProperty",
"(",
"String",
"name",
",",
"Object",
"...",
"values",
")",
"{",
"CheckArg",
".",
"isNotNull",
"(",
"name",
",",
"\"name\"",
")",
";",
"CheckArg",
".",
"isNotNull",
"(",
"values",
",",
"\"value\"",
")",
";",
"if",
"(",... | Set the property with the given name to the supplied values. If there is at least one value, the new property will replace
any existing property with the same name. This method does nothing if zero values are supplied.
@param name the name of the property; may not be null
@param values the values of the property
@retu... | [
"Set",
"the",
"property",
"with",
"the",
"given",
"name",
"to",
"the",
"supplied",
"values",
".",
"If",
"there",
"is",
"at",
"least",
"one",
"value",
"the",
"new",
"property",
"will",
"replace",
"any",
"existing",
"property",
"with",
"the",
"same",
"name",... | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/sequencers/modeshape-sequencer-ddl/src/main/java/org/modeshape/sequencer/ddl/node/AstNode.java#L179-L187 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/parse/BasicSqlQueryParser.java | BasicSqlQueryParser.removeBracketsAndQuotes | protected String removeBracketsAndQuotes( String text,
Position position ) {
return removeBracketsAndQuotes(text, true, position);
} | java | protected String removeBracketsAndQuotes( String text,
Position position ) {
return removeBracketsAndQuotes(text, true, position);
} | [
"protected",
"String",
"removeBracketsAndQuotes",
"(",
"String",
"text",
",",
"Position",
"position",
")",
"{",
"return",
"removeBracketsAndQuotes",
"(",
"text",
",",
"true",
",",
"position",
")",
";",
"}"
] | Remove all leading and trailing single-quotes, double-quotes, or square brackets from the supplied text. If multiple,
properly-paired quotes or brackets are found, they will all be removed.
@param text the input text; may not be null
@param position the position of the text; may not be null
@return the text without le... | [
"Remove",
"all",
"leading",
"and",
"trailing",
"single",
"-",
"quotes",
"double",
"-",
"quotes",
"or",
"square",
"brackets",
"from",
"the",
"supplied",
"text",
".",
"If",
"multiple",
"properly",
"-",
"paired",
"quotes",
"or",
"brackets",
"are",
"found",
"the... | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/parse/BasicSqlQueryParser.java#L1353-L1356 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/parse/BasicSqlQueryParser.java | BasicSqlQueryParser.removeBracketsAndQuotes | protected String removeBracketsAndQuotes( String text,
boolean recursive,
Position position ) {
if (text.length() > 0) {
char firstChar = text.charAt(0);
switch (firstChar) {
case ... | java | protected String removeBracketsAndQuotes( String text,
boolean recursive,
Position position ) {
if (text.length() > 0) {
char firstChar = text.charAt(0);
switch (firstChar) {
case ... | [
"protected",
"String",
"removeBracketsAndQuotes",
"(",
"String",
"text",
",",
"boolean",
"recursive",
",",
"Position",
"position",
")",
"{",
"if",
"(",
"text",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"char",
"firstChar",
"=",
"text",
".",
"charAt",
... | Remove any leading and trailing single-quotes, double-quotes, or square brackets from the supplied text.
@param text the input text; may not be null
@param recursive true if more than one pair of quotes, double-quotes, or square brackets should be removed, or false if
just the first pair should be removed
@param posit... | [
"Remove",
"any",
"leading",
"and",
"trailing",
"single",
"-",
"quotes",
"double",
"-",
"quotes",
"or",
"square",
"brackets",
"from",
"the",
"supplied",
"text",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/parse/BasicSqlQueryParser.java#L1368-L1392 | train |
ModeShape/modeshape | web/modeshape-web-explorer/src/main/java/org/modeshape/web/server/JcrServiceImpl.java | JcrServiceImpl.propertyDefs | private String[] propertyDefs( Node node ) throws RepositoryException {
ArrayList<String> list = new ArrayList<>();
NodeType primaryType = node.getPrimaryNodeType();
PropertyDefinition[] defs = primaryType.getPropertyDefinitions();
for (PropertyDefinition def : defs) {
if (... | java | private String[] propertyDefs( Node node ) throws RepositoryException {
ArrayList<String> list = new ArrayList<>();
NodeType primaryType = node.getPrimaryNodeType();
PropertyDefinition[] defs = primaryType.getPropertyDefinitions();
for (PropertyDefinition def : defs) {
if (... | [
"private",
"String",
"[",
"]",
"propertyDefs",
"(",
"Node",
"node",
")",
"throws",
"RepositoryException",
"{",
"ArrayList",
"<",
"String",
">",
"list",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"NodeType",
"primaryType",
"=",
"node",
".",
"getPrimaryNode... | Gets the list of properties available to the given node.
@param node the node instance.
@return list of property names.
@throws RepositoryException | [
"Gets",
"the",
"list",
"of",
"properties",
"available",
"to",
"the",
"given",
"node",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/web/modeshape-web-explorer/src/main/java/org/modeshape/web/server/JcrServiceImpl.java#L272-L298 | train |
ModeShape/modeshape | web/modeshape-web-explorer/src/main/java/org/modeshape/web/server/JcrServiceImpl.java | JcrServiceImpl.findAccessList | private AccessControlList findAccessList( AccessControlManager acm,
String path ) throws RepositoryException {
AccessControlPolicy[] policy = acm.getPolicies(path);
if (policy != null && policy.length > 0) {
return (AccessControlList)policy[0];
... | java | private AccessControlList findAccessList( AccessControlManager acm,
String path ) throws RepositoryException {
AccessControlPolicy[] policy = acm.getPolicies(path);
if (policy != null && policy.length > 0) {
return (AccessControlList)policy[0];
... | [
"private",
"AccessControlList",
"findAccessList",
"(",
"AccessControlManager",
"acm",
",",
"String",
"path",
")",
"throws",
"RepositoryException",
"{",
"AccessControlPolicy",
"[",
"]",
"policy",
"=",
"acm",
".",
"getPolicies",
"(",
"path",
")",
";",
"if",
"(",
"... | Searches access list for the given node.
@param acm access manager
@param path the path to the node
@return access list representation.
@throws RepositoryException | [
"Searches",
"access",
"list",
"for",
"the",
"given",
"node",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/web/modeshape-web-explorer/src/main/java/org/modeshape/web/server/JcrServiceImpl.java#L335-L349 | train |
ModeShape/modeshape | web/modeshape-web-explorer/src/main/java/org/modeshape/web/server/JcrServiceImpl.java | JcrServiceImpl.getProperties | private Collection<JcrProperty> getProperties( String repository, String workspace, String path, Node node ) throws RepositoryException {
ArrayList<PropertyDefinition> names = new ArrayList<>();
NodeType primaryType = node.getPrimaryNodeType();
PropertyDefinition[] defs = primaryType.ge... | java | private Collection<JcrProperty> getProperties( String repository, String workspace, String path, Node node ) throws RepositoryException {
ArrayList<PropertyDefinition> names = new ArrayList<>();
NodeType primaryType = node.getPrimaryNodeType();
PropertyDefinition[] defs = primaryType.ge... | [
"private",
"Collection",
"<",
"JcrProperty",
">",
"getProperties",
"(",
"String",
"repository",
",",
"String",
"workspace",
",",
"String",
"path",
",",
"Node",
"node",
")",
"throws",
"RepositoryException",
"{",
"ArrayList",
"<",
"PropertyDefinition",
">",
"names",... | Reads properties of the given node.
@param repository the repository name
@param workspace the workspace name
@param path the path to the node
@param node the node instance
@return list of node's properties.
@throws RepositoryException | [
"Reads",
"properties",
"of",
"the",
"given",
"node",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/web/modeshape-web-explorer/src/main/java/org/modeshape/web/server/JcrServiceImpl.java#L361-L394 | train |
ModeShape/modeshape | web/modeshape-web-explorer/src/main/java/org/modeshape/web/server/JcrServiceImpl.java | JcrServiceImpl.values | private String values( PropertyDefinition pd, Property p ) throws RepositoryException {
if (p == null) {
return "N/A";
}
if (pd.getRequiredType() == PropertyType.BINARY) {
return "BINARY";
}
if (!p.isMultiple()) {
return p.get... | java | private String values( PropertyDefinition pd, Property p ) throws RepositoryException {
if (p == null) {
return "N/A";
}
if (pd.getRequiredType() == PropertyType.BINARY) {
return "BINARY";
}
if (!p.isMultiple()) {
return p.get... | [
"private",
"String",
"values",
"(",
"PropertyDefinition",
"pd",
",",
"Property",
"p",
")",
"throws",
"RepositoryException",
"{",
"if",
"(",
"p",
"==",
"null",
")",
"{",
"return",
"\"N/A\"",
";",
"}",
"if",
"(",
"pd",
".",
"getRequiredType",
"(",
")",
"==... | Displays property value as string
@param pd the property definition
@param p the property to display
@return property value as text string
@throws RepositoryException | [
"Displays",
"property",
"value",
"as",
"string"
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/web/modeshape-web-explorer/src/main/java/org/modeshape/web/server/JcrServiceImpl.java#L440-L454 | train |
ModeShape/modeshape | web/modeshape-web-explorer/src/main/java/org/modeshape/web/server/JcrServiceImpl.java | JcrServiceImpl.pick | private AccessControlEntry pick( AccessControlList acl,
String principal ) throws RepositoryException {
for (AccessControlEntry entry : acl.getAccessControlEntries()) {
if (entry.getPrincipal().getName().equals(principal)) {
return entry;
... | java | private AccessControlEntry pick( AccessControlList acl,
String principal ) throws RepositoryException {
for (AccessControlEntry entry : acl.getAccessControlEntries()) {
if (entry.getPrincipal().getName().equals(principal)) {
return entry;
... | [
"private",
"AccessControlEntry",
"pick",
"(",
"AccessControlList",
"acl",
",",
"String",
"principal",
")",
"throws",
"RepositoryException",
"{",
"for",
"(",
"AccessControlEntry",
"entry",
":",
"acl",
".",
"getAccessControlEntries",
"(",
")",
")",
"{",
"if",
"(",
... | Picks access entry for the given principal.
@param acl
@param principal
@return the ACL entry
@throws RepositoryException | [
"Picks",
"access",
"entry",
"for",
"the",
"given",
"principal",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/web/modeshape-web-explorer/src/main/java/org/modeshape/web/server/JcrServiceImpl.java#L852-L860 | train |
ModeShape/modeshape | web/modeshape-web-explorer/src/main/java/org/modeshape/web/server/JcrServiceImpl.java | JcrServiceImpl.excludePrivilege | private Privilege[] excludePrivilege( Privilege[] privileges,
JcrPermission permission ) {
ArrayList<Privilege> list = new ArrayList<>();
for (Privilege privilege : privileges) {
if (!privilege.getName().equalsIgnoreCase(permission.getName())) {
... | java | private Privilege[] excludePrivilege( Privilege[] privileges,
JcrPermission permission ) {
ArrayList<Privilege> list = new ArrayList<>();
for (Privilege privilege : privileges) {
if (!privilege.getName().equalsIgnoreCase(permission.getName())) {
... | [
"private",
"Privilege",
"[",
"]",
"excludePrivilege",
"(",
"Privilege",
"[",
"]",
"privileges",
",",
"JcrPermission",
"permission",
")",
"{",
"ArrayList",
"<",
"Privilege",
">",
"list",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"Privilege",
... | Excludes given privilege.
@param privileges
@param permission
@return the privileges | [
"Excludes",
"given",
"privilege",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/web/modeshape-web-explorer/src/main/java/org/modeshape/web/server/JcrServiceImpl.java#L869-L882 | train |
ModeShape/modeshape | web/modeshape-web-explorer/src/main/java/org/modeshape/web/server/JcrServiceImpl.java | JcrServiceImpl.includePrivilege | private Privilege[] includePrivilege( AccessControlManager acm,
Privilege[] privileges,
JcrPermission permission ) throws RepositoryException {
ArrayList<Privilege> list = new ArrayList<>();
for (Privilege privilege : p... | java | private Privilege[] includePrivilege( AccessControlManager acm,
Privilege[] privileges,
JcrPermission permission ) throws RepositoryException {
ArrayList<Privilege> list = new ArrayList<>();
for (Privilege privilege : p... | [
"private",
"Privilege",
"[",
"]",
"includePrivilege",
"(",
"AccessControlManager",
"acm",
",",
"Privilege",
"[",
"]",
"privileges",
",",
"JcrPermission",
"permission",
")",
"throws",
"RepositoryException",
"{",
"ArrayList",
"<",
"Privilege",
">",
"list",
"=",
"new... | Includes given privilege.
@param acm the access control manager
@param privileges
@param permission
@return the privileges
@throws RepositoryException | [
"Includes",
"given",
"privilege",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/web/modeshape-web-explorer/src/main/java/org/modeshape/web/server/JcrServiceImpl.java#L893-L908 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/value/binary/FileSystemBinaryStore.java | FileSystemBinaryStore.create | public static FileSystemBinaryStore create( File directory, File trash ) {
String key = directory.getAbsolutePath();
FileSystemBinaryStore store = INSTANCES.get(key);
if (store == null) {
store = trash != null ? new FileSystemBinaryStore(directory, trash) : new FileSystemBinaryStore(... | java | public static FileSystemBinaryStore create( File directory, File trash ) {
String key = directory.getAbsolutePath();
FileSystemBinaryStore store = INSTANCES.get(key);
if (store == null) {
store = trash != null ? new FileSystemBinaryStore(directory, trash) : new FileSystemBinaryStore(... | [
"public",
"static",
"FileSystemBinaryStore",
"create",
"(",
"File",
"directory",
",",
"File",
"trash",
")",
"{",
"String",
"key",
"=",
"directory",
".",
"getAbsolutePath",
"(",
")",
";",
"FileSystemBinaryStore",
"store",
"=",
"INSTANCES",
".",
"get",
"(",
"key... | Creates a new FS binary store instance
@param directory a {@link File} instance where the binary data will be stored; may not be {@code null}
@param trash a {@link File} instance where unused binary data is transferred to, until completely being removed from disk;
may be {@code null} in which case a default location w... | [
"Creates",
"a",
"new",
"FS",
"binary",
"store",
"instance"
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/value/binary/FileSystemBinaryStore.java#L70-L81 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/engine/process/RestartableSequence.java | RestartableSequence.loadRemaining | protected void loadRemaining() {
if (!loadedAll) {
// Put all of the batches from the sequence into the buffer
assert targetNumRowsInMemory >= 0L;
assert batchSize != null;
Batch batch = original.nextBatch();
boolean loadIntoMemory = inMemoryBatches !=... | java | protected void loadRemaining() {
if (!loadedAll) {
// Put all of the batches from the sequence into the buffer
assert targetNumRowsInMemory >= 0L;
assert batchSize != null;
Batch batch = original.nextBatch();
boolean loadIntoMemory = inMemoryBatches !=... | [
"protected",
"void",
"loadRemaining",
"(",
")",
"{",
"if",
"(",
"!",
"loadedAll",
")",
"{",
"// Put all of the batches from the sequence into the buffer",
"assert",
"targetNumRowsInMemory",
">=",
"0L",
";",
"assert",
"batchSize",
"!=",
"null",
";",
"Batch",
"batch",
... | Load all of the remaining rows from the supplied sequence into the buffer. | [
"Load",
"all",
"of",
"the",
"remaining",
"rows",
"from",
"the",
"supplied",
"sequence",
"into",
"the",
"buffer",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/engine/process/RestartableSequence.java#L180-L201 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/value/binary/CompositeBinaryStore.java | CompositeBinaryStore.moveValue | public BinaryKey moveValue( BinaryKey key,
String source,
String destination ) throws BinaryStoreException {
final BinaryStore sourceStore;
if (source == null) {
sourceStore = findBinaryStoreContainingKey(key);
} else {... | java | public BinaryKey moveValue( BinaryKey key,
String source,
String destination ) throws BinaryStoreException {
final BinaryStore sourceStore;
if (source == null) {
sourceStore = findBinaryStoreContainingKey(key);
} else {... | [
"public",
"BinaryKey",
"moveValue",
"(",
"BinaryKey",
"key",
",",
"String",
"source",
",",
"String",
"destination",
")",
"throws",
"BinaryStoreException",
"{",
"final",
"BinaryStore",
"sourceStore",
";",
"if",
"(",
"source",
"==",
"null",
")",
"{",
"sourceStore"... | Move a value from one named store to another store
@param key Binary key to transfer from the source store to the destination store
@param source a hint for discovering the source repository; may be null
@param destination a hint for discovering the destination repository
@return the {@link BinaryKey} value of the mov... | [
"Move",
"a",
"value",
"from",
"one",
"named",
"store",
"to",
"another",
"store"
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/value/binary/CompositeBinaryStore.java#L165-L192 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/value/binary/CompositeBinaryStore.java | CompositeBinaryStore.moveValue | public void moveValue( BinaryKey key,
String destination ) throws BinaryStoreException {
moveValue(key, null, destination);
} | java | public void moveValue( BinaryKey key,
String destination ) throws BinaryStoreException {
moveValue(key, null, destination);
} | [
"public",
"void",
"moveValue",
"(",
"BinaryKey",
"key",
",",
"String",
"destination",
")",
"throws",
"BinaryStoreException",
"{",
"moveValue",
"(",
"key",
",",
"null",
",",
"destination",
")",
";",
"}"
] | Move a BinaryKey to a named store
@param key Binary key to transfer from the source store to the destination store
@param destination a hint for discovering the destination repository
@throws BinaryStoreException if anything unexpected fails | [
"Move",
"a",
"BinaryKey",
"to",
"a",
"named",
"store"
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/value/binary/CompositeBinaryStore.java#L201-L204 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/value/binary/CompositeBinaryStore.java | CompositeBinaryStore.findBinaryStoreContainingKey | public BinaryStore findBinaryStoreContainingKey( BinaryKey key ) {
Iterator<Map.Entry<String, BinaryStore>> binaryStoreIterator = getNamedStoreIterator();
while (binaryStoreIterator.hasNext()) {
BinaryStore bs = binaryStoreIterator.next().getValue();
if (bs.hasBinary(key)) {
... | java | public BinaryStore findBinaryStoreContainingKey( BinaryKey key ) {
Iterator<Map.Entry<String, BinaryStore>> binaryStoreIterator = getNamedStoreIterator();
while (binaryStoreIterator.hasNext()) {
BinaryStore bs = binaryStoreIterator.next().getValue();
if (bs.hasBinary(key)) {
... | [
"public",
"BinaryStore",
"findBinaryStoreContainingKey",
"(",
"BinaryKey",
"key",
")",
"{",
"Iterator",
"<",
"Map",
".",
"Entry",
"<",
"String",
",",
"BinaryStore",
">",
">",
"binaryStoreIterator",
"=",
"getNamedStoreIterator",
"(",
")",
";",
"while",
"(",
"bina... | Get the named binary store that contains the key
@param key the key to the binary content; never null
@return the BinaryStore that contains the given key | [
"Get",
"the",
"named",
"binary",
"store",
"that",
"contains",
"the",
"key"
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/value/binary/CompositeBinaryStore.java#L398-L409 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/value/binary/CompositeBinaryStore.java | CompositeBinaryStore.selectBinaryStore | private BinaryStore selectBinaryStore( String hint ) {
BinaryStore namedBinaryStore = null;
if (hint != null) {
logger.trace("Selecting named binary store for hint: " + hint);
namedBinaryStore = namedStores.get(hint);
}
if (namedBinaryStore == null) {
... | java | private BinaryStore selectBinaryStore( String hint ) {
BinaryStore namedBinaryStore = null;
if (hint != null) {
logger.trace("Selecting named binary store for hint: " + hint);
namedBinaryStore = namedStores.get(hint);
}
if (namedBinaryStore == null) {
... | [
"private",
"BinaryStore",
"selectBinaryStore",
"(",
"String",
"hint",
")",
"{",
"BinaryStore",
"namedBinaryStore",
"=",
"null",
";",
"if",
"(",
"hint",
"!=",
"null",
")",
"{",
"logger",
".",
"trace",
"(",
"\"Selecting named binary store for hint: \"",
"+",
"hint",... | Select a named binary store for the given hint
@param hint a hint to a binary store; possibly null
@return a named BinaryStore from the hint, or the default store | [
"Select",
"a",
"named",
"binary",
"store",
"for",
"the",
"given",
"hint"
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/value/binary/CompositeBinaryStore.java#L417-L433 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/ModeShapeEngine.java | ModeShapeEngine.start | public void start() {
if (state == State.RUNNING) return;
final Lock lock = this.lock.writeLock();
try {
lock.lock();
this.state = State.STARTING;
// Create an executor service that we'll use to start the repositories ...
ThreadFactory threadFacto... | java | public void start() {
if (state == State.RUNNING) return;
final Lock lock = this.lock.writeLock();
try {
lock.lock();
this.state = State.STARTING;
// Create an executor service that we'll use to start the repositories ...
ThreadFactory threadFacto... | [
"public",
"void",
"start",
"(",
")",
"{",
"if",
"(",
"state",
"==",
"State",
".",
"RUNNING",
")",
"return",
";",
"final",
"Lock",
"lock",
"=",
"this",
".",
"lock",
".",
"writeLock",
"(",
")",
";",
"try",
"{",
"lock",
".",
"lock",
"(",
")",
";",
... | Start this engine to make it available for use. This method does nothing if the engine is already running.
@see #shutdown() | [
"Start",
"this",
"engine",
"to",
"make",
"it",
"available",
"for",
"use",
".",
"This",
"method",
"does",
"nothing",
"if",
"the",
"engine",
"is",
"already",
"running",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/ModeShapeEngine.java#L92-L110 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/ModeShapeEngine.java | ModeShapeEngine.shutdown | public Future<Boolean> shutdown( boolean forceShutdownOfAllRepositories ) {
if (!forceShutdownOfAllRepositories) {
// Check to see if there are any still running ...
final Lock lock = this.lock.readLock();
try {
lock.lock();
for (JcrRepository ... | java | public Future<Boolean> shutdown( boolean forceShutdownOfAllRepositories ) {
if (!forceShutdownOfAllRepositories) {
// Check to see if there are any still running ...
final Lock lock = this.lock.readLock();
try {
lock.lock();
for (JcrRepository ... | [
"public",
"Future",
"<",
"Boolean",
">",
"shutdown",
"(",
"boolean",
"forceShutdownOfAllRepositories",
")",
"{",
"if",
"(",
"!",
"forceShutdownOfAllRepositories",
")",
"{",
"// Check to see if there are any still running ...",
"final",
"Lock",
"lock",
"=",
"this",
".",
... | Shutdown this engine, optionally stopping all still-running repositories.
@param forceShutdownOfAllRepositories true if the engine should be shutdown even if there are currently-running
repositories, or false if the engine should not be shutdown if at least one repository is still running.
@return a future that allows... | [
"Shutdown",
"this",
"engine",
"optionally",
"stopping",
"all",
"still",
"-",
"running",
"repositories",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/ModeShapeEngine.java#L140-L173 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/ModeShapeEngine.java | ModeShapeEngine.doShutdown | protected boolean doShutdown() {
if (state == State.NOT_RUNNING) {
LOGGER.debug("Engine already shut down.");
return true;
}
LOGGER.debug("Shutting down engine...");
final Lock lock = this.lock.writeLock();
try {
lock.lock();
state ... | java | protected boolean doShutdown() {
if (state == State.NOT_RUNNING) {
LOGGER.debug("Engine already shut down.");
return true;
}
LOGGER.debug("Shutting down engine...");
final Lock lock = this.lock.writeLock();
try {
lock.lock();
state ... | [
"protected",
"boolean",
"doShutdown",
"(",
")",
"{",
"if",
"(",
"state",
"==",
"State",
".",
"NOT_RUNNING",
")",
"{",
"LOGGER",
".",
"debug",
"(",
"\"Engine already shut down.\"",
")",
";",
"return",
"true",
";",
"}",
"LOGGER",
".",
"debug",
"(",
"\"Shutti... | Do the work of shutting down this engine and its repositories.
@return true if the engine was shutdown (or was not running), and false if the engine is still running and could not be
shutdown | [
"Do",
"the",
"work",
"of",
"shutting",
"down",
"this",
"engine",
"and",
"its",
"repositories",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/ModeShapeEngine.java#L181-L236 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/ModeShapeEngine.java | ModeShapeEngine.getRepositories | public Map<String, State> getRepositories() {
checkRunning();
Map<String, State> results = new HashMap<String, State>();
final Lock lock = this.lock.readLock();
try {
lock.lock();
for (JcrRepository repository : repositories.values()) {
results.put... | java | public Map<String, State> getRepositories() {
checkRunning();
Map<String, State> results = new HashMap<String, State>();
final Lock lock = this.lock.readLock();
try {
lock.lock();
for (JcrRepository repository : repositories.values()) {
results.put... | [
"public",
"Map",
"<",
"String",
",",
"State",
">",
"getRepositories",
"(",
")",
"{",
"checkRunning",
"(",
")",
";",
"Map",
"<",
"String",
",",
"State",
">",
"results",
"=",
"new",
"HashMap",
"<",
"String",
",",
"State",
">",
"(",
")",
";",
"final",
... | Get an instantaneous snapshot of the JCR repositories and their state. Note that the results are accurate only when this
methods returns.
@return the immutable map of repository states keyed by repository names; never null | [
"Get",
"an",
"instantaneous",
"snapshot",
"of",
"the",
"JCR",
"repositories",
"and",
"their",
"state",
".",
"Note",
"that",
"the",
"results",
"are",
"accurate",
"only",
"when",
"this",
"methods",
"returns",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/ModeShapeEngine.java#L391-L404 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/ModeShapeEngine.java | ModeShapeEngine.repositories | protected Collection<JcrRepository> repositories() {
if (this.state == State.RUNNING) {
final Lock lock = this.lock.readLock();
try {
lock.lock();
return new ArrayList<JcrRepository>(repositories.values());
} finally {
lock.unlo... | java | protected Collection<JcrRepository> repositories() {
if (this.state == State.RUNNING) {
final Lock lock = this.lock.readLock();
try {
lock.lock();
return new ArrayList<JcrRepository>(repositories.values());
} finally {
lock.unlo... | [
"protected",
"Collection",
"<",
"JcrRepository",
">",
"repositories",
"(",
")",
"{",
"if",
"(",
"this",
".",
"state",
"==",
"State",
".",
"RUNNING",
")",
"{",
"final",
"Lock",
"lock",
"=",
"this",
".",
"lock",
".",
"readLock",
"(",
")",
";",
"try",
"... | Returns a copy of the repositories. Note that when returned, not all repositories may be active.
@return a copy of the repositories; never null | [
"Returns",
"a",
"copy",
"of",
"the",
"repositories",
".",
"Note",
"that",
"when",
"returned",
"not",
"all",
"repositories",
"may",
"be",
"active",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/ModeShapeEngine.java#L411-L422 | train |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/ModeShapeEngine.java | ModeShapeEngine.deploy | protected JcrRepository deploy( final RepositoryConfiguration repositoryConfiguration,
final String repositoryKey ) throws ConfigurationException, RepositoryException {
CheckArg.isNotNull(repositoryConfiguration, "repositoryConfiguration");
checkRunning();
fi... | java | protected JcrRepository deploy( final RepositoryConfiguration repositoryConfiguration,
final String repositoryKey ) throws ConfigurationException, RepositoryException {
CheckArg.isNotNull(repositoryConfiguration, "repositoryConfiguration");
checkRunning();
fi... | [
"protected",
"JcrRepository",
"deploy",
"(",
"final",
"RepositoryConfiguration",
"repositoryConfiguration",
",",
"final",
"String",
"repositoryKey",
")",
"throws",
"ConfigurationException",
",",
"RepositoryException",
"{",
"CheckArg",
".",
"isNotNull",
"(",
"repositoryConfi... | Deploy a new repository with the given configuration. This method will fail if this engine already contains a repository
with the specified name.
@param repositoryConfiguration the configuration for the repository
@param repositoryKey the key by which this repository is known to this engine; may be null if the
{@link ... | [
"Deploy",
"a",
"new",
"repository",
"with",
"the",
"given",
"configuration",
".",
"This",
"method",
"will",
"fail",
"if",
"this",
"engine",
"already",
"contains",
"a",
"repository",
"with",
"the",
"specified",
"name",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/ModeShapeEngine.java#L461-L489 | train |
networknt/light-rest-4j | openapi-validator/src/main/java/com/networknt/openapi/RequestValidator.java | RequestValidator.validateRequest | public Status validateRequest(final NormalisedPath requestPath, HttpServerExchange exchange, OpenApiOperation openApiOperation) {
requireNonNull(requestPath, "A request path is required");
requireNonNull(exchange, "An exchange is required");
requireNonNull(openApiOperation, "An OpenAPI operation... | java | public Status validateRequest(final NormalisedPath requestPath, HttpServerExchange exchange, OpenApiOperation openApiOperation) {
requireNonNull(requestPath, "A request path is required");
requireNonNull(exchange, "An exchange is required");
requireNonNull(openApiOperation, "An OpenAPI operation... | [
"public",
"Status",
"validateRequest",
"(",
"final",
"NormalisedPath",
"requestPath",
",",
"HttpServerExchange",
"exchange",
",",
"OpenApiOperation",
"openApiOperation",
")",
"{",
"requireNonNull",
"(",
"requestPath",
",",
"\"A request path is required\"",
")",
";",
"requ... | Validate the request against the given API operation
@param requestPath normalised path
@param exchange The HttpServerExchange to validate
@param openApiOperation OpenAPI operation
@return A validation report containing validation errors | [
"Validate",
"the",
"request",
"against",
"the",
"given",
"API",
"operation"
] | 06b15128e6101351e617284a636ef5d632e6b1fe | https://github.com/networknt/light-rest-4j/blob/06b15128e6101351e617284a636ef5d632e6b1fe/openapi-validator/src/main/java/com/networknt/openapi/RequestValidator.java#L70-L90 | train |
networknt/light-rest-4j | swagger-validator/src/main/java/com/networknt/validator/ResponseValidator.java | ResponseValidator.validateResponse | public Status validateResponse(final HttpServerExchange exchange, final SwaggerOperation swaggerOperation) {
requireNonNull(exchange, "An exchange is required");
requireNonNull(swaggerOperation, "A swagger operation is required");
io.swagger.models.Response swaggerResponse = swaggerOperation.ge... | java | public Status validateResponse(final HttpServerExchange exchange, final SwaggerOperation swaggerOperation) {
requireNonNull(exchange, "An exchange is required");
requireNonNull(swaggerOperation, "A swagger operation is required");
io.swagger.models.Response swaggerResponse = swaggerOperation.ge... | [
"public",
"Status",
"validateResponse",
"(",
"final",
"HttpServerExchange",
"exchange",
",",
"final",
"SwaggerOperation",
"swaggerOperation",
")",
"{",
"requireNonNull",
"(",
"exchange",
",",
"\"An exchange is required\"",
")",
";",
"requireNonNull",
"(",
"swaggerOperatio... | Validate the given response against the API operation.
@param exchange The exchange to validate
@param swaggerOperation The API operation to validate the response against
@return A status containing validation error | [
"Validate",
"the",
"given",
"response",
"against",
"the",
"API",
"operation",
"."
] | 06b15128e6101351e617284a636ef5d632e6b1fe | https://github.com/networknt/light-rest-4j/blob/06b15128e6101351e617284a636ef5d632e6b1fe/swagger-validator/src/main/java/com/networknt/validator/ResponseValidator.java#L50-L72 | train |
networknt/light-rest-4j | swagger-validator/src/main/java/com/networknt/validator/SchemaValidator.java | SchemaValidator.validate | public Status validate(final Object value, final Property schema) {
return doValidate(value, schema, null);
} | java | public Status validate(final Object value, final Property schema) {
return doValidate(value, schema, null);
} | [
"public",
"Status",
"validate",
"(",
"final",
"Object",
"value",
",",
"final",
"Property",
"schema",
")",
"{",
"return",
"doValidate",
"(",
"value",
",",
"schema",
",",
"null",
")",
";",
"}"
] | Validate the given value against the given property schema.
@param value The value to validate
@param schema The property schema to validate the value against
@return A status containing error code and description | [
"Validate",
"the",
"given",
"value",
"against",
"the",
"given",
"property",
"schema",
"."
] | 06b15128e6101351e617284a636ef5d632e6b1fe | https://github.com/networknt/light-rest-4j/blob/06b15128e6101351e617284a636ef5d632e6b1fe/swagger-validator/src/main/java/com/networknt/validator/SchemaValidator.java#L81-L83 | train |
networknt/light-rest-4j | swagger-validator/src/main/java/com/networknt/validator/SchemaValidator.java | SchemaValidator.validate | public Status validate(final Object value, final Model schema, SchemaValidatorsConfig config) {
return doValidate(value, schema, config);
} | java | public Status validate(final Object value, final Model schema, SchemaValidatorsConfig config) {
return doValidate(value, schema, config);
} | [
"public",
"Status",
"validate",
"(",
"final",
"Object",
"value",
",",
"final",
"Model",
"schema",
",",
"SchemaValidatorsConfig",
"config",
")",
"{",
"return",
"doValidate",
"(",
"value",
",",
"schema",
",",
"config",
")",
";",
"}"
] | Validate the given value against the given model schema.
@param value The value to validate
@param schema The model schema to validate the value against
@param config The config model for some validator
@return A status containing error code and description | [
"Validate",
"the",
"given",
"value",
"against",
"the",
"given",
"model",
"schema",
"."
] | 06b15128e6101351e617284a636ef5d632e6b1fe | https://github.com/networknt/light-rest-4j/blob/06b15128e6101351e617284a636ef5d632e6b1fe/swagger-validator/src/main/java/com/networknt/validator/SchemaValidator.java#L94-L96 | train |
networknt/light-rest-4j | openapi-validator/src/main/java/com/networknt/openapi/ResponseValidator.java | ResponseValidator.validateResponseContent | public Status validateResponseContent(Object responseContent, OpenApiOperation openApiOperation, String statusCode, String mediaTypeName) {
//try to convert json string to structured object
if(responseContent instanceof String) {
responseContent = convertStrToObjTree((String)responseContent)... | java | public Status validateResponseContent(Object responseContent, OpenApiOperation openApiOperation, String statusCode, String mediaTypeName) {
//try to convert json string to structured object
if(responseContent instanceof String) {
responseContent = convertStrToObjTree((String)responseContent)... | [
"public",
"Status",
"validateResponseContent",
"(",
"Object",
"responseContent",
",",
"OpenApiOperation",
"openApiOperation",
",",
"String",
"statusCode",
",",
"String",
"mediaTypeName",
")",
"{",
"//try to convert json string to structured object",
"if",
"(",
"responseConten... | validate a given response content object
@param responseContent response content needs to be validated
@param openApiOperation OpenApi Operation which is located by uri and httpMethod
@param statusCode eg. 200, 400
@param mediaTypeName eg. "application/json"
@return Status | [
"validate",
"a",
"given",
"response",
"content",
"object"
] | 06b15128e6101351e617284a636ef5d632e6b1fe | https://github.com/networknt/light-rest-4j/blob/06b15128e6101351e617284a636ef5d632e6b1fe/openapi-validator/src/main/java/com/networknt/openapi/ResponseValidator.java#L116-L138 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.