id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
103,700 | wisdom-framework/wisdom | documentation/samples/src/main/java/org/wisdom/samples/session/SessionController.java | SessionController.populate | @Route(method = HttpMethod.POST, uri = "/session/populate")
public Result populate() {
session().put("createdBy", "wisdom");
session().put("at", DateFormat.getDateTimeInstance().format(new Date()));
return redirect(router.getReverseRouteFor(this, "index"));
} | java | @Route(method = HttpMethod.POST, uri = "/session/populate")
public Result populate() {
session().put("createdBy", "wisdom");
session().put("at", DateFormat.getDateTimeInstance().format(new Date()));
return redirect(router.getReverseRouteFor(this, "index"));
} | [
"@",
"Route",
"(",
"method",
"=",
"HttpMethod",
".",
"POST",
",",
"uri",
"=",
"\"/session/populate\"",
")",
"public",
"Result",
"populate",
"(",
")",
"{",
"session",
"(",
")",
".",
"put",
"(",
"\"createdBy\"",
",",
"\"wisdom\"",
")",
";",
"session",
"(",... | Action called to populate the session | [
"Action",
"called",
"to",
"populate",
"the",
"session"
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/documentation/samples/src/main/java/org/wisdom/samples/session/SessionController.java#L67-L72 |
103,701 | wisdom-framework/wisdom | extensions/wisdom-filters/src/main/java/org/wisdom/framework/filters/AbstractCorsFilter.java | AbstractCorsFilter.call | public Result call(Route route, RequestContext context) throws Exception {
// Is CORS required?
String originHeader = context.request().getHeader(ORIGIN);
if (originHeader != null) {
originHeader = originHeader.toLowerCase();
}
// If not Preflight
if (route.... | java | public Result call(Route route, RequestContext context) throws Exception {
// Is CORS required?
String originHeader = context.request().getHeader(ORIGIN);
if (originHeader != null) {
originHeader = originHeader.toLowerCase();
}
// If not Preflight
if (route.... | [
"public",
"Result",
"call",
"(",
"Route",
"route",
",",
"RequestContext",
"context",
")",
"throws",
"Exception",
"{",
"// Is CORS required?",
"String",
"originHeader",
"=",
"context",
".",
"request",
"(",
")",
".",
"getHeader",
"(",
"ORIGIN",
")",
";",
"if",
... | Interception method.
It checks whether or not the request requires CORS support or not. It also checks whether the requests is allowed
or not.
@param route the router
@param context the filter context
@return the result, containing the CORS headers as defined in the recommendation
@throws Exception if the result can... | [
"Interception",
"method",
".",
"It",
"checks",
"whether",
"or",
"not",
"the",
"request",
"requires",
"CORS",
"support",
"or",
"not",
".",
"It",
"also",
"checks",
"whether",
"the",
"requests",
"is",
"allowed",
"or",
"not",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-filters/src/main/java/org/wisdom/framework/filters/AbstractCorsFilter.java#L67-L133 |
103,702 | wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/mojos/TypeScriptCompilerMojo.java | TypeScriptCompilerMojo.fileCreated | @Override
public boolean fileCreated(File file) throws WatchingException {
if (WatcherUtils.isInDirectory(file, internalSources)) {
processDirectory(internalSources, destinationForInternals);
} else if (WatcherUtils.isInDirectory(file, externalSources)) {
processDirectory(ext... | java | @Override
public boolean fileCreated(File file) throws WatchingException {
if (WatcherUtils.isInDirectory(file, internalSources)) {
processDirectory(internalSources, destinationForInternals);
} else if (WatcherUtils.isInDirectory(file, externalSources)) {
processDirectory(ext... | [
"@",
"Override",
"public",
"boolean",
"fileCreated",
"(",
"File",
"file",
")",
"throws",
"WatchingException",
"{",
"if",
"(",
"WatcherUtils",
".",
"isInDirectory",
"(",
"file",
",",
"internalSources",
")",
")",
"{",
"processDirectory",
"(",
"internalSources",
",... | A file is created - process it.
@param file the file
@return {@literal true} as the pipeline should continue
@throws WatchingException if the processing failed | [
"A",
"file",
"is",
"created",
"-",
"process",
"it",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/mojos/TypeScriptCompilerMojo.java#L150-L158 |
103,703 | wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/mojos/TypeScriptCompilerMojo.java | TypeScriptCompilerMojo.processDirectory | protected void processDirectory(File input, File destination) throws WatchingException {
if (! input.isDirectory()) {
return;
}
if (! destination.isDirectory()) {
destination.mkdirs();
}
// Now execute the compiler
// We compute the set of argume... | java | protected void processDirectory(File input, File destination) throws WatchingException {
if (! input.isDirectory()) {
return;
}
if (! destination.isDirectory()) {
destination.mkdirs();
}
// Now execute the compiler
// We compute the set of argume... | [
"protected",
"void",
"processDirectory",
"(",
"File",
"input",
",",
"File",
"destination",
")",
"throws",
"WatchingException",
"{",
"if",
"(",
"!",
"input",
".",
"isDirectory",
"(",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"destination",
".",
"... | Process all typescripts file from the given directory. Output files are generated in the given destination.
@param input the input directory
@param destination the output directory
@throws WatchingException if the compilation failed | [
"Process",
"all",
"typescripts",
"file",
"from",
"the",
"given",
"directory",
".",
"Output",
"files",
"are",
"generated",
"in",
"the",
"given",
"destination",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/mojos/TypeScriptCompilerMojo.java#L167-L199 |
103,704 | wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/mojos/TypeScriptCompilerMojo.java | TypeScriptCompilerMojo.getOutputFile | public File getOutputFile(File input, String ext) {
File source;
File destination;
if (input.getAbsolutePath().startsWith(internalSources.getAbsolutePath())) {
source = internalSources;
destination = destinationForInternals;
} else if (input.getAbsolutePath().star... | java | public File getOutputFile(File input, String ext) {
File source;
File destination;
if (input.getAbsolutePath().startsWith(internalSources.getAbsolutePath())) {
source = internalSources;
destination = destinationForInternals;
} else if (input.getAbsolutePath().star... | [
"public",
"File",
"getOutputFile",
"(",
"File",
"input",
",",
"String",
"ext",
")",
"{",
"File",
"source",
";",
"File",
"destination",
";",
"if",
"(",
"input",
".",
"getAbsolutePath",
"(",
")",
".",
"startsWith",
"(",
"internalSources",
".",
"getAbsolutePath... | Gets the output file for the given input and the given extension.
@param input the input file
@param ext the extension
@return the output file, may not exist | [
"Gets",
"the",
"output",
"file",
"for",
"the",
"given",
"input",
"and",
"the",
"given",
"extension",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/mojos/TypeScriptCompilerMojo.java#L263-L280 |
103,705 | wisdom-framework/wisdom | extensions/wisdom-raml/wisdom-source-watcher/src/main/java/org/wisdom/source/ast/visitor/ControllerSourceVisitor.java | ControllerSourceVisitor.visit | @Override
public void visit(ClassOrInterfaceDeclaration declaration, ControllerModel controller) {
controller.setName(declaration.getName());
LOGGER.info("[controller]Visit " + controller.getName());
//Go on with the methods and annotations
super.visit(declaration,controller);
} | java | @Override
public void visit(ClassOrInterfaceDeclaration declaration, ControllerModel controller) {
controller.setName(declaration.getName());
LOGGER.info("[controller]Visit " + controller.getName());
//Go on with the methods and annotations
super.visit(declaration,controller);
} | [
"@",
"Override",
"public",
"void",
"visit",
"(",
"ClassOrInterfaceDeclaration",
"declaration",
",",
"ControllerModel",
"controller",
")",
"{",
"controller",
".",
"setName",
"(",
"declaration",
".",
"getName",
"(",
")",
")",
";",
"LOGGER",
".",
"info",
"(",
"\"... | Visit the class declaration, this is the visitor entry point!
@param declaration {@inheritDoc}
@param controller The ControllerModel we are building. | [
"Visit",
"the",
"class",
"declaration",
"this",
"is",
"the",
"visitor",
"entry",
"point!"
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-raml/wisdom-source-watcher/src/main/java/org/wisdom/source/ast/visitor/ControllerSourceVisitor.java#L70-L77 |
103,706 | wisdom-framework/wisdom | extensions/wisdom-monitor/src/main/java/org/wisdom/monitor/MonitorCenter.java | MonitorCenter.start | @Validate
public void start() {
module = new SimpleModule(MonitorExtension.class.getName());
module.addSerializer(MonitorExtension.class, new JsonSerializer<MonitorExtension>() {
@Override
public void serialize(MonitorExtension monitorExtension, JsonGenerator jsonGenerator,
... | java | @Validate
public void start() {
module = new SimpleModule(MonitorExtension.class.getName());
module.addSerializer(MonitorExtension.class, new JsonSerializer<MonitorExtension>() {
@Override
public void serialize(MonitorExtension monitorExtension, JsonGenerator jsonGenerator,
... | [
"@",
"Validate",
"public",
"void",
"start",
"(",
")",
"{",
"module",
"=",
"new",
"SimpleModule",
"(",
"MonitorExtension",
".",
"class",
".",
"getName",
"(",
")",
")",
";",
"module",
".",
"addSerializer",
"(",
"MonitorExtension",
".",
"class",
",",
"new",
... | When the monitor starts, we initializes and registers a JSON module handling the serialization of
the monitor extension. | [
"When",
"the",
"monitor",
"starts",
"we",
"initializes",
"and",
"registers",
"a",
"JSON",
"module",
"handling",
"the",
"serialization",
"of",
"the",
"monitor",
"extension",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-monitor/src/main/java/org/wisdom/monitor/MonitorCenter.java#L72-L87 |
103,707 | wisdom-framework/wisdom | core/wisdom-executors/src/main/java/org/wisdom/executors/ManagedScheduledExecutorServiceImpl.java | ManagedScheduledExecutorServiceImpl.schedule | @Override
public synchronized <V> ManagedScheduledFutureTask<V> schedule(Callable<V> callable, long delay, TimeUnit unit) {
ScheduledTask<V> task = getNewScheduledTaskFor(callable, false);
ScheduledFuture<V> future =
((ScheduledExecutorService) executor).schedule(task.callable, delay... | java | @Override
public synchronized <V> ManagedScheduledFutureTask<V> schedule(Callable<V> callable, long delay, TimeUnit unit) {
ScheduledTask<V> task = getNewScheduledTaskFor(callable, false);
ScheduledFuture<V> future =
((ScheduledExecutorService) executor).schedule(task.callable, delay... | [
"@",
"Override",
"public",
"synchronized",
"<",
"V",
">",
"ManagedScheduledFutureTask",
"<",
"V",
">",
"schedule",
"(",
"Callable",
"<",
"V",
">",
"callable",
",",
"long",
"delay",
",",
"TimeUnit",
"unit",
")",
"{",
"ScheduledTask",
"<",
"V",
">",
"task",
... | Creates and executes a ScheduledFuture that becomes enabled after the
given delay.
@param callable the function to execute
@param delay the time from now to delay execution
@param unit the time unit of the delay parameter
@return a ScheduledFuture that can be used to extract result or cancel
@throws java.util.c... | [
"Creates",
"and",
"executes",
"a",
"ScheduledFuture",
"that",
"becomes",
"enabled",
"after",
"the",
"given",
"delay",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-executors/src/main/java/org/wisdom/executors/ManagedScheduledExecutorServiceImpl.java#L96-L103 |
103,708 | wisdom-framework/wisdom | core/wisdom-api/src/main/java/org/wisdom/api/concurrent/CompositeExecutionContext.java | CompositeExecutionContext.addAll | private CompositeExecutionContext addAll(List<ExecutionContext> contexts) {
this.elements = new ImmutableList.Builder().addAll(contexts).build();
return this;
} | java | private CompositeExecutionContext addAll(List<ExecutionContext> contexts) {
this.elements = new ImmutableList.Builder().addAll(contexts).build();
return this;
} | [
"private",
"CompositeExecutionContext",
"addAll",
"(",
"List",
"<",
"ExecutionContext",
">",
"contexts",
")",
"{",
"this",
".",
"elements",
"=",
"new",
"ImmutableList",
".",
"Builder",
"(",
")",
".",
"addAll",
"(",
"contexts",
")",
".",
"build",
"(",
")",
... | Sets the composing context.
@param contexts the elements
@return the current instance | [
"Sets",
"the",
"composing",
"context",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-api/src/main/java/org/wisdom/api/concurrent/CompositeExecutionContext.java#L74-L77 |
103,709 | wisdom-framework/wisdom | extensions/wisdom-monitor/src/main/java/org/wisdom/monitor/extensions/osgi/BundleModel.java | BundleModel.bundles | public static List<BundleModel> bundles(BundleContext context) {
List<BundleModel> bundles = new ArrayList<>();
for (Bundle bundle : context.getBundles()) {
bundles.add(new BundleModel(bundle));
}
return bundles;
} | java | public static List<BundleModel> bundles(BundleContext context) {
List<BundleModel> bundles = new ArrayList<>();
for (Bundle bundle : context.getBundles()) {
bundles.add(new BundleModel(bundle));
}
return bundles;
} | [
"public",
"static",
"List",
"<",
"BundleModel",
">",
"bundles",
"(",
"BundleContext",
"context",
")",
"{",
"List",
"<",
"BundleModel",
">",
"bundles",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"Bundle",
"bundle",
":",
"context",
".",
"get... | Creates the list of bundle models based on the bundle currently deployed.
@param context the bundle context.
@return the list of models | [
"Creates",
"the",
"list",
"of",
"bundle",
"models",
"based",
"on",
"the",
"bundle",
"currently",
"deployed",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-monitor/src/main/java/org/wisdom/monitor/extensions/osgi/BundleModel.java#L48-L54 |
103,710 | wisdom-framework/wisdom | core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/HttpHandler.java | HttpHandler.cleanup | private static void cleanup(ContextFromVertx context) {
// Release all resources, especially uploaded file.
if (context != null) {
context.cleanup();
}
Context.CONTEXT.remove();
} | java | private static void cleanup(ContextFromVertx context) {
// Release all resources, especially uploaded file.
if (context != null) {
context.cleanup();
}
Context.CONTEXT.remove();
} | [
"private",
"static",
"void",
"cleanup",
"(",
"ContextFromVertx",
"context",
")",
"{",
"// Release all resources, especially uploaded file.",
"if",
"(",
"context",
"!=",
"null",
")",
"{",
"context",
".",
"cleanup",
"(",
")",
";",
"}",
"Context",
".",
"CONTEXT",
"... | The request is now completed, clean everything.
@param context the context | [
"The",
"request",
"is",
"now",
"completed",
"clean",
"everything",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/HttpHandler.java#L167-L173 |
103,711 | wisdom-framework/wisdom | core/wisdom-api/src/main/java/org/wisdom/api/http/RequestHeader.java | RequestHeader.getHeader | public String getHeader(String headerName) {
List<String> headers = null;
for (String h : headers().keySet()) {
if (headerName.equalsIgnoreCase(h)) {
headers = headers().get(h);
break;
}
}
if (headers == null || headers.isEmpty()) {... | java | public String getHeader(String headerName) {
List<String> headers = null;
for (String h : headers().keySet()) {
if (headerName.equalsIgnoreCase(h)) {
headers = headers().get(h);
break;
}
}
if (headers == null || headers.isEmpty()) {... | [
"public",
"String",
"getHeader",
"(",
"String",
"headerName",
")",
"{",
"List",
"<",
"String",
">",
"headers",
"=",
"null",
";",
"for",
"(",
"String",
"h",
":",
"headers",
"(",
")",
".",
"keySet",
"(",
")",
")",
"{",
"if",
"(",
"headerName",
".",
"... | Retrieves a single header.
@param headerName the header name
@return the value of the header. If the header has multiple value,
the first one is returned. If the header has no value (is not specified in the request),
{@literal null} is returned. | [
"Retrieves",
"a",
"single",
"header",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-api/src/main/java/org/wisdom/api/http/RequestHeader.java#L115-L127 |
103,712 | wisdom-framework/wisdom | core/router/src/main/java/org/wisdom/router/parameter/Bindings.java | Bindings.bind | public static void bind(Source source, RouteParameterHandler handler) {
if (BINDINGS.containsKey(source)) {
LoggerFactory.getLogger(Bindings.class).warn("Replacing a route parameter binding for {} by {}",
source.name(), handler);
}
BINDINGS.put(source, handler);
... | java | public static void bind(Source source, RouteParameterHandler handler) {
if (BINDINGS.containsKey(source)) {
LoggerFactory.getLogger(Bindings.class).warn("Replacing a route parameter binding for {} by {}",
source.name(), handler);
}
BINDINGS.put(source, handler);
... | [
"public",
"static",
"void",
"bind",
"(",
"Source",
"source",
",",
"RouteParameterHandler",
"handler",
")",
"{",
"if",
"(",
"BINDINGS",
".",
"containsKey",
"(",
"source",
")",
")",
"{",
"LoggerFactory",
".",
"getLogger",
"(",
"Bindings",
".",
"class",
")",
... | Associates the given source to the given handler.
@param source the source, must not be {@code null}
@param handler the handler, must not be {@code null} | [
"Associates",
"the",
"given",
"source",
"to",
"the",
"given",
"handler",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/router/src/main/java/org/wisdom/router/parameter/Bindings.java#L56-L62 |
103,713 | wisdom-framework/wisdom | core/router/src/main/java/org/wisdom/router/parameter/Bindings.java | Bindings.create | public static Object create(ActionParameter argument, Context context,
ParameterFactories engine) {
RouteParameterHandler handler = BINDINGS.get(argument.getSource());
if (handler != null) {
return handler.create(argument, context, engine);
} else {
... | java | public static Object create(ActionParameter argument, Context context,
ParameterFactories engine) {
RouteParameterHandler handler = BINDINGS.get(argument.getSource());
if (handler != null) {
return handler.create(argument, context, engine);
} else {
... | [
"public",
"static",
"Object",
"create",
"(",
"ActionParameter",
"argument",
",",
"Context",
"context",
",",
"ParameterFactories",
"engine",
")",
"{",
"RouteParameterHandler",
"handler",
"=",
"BINDINGS",
".",
"get",
"(",
"argument",
".",
"getSource",
"(",
")",
")... | Creates the value to be injected.
@param argument the argument
@param context the context
@param engine the engine
@return the created object | [
"Creates",
"the",
"value",
"to",
"be",
"injected",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/router/src/main/java/org/wisdom/router/parameter/Bindings.java#L72-L82 |
103,714 | wisdom-framework/wisdom | framework/default-error-handler/src/main/java/org/wisdom/error/InterestingLines.java | InterestingLines.extractInterestedLines | public static InterestingLines extractInterestedLines(String source, int line, int border, Logger logger) {
try {
if (source == null) {
return null;
}
String[] lines = source.split("\n");
int firstLine = Math.max(0, line - border);
int ... | java | public static InterestingLines extractInterestedLines(String source, int line, int border, Logger logger) {
try {
if (source == null) {
return null;
}
String[] lines = source.split("\n");
int firstLine = Math.max(0, line - border);
int ... | [
"public",
"static",
"InterestingLines",
"extractInterestedLines",
"(",
"String",
"source",
",",
"int",
"line",
",",
"int",
"border",
",",
"Logger",
"logger",
")",
"{",
"try",
"{",
"if",
"(",
"source",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"... | Extracts interesting lines to be displayed to the user.
@param source the source
@param line the line responsible of the error
@param border number of lines to use as a border
@param logger the logger to use to report errors
@return the interested line structure | [
"Extracts",
"interesting",
"lines",
"to",
"be",
"displayed",
"to",
"the",
"user",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/framework/default-error-handler/src/main/java/org/wisdom/error/InterestingLines.java#L71-L86 |
103,715 | wisdom-framework/wisdom | core/wisdom-ipojo-module/src/main/java/org/wisdom/bnd/plugins/ImportedPackageRangeFixer.java | ImportedPackageRangeFixer.analyzeJar | @Override
public boolean analyzeJar(Analyzer analyzer) throws Exception {
loadInternalRangeFix();
loadExternalRangeFix();
if (analyzer.getReferred() == null) {
return false;
}
// Data loaded, start analysis
for (Map.Entry<Descriptors.PackageRef, Attrs> e... | java | @Override
public boolean analyzeJar(Analyzer analyzer) throws Exception {
loadInternalRangeFix();
loadExternalRangeFix();
if (analyzer.getReferred() == null) {
return false;
}
// Data loaded, start analysis
for (Map.Entry<Descriptors.PackageRef, Attrs> e... | [
"@",
"Override",
"public",
"boolean",
"analyzeJar",
"(",
"Analyzer",
"analyzer",
")",
"throws",
"Exception",
"{",
"loadInternalRangeFix",
"(",
")",
";",
"loadExternalRangeFix",
"(",
")",
";",
"if",
"(",
"analyzer",
".",
"getReferred",
"(",
")",
"==",
"null",
... | Analyzes the jar and update the version range.
@param analyzer the analyzer
@return {@code false}
@throws Exception if the analaysis fails. | [
"Analyzes",
"the",
"jar",
"and",
"update",
"the",
"version",
"range",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-ipojo-module/src/main/java/org/wisdom/bnd/plugins/ImportedPackageRangeFixer.java#L97-L119 |
103,716 | wisdom-framework/wisdom | core/wisdom-ipojo-module/src/main/java/org/wisdom/bnd/plugins/ImportedPackageRangeFixer.java | ImportedPackageRangeFixer.load | public static Properties load(URL url) throws IOException {
InputStream fis = null;
try {
Properties props = new Properties();
fis = url.openStream();
props.load(fis);
return props;
} finally {
IOUtils.closeQuietly(fis);
}
} | java | public static Properties load(URL url) throws IOException {
InputStream fis = null;
try {
Properties props = new Properties();
fis = url.openStream();
props.load(fis);
return props;
} finally {
IOUtils.closeQuietly(fis);
}
} | [
"public",
"static",
"Properties",
"load",
"(",
"URL",
"url",
")",
"throws",
"IOException",
"{",
"InputStream",
"fis",
"=",
"null",
";",
"try",
"{",
"Properties",
"props",
"=",
"new",
"Properties",
"(",
")",
";",
"fis",
"=",
"url",
".",
"openStream",
"(",... | Utility method to load a properties file pointed by the given url.
@param url the url
@return the read properties, empty if the file cannot be found.
@throws IOException if the file cannot be loaded. | [
"Utility",
"method",
"to",
"load",
"a",
"properties",
"file",
"pointed",
"by",
"the",
"given",
"url",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-ipojo-module/src/main/java/org/wisdom/bnd/plugins/ImportedPackageRangeFixer.java#L193-L203 |
103,717 | wisdom-framework/wisdom | core/application-configuration/src/main/java/org/wisdom/configuration/ApplicationConfigurationImpl.java | ApplicationConfigurationImpl.reloadConfiguration | private String reloadConfiguration() {
String location = System.getProperty(APPLICATION_CONFIGURATION);
if (location == null) {
location = "conf/application.conf";
}
Config configuration = loadConfiguration(location);
if (configuration == null) {
throw n... | java | private String reloadConfiguration() {
String location = System.getProperty(APPLICATION_CONFIGURATION);
if (location == null) {
location = "conf/application.conf";
}
Config configuration = loadConfiguration(location);
if (configuration == null) {
throw n... | [
"private",
"String",
"reloadConfiguration",
"(",
")",
"{",
"String",
"location",
"=",
"System",
".",
"getProperty",
"(",
"APPLICATION_CONFIGURATION",
")",
";",
"if",
"(",
"location",
"==",
"null",
")",
"{",
"location",
"=",
"\"conf/application.conf\"",
";",
"}",... | Reloads the configuration file.
@return the location of the file. | [
"Reloads",
"the",
"configuration",
"file",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/application-configuration/src/main/java/org/wisdom/configuration/ApplicationConfigurationImpl.java#L140-L156 |
103,718 | wisdom-framework/wisdom | core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/RequestFromVertx.java | RequestFromVertx.path | @Override
public String path() {
try {
return new URI(request.uri()).getRawPath();
} catch (URISyntaxException e) { //NOSONAR
// Should never be the case.
return uri();
}
} | java | @Override
public String path() {
try {
return new URI(request.uri()).getRawPath();
} catch (URISyntaxException e) { //NOSONAR
// Should never be the case.
return uri();
}
} | [
"@",
"Override",
"public",
"String",
"path",
"(",
")",
"{",
"try",
"{",
"return",
"new",
"URI",
"(",
"request",
".",
"uri",
"(",
")",
")",
".",
"getRawPath",
"(",
")",
";",
"}",
"catch",
"(",
"URISyntaxException",
"e",
")",
"{",
"//NOSONAR",
"// Shou... | The URI path, without the query part. | [
"The",
"URI",
"path",
"without",
"the",
"query",
"part",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/RequestFromVertx.java#L197-L205 |
103,719 | wisdom-framework/wisdom | core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/RequestFromVertx.java | RequestFromVertx.accepts | @Override
public boolean accepts(String mimeType) {
String contentType = request.headers().get(HeaderNames.ACCEPT);
if (contentType == null) {
contentType = MimeTypes.HTML;
}
// For performance reason, we first try a full match:
if (contentType.contains(mimeType))... | java | @Override
public boolean accepts(String mimeType) {
String contentType = request.headers().get(HeaderNames.ACCEPT);
if (contentType == null) {
contentType = MimeTypes.HTML;
}
// For performance reason, we first try a full match:
if (contentType.contains(mimeType))... | [
"@",
"Override",
"public",
"boolean",
"accepts",
"(",
"String",
"mimeType",
")",
"{",
"String",
"contentType",
"=",
"request",
".",
"headers",
"(",
")",
".",
"get",
"(",
"HeaderNames",
".",
"ACCEPT",
")",
";",
"if",
"(",
"contentType",
"==",
"null",
")",... | Check if this request accepts a given media type.
@return true if <code>mimeType</code> is in the Accept header, otherwise false | [
"Check",
"if",
"this",
"request",
"accepts",
"a",
"given",
"media",
"type",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/RequestFromVertx.java#L290-L308 |
103,720 | wisdom-framework/wisdom | core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/RequestFromVertx.java | RequestFromVertx.headers | @Override
public Map<String, List<String>> headers() {
if (headers != null) {
return headers;
}
headers = new HashMap<>();
final MultiMap requestHeaders = request.headers();
Set<String> names = requestHeaders.names();
for (String name : names) {
... | java | @Override
public Map<String, List<String>> headers() {
if (headers != null) {
return headers;
}
headers = new HashMap<>();
final MultiMap requestHeaders = request.headers();
Set<String> names = requestHeaders.names();
for (String name : names) {
... | [
"@",
"Override",
"public",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"headers",
"(",
")",
"{",
"if",
"(",
"headers",
"!=",
"null",
")",
"{",
"return",
"headers",
";",
"}",
"headers",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"... | Retrieves all headers.
@return headers | [
"Retrieves",
"all",
"headers",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/RequestFromVertx.java#L335-L347 |
103,721 | wisdom-framework/wisdom | core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/RequestFromVertx.java | RequestFromVertx.parameters | @Override
public Map<String, List<String>> parameters() {
Map<String, List<String>> result = new HashMap<>();
for (String key : request.params().names()) {
result.put(key, request.params().getAll(key));
}
return result;
} | java | @Override
public Map<String, List<String>> parameters() {
Map<String, List<String>> result = new HashMap<>();
for (String key : request.params().names()) {
result.put(key, request.params().getAll(key));
}
return result;
} | [
"@",
"Override",
"public",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"parameters",
"(",
")",
"{",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"result",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"for",
"(",
"Str... | Gets all the parameters from the request.
@return The parameters | [
"Gets",
"all",
"the",
"parameters",
"from",
"the",
"request",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/RequestFromVertx.java#L495-L502 |
103,722 | wisdom-framework/wisdom | core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/RequestFromVertx.java | RequestFromVertx.getRawBodyAsString | public String getRawBodyAsString() {
if (raw == null) {
return null;
}
return raw.toString(Charsets.UTF_8.displayName());
} | java | public String getRawBodyAsString() {
if (raw == null) {
return null;
}
return raw.toString(Charsets.UTF_8.displayName());
} | [
"public",
"String",
"getRawBodyAsString",
"(",
")",
"{",
"if",
"(",
"raw",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"raw",
".",
"toString",
"(",
"Charsets",
".",
"UTF_8",
".",
"displayName",
"(",
")",
")",
";",
"}"
] | Gets the 'raw' body.
@return the raw body, {@code null} if there is no body. | [
"Gets",
"the",
"raw",
"body",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/RequestFromVertx.java#L540-L545 |
103,723 | wisdom-framework/wisdom | core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/RequestFromVertx.java | RequestFromVertx.ready | public boolean ready() {
for (VertxFileUpload file : files) {
if (file.getErrorIfAny() != null) {
return false;
}
}
String contentType = request.headers().get(HeaderNames.CONTENT_TYPE);
if (contentType != null) {
contentType = HttpUtil... | java | public boolean ready() {
for (VertxFileUpload file : files) {
if (file.getErrorIfAny() != null) {
return false;
}
}
String contentType = request.headers().get(HeaderNames.CONTENT_TYPE);
if (contentType != null) {
contentType = HttpUtil... | [
"public",
"boolean",
"ready",
"(",
")",
"{",
"for",
"(",
"VertxFileUpload",
"file",
":",
"files",
")",
"{",
"if",
"(",
"file",
".",
"getErrorIfAny",
"(",
")",
"!=",
"null",
")",
"{",
"return",
"false",
";",
"}",
"}",
"String",
"contentType",
"=",
"re... | Callbacks invokes when the request has been read completely.
@return a boolean indicating if the request was handled correctly. | [
"Callbacks",
"invokes",
"when",
"the",
"request",
"has",
"been",
"read",
"completely",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/RequestFromVertx.java#L570-L592 |
103,724 | wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/DependencyFinder.java | DependencyFinder.getArtifactFileFromProjectDependencies | public static File getArtifactFileFromProjectDependencies(AbstractWisdomMojo mojo, String artifactId,
String type) {
Preconditions.checkNotNull(mojo);
Preconditions.checkNotNull(artifactId);
Preconditions.checkNotNull(type);
... | java | public static File getArtifactFileFromProjectDependencies(AbstractWisdomMojo mojo, String artifactId,
String type) {
Preconditions.checkNotNull(mojo);
Preconditions.checkNotNull(artifactId);
Preconditions.checkNotNull(type);
... | [
"public",
"static",
"File",
"getArtifactFileFromProjectDependencies",
"(",
"AbstractWisdomMojo",
"mojo",
",",
"String",
"artifactId",
",",
"String",
"type",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"mojo",
")",
";",
"Preconditions",
".",
"checkNotNull",
... | Gets the file of the dependency with the given artifact id from the project dependencies.
@param mojo the mojo
@param artifactId the name of the artifact to find
@param type the extension of the artifact to find
@return the artifact file, {@code null} if not found | [
"Gets",
"the",
"file",
"of",
"the",
"dependency",
"with",
"the",
"given",
"artifact",
"id",
"from",
"the",
"project",
"dependencies",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/DependencyFinder.java#L73-L86 |
103,725 | wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/DependencyFinder.java | DependencyFinder.getArtifactFile | public static File getArtifactFile(AbstractWisdomMojo mojo, String artifactId, String type) {
File file = getArtifactFileFromProjectDependencies(mojo, artifactId, type);
if (file == null) {
file = getArtifactFileFromPluginDependencies(mojo, artifactId, type);
}
return file;
... | java | public static File getArtifactFile(AbstractWisdomMojo mojo, String artifactId, String type) {
File file = getArtifactFileFromProjectDependencies(mojo, artifactId, type);
if (file == null) {
file = getArtifactFileFromPluginDependencies(mojo, artifactId, type);
}
return file;
... | [
"public",
"static",
"File",
"getArtifactFile",
"(",
"AbstractWisdomMojo",
"mojo",
",",
"String",
"artifactId",
",",
"String",
"type",
")",
"{",
"File",
"file",
"=",
"getArtifactFileFromProjectDependencies",
"(",
"mojo",
",",
"artifactId",
",",
"type",
")",
";",
... | Gets the file of the dependency with the given artifact id from the project dependencies and if not found from
the plugin dependencies. This method also check the extension.
@param mojo the mojo
@param artifactId the name of the artifact to find
@param type the extension of the artifact to find
@return the arti... | [
"Gets",
"the",
"file",
"of",
"the",
"dependency",
"with",
"the",
"given",
"artifact",
"id",
"from",
"the",
"project",
"dependencies",
"and",
"if",
"not",
"found",
"from",
"the",
"plugin",
"dependencies",
".",
"This",
"method",
"also",
"check",
"the",
"extens... | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/DependencyFinder.java#L97-L103 |
103,726 | wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/WisdomRuntimeExpander.java | WisdomRuntimeExpander.expand | public static boolean expand(AbstractWisdomMojo mojo, File destination,
String profileOrGAV) throws MojoExecutionException {
if (destination.exists() && isWisdomAlreadyInstalled(destination)) {
return false;
}
File archive = getArchive(mojo, profileOr... | java | public static boolean expand(AbstractWisdomMojo mojo, File destination,
String profileOrGAV) throws MojoExecutionException {
if (destination.exists() && isWisdomAlreadyInstalled(destination)) {
return false;
}
File archive = getArchive(mojo, profileOr... | [
"public",
"static",
"boolean",
"expand",
"(",
"AbstractWisdomMojo",
"mojo",
",",
"File",
"destination",
",",
"String",
"profileOrGAV",
")",
"throws",
"MojoExecutionException",
"{",
"if",
"(",
"destination",
".",
"exists",
"(",
")",
"&&",
"isWisdomAlreadyInstalled",
... | Downloads and expands the Wisdom distribution.
@param mojo the mojo
@param destination the output directory
@param profileOrGAV indicates the profile (regular, base, equinox) or the GAV of the distribution to use. The
GAV are given as follows: GROUP_ID:ARTIFACT_ID:EXTENSION:CLASSIFIER:VERSION.
@return {@liter... | [
"Downloads",
"and",
"expands",
"the",
"Wisdom",
"distribution",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/WisdomRuntimeExpander.java#L46-L58 |
103,727 | wisdom-framework/wisdom | extensions/wisdom-monitor/src/main/java/org/wisdom/monitor/extensions/security/MonitorAuthenticator.java | MonitorAuthenticator.getUserName | @Override
public String getUserName(Context context) {
if (!enabled) {
// Fake user.
return "admin";
}
String user = context.session().get("wisdom.monitor.username");
if (user != null && user.equals(username)) {
return user;
}
ret... | java | @Override
public String getUserName(Context context) {
if (!enabled) {
// Fake user.
return "admin";
}
String user = context.session().get("wisdom.monitor.username");
if (user != null && user.equals(username)) {
return user;
}
ret... | [
"@",
"Override",
"public",
"String",
"getUserName",
"(",
"Context",
"context",
")",
"{",
"if",
"(",
"!",
"enabled",
")",
"{",
"// Fake user.",
"return",
"\"admin\"",
";",
"}",
"String",
"user",
"=",
"context",
".",
"session",
"(",
")",
".",
"get",
"(",
... | Retrieves the username from the HTTP context.
It reads the 'wisdom.monitor.username' in the session, and checks it is equal to the username set in the
application configuration.
@param context the context
@return {@literal null} if the user is not authenticated, the user name otherwise. | [
"Retrieves",
"the",
"username",
"from",
"the",
"HTTP",
"context",
".",
"It",
"reads",
"the",
"wisdom",
".",
"monitor",
".",
"username",
"in",
"the",
"session",
"and",
"checks",
"it",
"is",
"equal",
"to",
"the",
"username",
"set",
"in",
"the",
"application"... | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-monitor/src/main/java/org/wisdom/monitor/extensions/security/MonitorAuthenticator.java#L72-L85 |
103,728 | wisdom-framework/wisdom | core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/WebSocketHandler.java | WebSocketHandler.handle | @Override
public void handle(final ServerWebSocket socket) {
LOGGER.info("New web socket connection {}, {}", socket, socket.uri());
if (! configuration.accept(socket.uri())) {
LOGGER.warn("Web Socket connection denied on {} by {}", socket.uri(), configuration.name());
return... | java | @Override
public void handle(final ServerWebSocket socket) {
LOGGER.info("New web socket connection {}, {}", socket, socket.uri());
if (! configuration.accept(socket.uri())) {
LOGGER.warn("Web Socket connection denied on {} by {}", socket.uri(), configuration.name());
return... | [
"@",
"Override",
"public",
"void",
"handle",
"(",
"final",
"ServerWebSocket",
"socket",
")",
"{",
"LOGGER",
".",
"info",
"(",
"\"New web socket connection {}, {}\"",
",",
"socket",
",",
"socket",
".",
"uri",
"(",
")",
")",
";",
"if",
"(",
"!",
"configuration... | Handles a web socket connection.
@param socket the opening socket. | [
"Handles",
"a",
"web",
"socket",
"connection",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/WebSocketHandler.java#L64-L83 |
103,729 | wisdom-framework/wisdom | extensions/wisdom-monitor/src/main/java/org/wisdom/monitor/extensions/osgi/BundleMonitorExtension.java | BundleMonitorExtension.toggleBundle | @Route(method = HttpMethod.GET, uri = "/{id}")
public Result toggleBundle(@Parameter("id") long id) {
Bundle bundle = context.getBundle(id);
if (bundle == null) {
return notFound("Bundle " + id + " not found");
} else {
if (! isFragment(bundle)) {
if (... | java | @Route(method = HttpMethod.GET, uri = "/{id}")
public Result toggleBundle(@Parameter("id") long id) {
Bundle bundle = context.getBundle(id);
if (bundle == null) {
return notFound("Bundle " + id + " not found");
} else {
if (! isFragment(bundle)) {
if (... | [
"@",
"Route",
"(",
"method",
"=",
"HttpMethod",
".",
"GET",
",",
"uri",
"=",
"\"/{id}\"",
")",
"public",
"Result",
"toggleBundle",
"(",
"@",
"Parameter",
"(",
"\"id\"",
")",
"long",
"id",
")",
"{",
"Bundle",
"bundle",
"=",
"context",
".",
"getBundle",
... | Toggles the states of the bundle. If the bundle is active, the bundle is stopped. If the bundle is resolved or
installed, the bundle is started.
@param id the bundle's id
@return OK if everything is fine, BAD_REQUEST if the bundle cannot be started or stopped correctly,
NOT_FOUND if there are no bundles with the given... | [
"Toggles",
"the",
"states",
"of",
"the",
"bundle",
".",
"If",
"the",
"bundle",
"is",
"active",
"the",
"bundle",
"is",
"stopped",
".",
"If",
"the",
"bundle",
"is",
"resolved",
"or",
"installed",
"the",
"bundle",
"is",
"started",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-monitor/src/main/java/org/wisdom/monitor/extensions/osgi/BundleMonitorExtension.java#L130-L164 |
103,730 | wisdom-framework/wisdom | extensions/wisdom-monitor/src/main/java/org/wisdom/monitor/extensions/osgi/BundleMonitorExtension.java | BundleMonitorExtension.updateBundle | @Route(method = HttpMethod.POST, uri = "/{id}")
public Result updateBundle(@Parameter("id") long id) {
final Bundle bundle = context.getBundle(id);
if (bundle == null) {
return notFound("Bundle " + id + " not found");
} else {
return async(new Callable<Result>() {
... | java | @Route(method = HttpMethod.POST, uri = "/{id}")
public Result updateBundle(@Parameter("id") long id) {
final Bundle bundle = context.getBundle(id);
if (bundle == null) {
return notFound("Bundle " + id + " not found");
} else {
return async(new Callable<Result>() {
... | [
"@",
"Route",
"(",
"method",
"=",
"HttpMethod",
".",
"POST",
",",
"uri",
"=",
"\"/{id}\"",
")",
"public",
"Result",
"updateBundle",
"(",
"@",
"Parameter",
"(",
"\"id\"",
")",
"long",
"id",
")",
"{",
"final",
"Bundle",
"bundle",
"=",
"context",
".",
"ge... | Updates the given bundle. The bundle is updated from the installation url.
@param id the bundle's id
@return OK if the bundle is updated, BAD_REQUEST if an error occurs when the bundle is updated,
NOT_FOUND if there are no bundles with the given id. | [
"Updates",
"the",
"given",
"bundle",
".",
"The",
"bundle",
"is",
"updated",
"from",
"the",
"installation",
"url",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-monitor/src/main/java/org/wisdom/monitor/extensions/osgi/BundleMonitorExtension.java#L173-L193 |
103,731 | wisdom-framework/wisdom | extensions/wisdom-monitor/src/main/java/org/wisdom/monitor/extensions/osgi/BundleMonitorExtension.java | BundleMonitorExtension.installBundle | @Route(method = HttpMethod.POST, uri = "")
public Result installBundle(@FormParameter("bundle") final FileItem bundle,
@FormParameter("start") @DefaultValue("false") final boolean startIfNeeded) {
if (bundle != null) {
return async(new Callable<Result>() {
... | java | @Route(method = HttpMethod.POST, uri = "")
public Result installBundle(@FormParameter("bundle") final FileItem bundle,
@FormParameter("start") @DefaultValue("false") final boolean startIfNeeded) {
if (bundle != null) {
return async(new Callable<Result>() {
... | [
"@",
"Route",
"(",
"method",
"=",
"HttpMethod",
".",
"POST",
",",
"uri",
"=",
"\"\"",
")",
"public",
"Result",
"installBundle",
"(",
"@",
"FormParameter",
"(",
"\"bundle\"",
")",
"final",
"FileItem",
"bundle",
",",
"@",
"FormParameter",
"(",
"\"start\"",
"... | Installs a new bundle.
@param bundle the bundle file
@param startIfNeeded whether or not the bundle need to be started
@return the bundle page, with a flash message. | [
"Installs",
"a",
"new",
"bundle",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-monitor/src/main/java/org/wisdom/monitor/extensions/osgi/BundleMonitorExtension.java#L202-L241 |
103,732 | wisdom-framework/wisdom | extensions/wisdom-monitor/src/main/java/org/wisdom/monitor/extensions/osgi/BundleMonitorExtension.java | BundleMonitorExtension.uninstallBundle | @Route(method = HttpMethod.DELETE, uri = "/{id}")
public Result uninstallBundle(@Parameter("id") long id) {
final Bundle bundle = context.getBundle(id);
if (bundle == null) {
return notFound("Bundle " + id + " not found");
} else {
return async(new Callable<Result>() ... | java | @Route(method = HttpMethod.DELETE, uri = "/{id}")
public Result uninstallBundle(@Parameter("id") long id) {
final Bundle bundle = context.getBundle(id);
if (bundle == null) {
return notFound("Bundle " + id + " not found");
} else {
return async(new Callable<Result>() ... | [
"@",
"Route",
"(",
"method",
"=",
"HttpMethod",
".",
"DELETE",
",",
"uri",
"=",
"\"/{id}\"",
")",
"public",
"Result",
"uninstallBundle",
"(",
"@",
"Parameter",
"(",
"\"id\"",
")",
"long",
"id",
")",
"{",
"final",
"Bundle",
"bundle",
"=",
"context",
".",
... | Uninstalls the given bundle.
@param id the bundle's id
@return OK if the bundle is updated, BAD_REQUEST if an error occurs when the bundle is uninstalled,
NOT_FOUND if there are no bundles with the given id. | [
"Uninstalls",
"the",
"given",
"bundle",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-monitor/src/main/java/org/wisdom/monitor/extensions/osgi/BundleMonitorExtension.java#L250-L270 |
103,733 | wisdom-framework/wisdom | extensions/wisdom-monitor/src/main/java/org/wisdom/monitor/extensions/osgi/BundleMonitorExtension.java | BundleMonitorExtension.isFragment | public static boolean isFragment(Bundle bundle) {
Dictionary<String, String> headers = bundle.getHeaders();
return headers.get(Constants.FRAGMENT_HOST) != null;
} | java | public static boolean isFragment(Bundle bundle) {
Dictionary<String, String> headers = bundle.getHeaders();
return headers.get(Constants.FRAGMENT_HOST) != null;
} | [
"public",
"static",
"boolean",
"isFragment",
"(",
"Bundle",
"bundle",
")",
"{",
"Dictionary",
"<",
"String",
",",
"String",
">",
"headers",
"=",
"bundle",
".",
"getHeaders",
"(",
")",
";",
"return",
"headers",
".",
"get",
"(",
"Constants",
".",
"FRAGMENT_H... | Checks whether or not the given bundle is a fragment
@param bundle the bundle
@return {@code true} if the bundle is a fragment, {@code false} otherwise. | [
"Checks",
"whether",
"or",
"not",
"the",
"given",
"bundle",
"is",
"a",
"fragment"
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-monitor/src/main/java/org/wisdom/monitor/extensions/osgi/BundleMonitorExtension.java#L352-L355 |
103,734 | wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/node/NPM.java | NPM.findExecutable | public File findExecutable(String binary) throws IOException, ParseException {
File npmDirectory = getNPMDirectory();
File packageFile = new File(npmDirectory, PACKAGE_JSON);
if (!packageFile.isFile()) {
throw new IllegalStateException("Invalid NPM " + npmName + " - " + packageFile.g... | java | public File findExecutable(String binary) throws IOException, ParseException {
File npmDirectory = getNPMDirectory();
File packageFile = new File(npmDirectory, PACKAGE_JSON);
if (!packageFile.isFile()) {
throw new IllegalStateException("Invalid NPM " + npmName + " - " + packageFile.g... | [
"public",
"File",
"findExecutable",
"(",
"String",
"binary",
")",
"throws",
"IOException",
",",
"ParseException",
"{",
"File",
"npmDirectory",
"=",
"getNPMDirectory",
"(",
")",
";",
"File",
"packageFile",
"=",
"new",
"File",
"(",
"npmDirectory",
",",
"PACKAGE_JS... | Tries to find the main JS file.
This search is based on the `package.json` file and it's `bin` entry.
If there is an entry in the `bin` object matching `binary`, it uses this javascript file.
If the search failed, `null` is returned
@return the JavaScript file to execute, null if not found | [
"Tries",
"to",
"find",
"the",
"main",
"JS",
"file",
".",
"This",
"search",
"is",
"based",
"on",
"the",
"package",
".",
"json",
"file",
"and",
"it",
"s",
"bin",
"entry",
".",
"If",
"there",
"is",
"an",
"entry",
"in",
"the",
"bin",
"object",
"matching"... | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/node/NPM.java#L269-L302 |
103,735 | wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/node/NPM.java | NPM.getVersionFromNPM | public static String getVersionFromNPM(File npmDirectory, Log log) {
File packageFile = new File(npmDirectory, PACKAGE_JSON);
if (!packageFile.isFile()) {
return "0.0.0";
}
FileReader reader = null;
try {
reader = new FileReader(packageFile); //NOSONAR
... | java | public static String getVersionFromNPM(File npmDirectory, Log log) {
File packageFile = new File(npmDirectory, PACKAGE_JSON);
if (!packageFile.isFile()) {
return "0.0.0";
}
FileReader reader = null;
try {
reader = new FileReader(packageFile); //NOSONAR
... | [
"public",
"static",
"String",
"getVersionFromNPM",
"(",
"File",
"npmDirectory",
",",
"Log",
"log",
")",
"{",
"File",
"packageFile",
"=",
"new",
"File",
"(",
"npmDirectory",
",",
"PACKAGE_JSON",
")",
";",
"if",
"(",
"!",
"packageFile",
".",
"isFile",
"(",
"... | Utility method to extract the version from a NPM by reading its 'package.json' file.
@param npmDirectory the directory in which the NPM is installed
@param log the logger object
@return the read version, "0.0.0" if there are not 'package.json' file, {@code null} if this file cannot be
read or does not contain... | [
"Utility",
"method",
"to",
"extract",
"the",
"version",
"from",
"a",
"NPM",
"by",
"reading",
"its",
"package",
".",
"json",
"file",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/node/NPM.java#L371-L389 |
103,736 | wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/node/NPM.java | NPM.configureRegistry | public static void configureRegistry(NodeManager node, Log log, String npmRegistryUrl) {
try {
node.factory().getNpmRunner(node.proxy()).execute("config set registry " + npmRegistryUrl);
} catch (TaskRunnerException e) {
log.error("Error during the configuration of NPM registry w... | java | public static void configureRegistry(NodeManager node, Log log, String npmRegistryUrl) {
try {
node.factory().getNpmRunner(node.proxy()).execute("config set registry " + npmRegistryUrl);
} catch (TaskRunnerException e) {
log.error("Error during the configuration of NPM registry w... | [
"public",
"static",
"void",
"configureRegistry",
"(",
"NodeManager",
"node",
",",
"Log",
"log",
",",
"String",
"npmRegistryUrl",
")",
"{",
"try",
"{",
"node",
".",
"factory",
"(",
")",
".",
"getNpmRunner",
"(",
"node",
".",
"proxy",
"(",
")",
")",
".",
... | Configures the NPM registry location.
@param node the node manager
@param log the logger
@param npmRegistryUrl the registry url | [
"Configures",
"the",
"NPM",
"registry",
"location",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/node/NPM.java#L415-L421 |
103,737 | wisdom-framework/wisdom | extensions/wisdom-raml/wisdom-source-watcher/src/main/java/org/wisdom/source/ast/model/ControllerRouteModel.java | ControllerRouteModel.compareTo | @Override
public int compareTo(ControllerRouteModel rElem) {
if (rElem == null) {
throw new NullPointerException("Cannot compare to null");
}
if (rElem.equals(this)) {
return 0;
}
int compare = getPath().compareTo(rElem.getPath());
if(compar... | java | @Override
public int compareTo(ControllerRouteModel rElem) {
if (rElem == null) {
throw new NullPointerException("Cannot compare to null");
}
if (rElem.equals(this)) {
return 0;
}
int compare = getPath().compareTo(rElem.getPath());
if(compar... | [
"@",
"Override",
"public",
"int",
"compareTo",
"(",
"ControllerRouteModel",
"rElem",
")",
"{",
"if",
"(",
"rElem",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"Cannot compare to null\"",
")",
";",
"}",
"if",
"(",
"rElem",
".",
"equ... | A bit dummy compareTo implementation use by the tree Map.
@param rElem the {@link ControllerRouteModel} that we want to compare to <code>this</code>.
@return {@inheritDoc} | [
"A",
"bit",
"dummy",
"compareTo",
"implementation",
"use",
"by",
"the",
"tree",
"Map",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-raml/wisdom-source-watcher/src/main/java/org/wisdom/source/ast/model/ControllerRouteModel.java#L247-L268 |
103,738 | wisdom-framework/wisdom | core/wisdom-ipojo-module/src/main/java/org/wisdom/ipojo/module/WisdomBindingModule.java | WisdomBindingModule.configure | @Override
public void configure() {
bind(Controller.class)
.to(new AnnotationVisitorFactory() {
public AnnotationVisitor newAnnotationVisitor(BindingContext context) {
return new WisdomControllerVisitor(context.getWorkbench(), context.getReporter()... | java | @Override
public void configure() {
bind(Controller.class)
.to(new AnnotationVisitorFactory() {
public AnnotationVisitor newAnnotationVisitor(BindingContext context) {
return new WisdomControllerVisitor(context.getWorkbench(), context.getReporter()... | [
"@",
"Override",
"public",
"void",
"configure",
"(",
")",
"{",
"bind",
"(",
"Controller",
".",
"class",
")",
".",
"to",
"(",
"new",
"AnnotationVisitorFactory",
"(",
")",
"{",
"public",
"AnnotationVisitor",
"newAnnotationVisitor",
"(",
"BindingContext",
"context"... | Adds the Wisdom annotation to the iPOJO manipulator. | [
"Adds",
"the",
"Wisdom",
"annotation",
"to",
"the",
"iPOJO",
"manipulator",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-ipojo-module/src/main/java/org/wisdom/ipojo/module/WisdomBindingModule.java#L42-L75 |
103,739 | wisdom-framework/wisdom | core/crypto/src/main/java/org/wisdom/crypto/CryptoServiceSingleton.java | CryptoServiceSingleton.generateAESKey | private SecretKey generateAESKey(String privateKey, String salt) {
try {
byte[] raw = decodeHex(salt);
KeySpec spec = new PBEKeySpec(privateKey.toCharArray(), raw, iterationCount, keySize);
SecretKeyFactory factory = SecretKeyFactory.getInstance(PBKDF_2_WITH_HMAC_SHA_1);
... | java | private SecretKey generateAESKey(String privateKey, String salt) {
try {
byte[] raw = decodeHex(salt);
KeySpec spec = new PBEKeySpec(privateKey.toCharArray(), raw, iterationCount, keySize);
SecretKeyFactory factory = SecretKeyFactory.getInstance(PBKDF_2_WITH_HMAC_SHA_1);
... | [
"private",
"SecretKey",
"generateAESKey",
"(",
"String",
"privateKey",
",",
"String",
"salt",
")",
"{",
"try",
"{",
"byte",
"[",
"]",
"raw",
"=",
"decodeHex",
"(",
"salt",
")",
";",
"KeySpec",
"spec",
"=",
"new",
"PBEKeySpec",
"(",
"privateKey",
".",
"to... | Generate the AES key from the salt and the private key.
@param salt the salt (hexadecimal)
@param privateKey the private key
@return the generated key. | [
"Generate",
"the",
"AES",
"key",
"from",
"the",
"salt",
"and",
"the",
"private",
"key",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/crypto/src/main/java/org/wisdom/crypto/CryptoServiceSingleton.java#L99-L108 |
103,740 | wisdom-framework/wisdom | core/crypto/src/main/java/org/wisdom/crypto/CryptoServiceSingleton.java | CryptoServiceSingleton.sign | @Override
public String sign(String message, byte[] key) {
Preconditions.checkNotNull(message);
Preconditions.checkNotNull(key);
try {
// Get an hmac_sha1 key from the raw key bytes
SecretKeySpec signingKey = new SecretKeySpec(key, HMAC_SHA_1);
// Get an ... | java | @Override
public String sign(String message, byte[] key) {
Preconditions.checkNotNull(message);
Preconditions.checkNotNull(key);
try {
// Get an hmac_sha1 key from the raw key bytes
SecretKeySpec signingKey = new SecretKeySpec(key, HMAC_SHA_1);
// Get an ... | [
"@",
"Override",
"public",
"String",
"sign",
"(",
"String",
"message",
",",
"byte",
"[",
"]",
"key",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"message",
")",
";",
"Preconditions",
".",
"checkNotNull",
"(",
"key",
")",
";",
"try",
"{",
"// Get... | Sign a message with a key.
@param message The message to sign
@param key The key to use
@return The signed message (in hexadecimal) | [
"Sign",
"a",
"message",
"with",
"a",
"key",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/crypto/src/main/java/org/wisdom/crypto/CryptoServiceSingleton.java#L214-L234 |
103,741 | wisdom-framework/wisdom | core/crypto/src/main/java/org/wisdom/crypto/CryptoServiceSingleton.java | CryptoServiceSingleton.hash | @Override
public String hash(String input, Hash hashType) {
Preconditions.checkNotNull(input);
Preconditions.checkNotNull(hashType);
try {
MessageDigest m = MessageDigest.getInstance(hashType.toString());
byte[] out = m.digest(input.getBytes(Charsets.UTF_8));
... | java | @Override
public String hash(String input, Hash hashType) {
Preconditions.checkNotNull(input);
Preconditions.checkNotNull(hashType);
try {
MessageDigest m = MessageDigest.getInstance(hashType.toString());
byte[] out = m.digest(input.getBytes(Charsets.UTF_8));
... | [
"@",
"Override",
"public",
"String",
"hash",
"(",
"String",
"input",
",",
"Hash",
"hashType",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"input",
")",
";",
"Preconditions",
".",
"checkNotNull",
"(",
"hashType",
")",
";",
"try",
"{",
"MessageDigest"... | Create a hash using specific hashing algorithm.
@param input The password
@param hashType The hashing algorithm
@return The password hash | [
"Create",
"a",
"hash",
"using",
"specific",
"hashing",
"algorithm",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/crypto/src/main/java/org/wisdom/crypto/CryptoServiceSingleton.java#L254-L265 |
103,742 | wisdom-framework/wisdom | core/crypto/src/main/java/org/wisdom/crypto/CryptoServiceSingleton.java | CryptoServiceSingleton.encodeBase64 | @Override
public String encodeBase64(byte[] value) {
return new String(Base64.encodeBase64(value), Charsets.UTF_8);
} | java | @Override
public String encodeBase64(byte[] value) {
return new String(Base64.encodeBase64(value), Charsets.UTF_8);
} | [
"@",
"Override",
"public",
"String",
"encodeBase64",
"(",
"byte",
"[",
"]",
"value",
")",
"{",
"return",
"new",
"String",
"(",
"Base64",
".",
"encodeBase64",
"(",
"value",
")",
",",
"Charsets",
".",
"UTF_8",
")",
";",
"}"
] | Encode binary data to base64.
@param value The binary data
@return The base64 encoded String | [
"Encode",
"binary",
"data",
"to",
"base64",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/crypto/src/main/java/org/wisdom/crypto/CryptoServiceSingleton.java#L417-L420 |
103,743 | wisdom-framework/wisdom | core/crypto/src/main/java/org/wisdom/crypto/CryptoServiceSingleton.java | CryptoServiceSingleton.hexMD5 | @Override
public String hexMD5(String value) {
return String.valueOf(Hex.encodeHex(md5(value)));
} | java | @Override
public String hexMD5(String value) {
return String.valueOf(Hex.encodeHex(md5(value)));
} | [
"@",
"Override",
"public",
"String",
"hexMD5",
"(",
"String",
"value",
")",
"{",
"return",
"String",
".",
"valueOf",
"(",
"Hex",
".",
"encodeHex",
"(",
"md5",
"(",
"value",
")",
")",
")",
";",
"}"
] | Build an hexadecimal MD5 hash for a String.
@param value The String to hash
@return An hexadecimal Hash | [
"Build",
"an",
"hexadecimal",
"MD5",
"hash",
"for",
"a",
"String",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/crypto/src/main/java/org/wisdom/crypto/CryptoServiceSingleton.java#L439-L442 |
103,744 | wisdom-framework/wisdom | core/crypto/src/main/java/org/wisdom/crypto/CryptoServiceSingleton.java | CryptoServiceSingleton.hexSHA1 | @Override
public String hexSHA1(String value) {
return String.valueOf(Hex.encodeHex(sha1(value)));
} | java | @Override
public String hexSHA1(String value) {
return String.valueOf(Hex.encodeHex(sha1(value)));
} | [
"@",
"Override",
"public",
"String",
"hexSHA1",
"(",
"String",
"value",
")",
"{",
"return",
"String",
".",
"valueOf",
"(",
"Hex",
".",
"encodeHex",
"(",
"sha1",
"(",
"value",
")",
")",
")",
";",
"}"
] | Build an hexadecimal SHA1 hash for a String.
@param value The String to hash
@return An hexadecimal Hash | [
"Build",
"an",
"hexadecimal",
"SHA1",
"hash",
"for",
"a",
"String",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/crypto/src/main/java/org/wisdom/crypto/CryptoServiceSingleton.java#L450-L453 |
103,745 | wisdom-framework/wisdom | core/crypto/src/main/java/org/wisdom/crypto/CryptoServiceSingleton.java | CryptoServiceSingleton.compareSignedTokens | @Override
public boolean compareSignedTokens(String tokenA, String tokenB) {
String a = extractSignedToken(tokenA);
String b = extractSignedToken(tokenB);
return a != null && b != null && constantTimeEquals(a, b);
} | java | @Override
public boolean compareSignedTokens(String tokenA, String tokenB) {
String a = extractSignedToken(tokenA);
String b = extractSignedToken(tokenB);
return a != null && b != null && constantTimeEquals(a, b);
} | [
"@",
"Override",
"public",
"boolean",
"compareSignedTokens",
"(",
"String",
"tokenA",
",",
"String",
"tokenB",
")",
"{",
"String",
"a",
"=",
"extractSignedToken",
"(",
"tokenA",
")",
";",
"String",
"b",
"=",
"extractSignedToken",
"(",
"tokenB",
")",
";",
"re... | Compares two signed tokens.
@param tokenA the first token
@param tokenB the second token
@return {@code true} if the tokens are equals, {@code false} otherwise | [
"Compares",
"two",
"signed",
"tokens",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/crypto/src/main/java/org/wisdom/crypto/CryptoServiceSingleton.java#L484-L489 |
103,746 | wisdom-framework/wisdom | core/crypto/src/main/java/org/wisdom/crypto/CryptoServiceSingleton.java | CryptoServiceSingleton.md5 | @Override
public byte[] md5(String toHash) {
try {
MessageDigest messageDigest = MessageDigest.getInstance(Hash.MD5.toString());
messageDigest.reset();
messageDigest.update(toHash.getBytes(UTF_8));
return messageDigest.digest();
} catch (NoSuchAlgorith... | java | @Override
public byte[] md5(String toHash) {
try {
MessageDigest messageDigest = MessageDigest.getInstance(Hash.MD5.toString());
messageDigest.reset();
messageDigest.update(toHash.getBytes(UTF_8));
return messageDigest.digest();
} catch (NoSuchAlgorith... | [
"@",
"Override",
"public",
"byte",
"[",
"]",
"md5",
"(",
"String",
"toHash",
")",
"{",
"try",
"{",
"MessageDigest",
"messageDigest",
"=",
"MessageDigest",
".",
"getInstance",
"(",
"Hash",
".",
"MD5",
".",
"toString",
"(",
")",
")",
";",
"messageDigest",
... | Computes the MD5 hash of the given String.
@param toHash the string to hash
@return the MD5 hash | [
"Computes",
"the",
"MD5",
"hash",
"of",
"the",
"given",
"String",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/crypto/src/main/java/org/wisdom/crypto/CryptoServiceSingleton.java#L497-L508 |
103,747 | wisdom-framework/wisdom | core/wisdom-executors/src/main/java/org/wisdom/executors/ScheduledTask.java | ScheduledTask.asRunnable | public Runnable asRunnable() {
return new Runnable() {
@Override
public void run() {
try {
callable.call();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
};
} | java | public Runnable asRunnable() {
return new Runnable() {
@Override
public void run() {
try {
callable.call();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
};
} | [
"public",
"Runnable",
"asRunnable",
"(",
")",
"{",
"return",
"new",
"Runnable",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"run",
"(",
")",
"{",
"try",
"{",
"callable",
".",
"call",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{... | Wraps the enhanced callable as a runnable.
@return the wrapped runnable. | [
"Wraps",
"the",
"enhanced",
"callable",
"as",
"a",
"runnable",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-executors/src/main/java/org/wisdom/executors/ScheduledTask.java#L96-L107 |
103,748 | wisdom-framework/wisdom | core/wisdom-api/src/main/java/org/wisdom/api/utils/CookieDataCodec.java | CookieDataCodec.safeEquals | public static boolean safeEquals(String a, String b) {
if (a.length() != b.length()) {
return false;
} else {
char equal = 0;
for (int i = 0; i < a.length(); i++) {
equal |= a.charAt(i) ^ b.charAt(i);
}
return equal == 0;
... | java | public static boolean safeEquals(String a, String b) {
if (a.length() != b.length()) {
return false;
} else {
char equal = 0;
for (int i = 0; i < a.length(); i++) {
equal |= a.charAt(i) ^ b.charAt(i);
}
return equal == 0;
... | [
"public",
"static",
"boolean",
"safeEquals",
"(",
"String",
"a",
",",
"String",
"b",
")",
"{",
"if",
"(",
"a",
".",
"length",
"(",
")",
"!=",
"b",
".",
"length",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"else",
"{",
"char",
"equal",
"=",
... | Constant time for same length String comparison, to prevent timing attacks. | [
"Constant",
"time",
"for",
"same",
"length",
"String",
"comparison",
"to",
"prevent",
"timing",
"attacks",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-api/src/main/java/org/wisdom/api/utils/CookieDataCodec.java#L87-L97 |
103,749 | wisdom-framework/wisdom | core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/Server.java | Server.from | public static Server from(ServiceAccessor accessor,
Vertx vertx,
String name,
Configuration configuration) {
return new Server(
accessor,
vertx,
name,
configu... | java | public static Server from(ServiceAccessor accessor,
Vertx vertx,
String name,
Configuration configuration) {
return new Server(
accessor,
vertx,
name,
configu... | [
"public",
"static",
"Server",
"from",
"(",
"ServiceAccessor",
"accessor",
",",
"Vertx",
"vertx",
",",
"String",
"name",
",",
"Configuration",
"configuration",
")",
"{",
"return",
"new",
"Server",
"(",
"accessor",
",",
"vertx",
",",
"name",
",",
"configuration"... | Creates a new server from the given configuration object.
@param accessor the service accessor
@param vertx the vertx singleton
@param name the server name
@param configuration the configuration
@return the configured server (not bound, not started) | [
"Creates",
"a",
"new",
"server",
"from",
"the",
"given",
"configuration",
"object",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/Server.java#L169-L185 |
103,750 | wisdom-framework/wisdom | core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/Server.java | Server.accept | public boolean accept(String path) {
if (allow.isEmpty() && deny.isEmpty()) {
return true;
}
// Check if the path is denied
for (Pattern p : deny) {
if (p.matcher(path).matches()) {
return false;
}
}
// Check if the pat... | java | public boolean accept(String path) {
if (allow.isEmpty() && deny.isEmpty()) {
return true;
}
// Check if the path is denied
for (Pattern p : deny) {
if (p.matcher(path).matches()) {
return false;
}
}
// Check if the pat... | [
"public",
"boolean",
"accept",
"(",
"String",
"path",
")",
"{",
"if",
"(",
"allow",
".",
"isEmpty",
"(",
")",
"&&",
"deny",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"true",
";",
"}",
"// Check if the path is denied",
"for",
"(",
"Pattern",
"p",
":... | Checks whether the given path is accepted or rejected by the current server.
@param path the path
@return {@code true} if the path is accepted, {@code false} otherwise. | [
"Checks",
"whether",
"the",
"given",
"path",
"is",
"accepted",
"or",
"rejected",
"by",
"the",
"current",
"server",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/Server.java#L314-L334 |
103,751 | wisdom-framework/wisdom | core/wisdom-ipojo-module/src/main/java/org/wisdom/ipojo/module/ElementHelper.java | ElementHelper.declareInstance | public static Element declareInstance(ComponentWorkbench workbench) {
Element instance = new Element("instance", "");
instance.addAttribute(new Attribute(COMPONENT, workbench.getType().getClassName()));
return instance;
} | java | public static Element declareInstance(ComponentWorkbench workbench) {
Element instance = new Element("instance", "");
instance.addAttribute(new Attribute(COMPONENT, workbench.getType().getClassName()));
return instance;
} | [
"public",
"static",
"Element",
"declareInstance",
"(",
"ComponentWorkbench",
"workbench",
")",
"{",
"Element",
"instance",
"=",
"new",
"Element",
"(",
"\"instance\"",
",",
"\"\"",
")",
";",
"instance",
".",
"addAttribute",
"(",
"new",
"Attribute",
"(",
"COMPONEN... | Declares an instance.
@param workbench the workbench
@return the Instance element | [
"Declares",
"an",
"instance",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-ipojo-module/src/main/java/org/wisdom/ipojo/module/ElementHelper.java#L43-L47 |
103,752 | wisdom-framework/wisdom | core/wisdom-ipojo-module/src/main/java/org/wisdom/ipojo/module/ElementHelper.java | ElementHelper.getProvidesElement | public static Element getProvidesElement(String specifications) {
Element provides = new Element("provides", "");
if (specifications == null) {
return provides;
} else {
Attribute attribute = new Attribute("specifications", specifications);
provides.addAttribu... | java | public static Element getProvidesElement(String specifications) {
Element provides = new Element("provides", "");
if (specifications == null) {
return provides;
} else {
Attribute attribute = new Attribute("specifications", specifications);
provides.addAttribu... | [
"public",
"static",
"Element",
"getProvidesElement",
"(",
"String",
"specifications",
")",
"{",
"Element",
"provides",
"=",
"new",
"Element",
"(",
"\"provides\"",
",",
"\"\"",
")",
";",
"if",
"(",
"specifications",
"==",
"null",
")",
"{",
"return",
"provides",... | Gets the 'provides' element.
@return the provides element | [
"Gets",
"the",
"provides",
"element",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-ipojo-module/src/main/java/org/wisdom/ipojo/module/ElementHelper.java#L54-L63 |
103,753 | wisdom-framework/wisdom | extensions/wisdom-monitor/src/main/java/org/wisdom/monitor/extensions/wisdom/ControllerModel.java | ControllerModel.from | public static JsonNode from(InstanceDescription description, Json json) {
ObjectNode node = json.newObject();
node.put("classname", description.getComponentDescription().getName())
.put("invalid", description.getState() == ComponentInstance.INVALID)
.put("reason", extract... | java | public static JsonNode from(InstanceDescription description, Json json) {
ObjectNode node = json.newObject();
node.put("classname", description.getComponentDescription().getName())
.put("invalid", description.getState() == ComponentInstance.INVALID)
.put("reason", extract... | [
"public",
"static",
"JsonNode",
"from",
"(",
"InstanceDescription",
"description",
",",
"Json",
"json",
")",
"{",
"ObjectNode",
"node",
"=",
"json",
".",
"newObject",
"(",
")",
";",
"node",
".",
"put",
"(",
"\"classname\"",
",",
"description",
".",
"getCompo... | Creates the Json representation for an invalid controller.
@param description the instance's description
@param json the json service
@return the json representation | [
"Creates",
"the",
"Json",
"representation",
"for",
"an",
"invalid",
"controller",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-monitor/src/main/java/org/wisdom/monitor/extensions/wisdom/ControllerModel.java#L63-L69 |
103,754 | wisdom-framework/wisdom | extensions/wisdom-monitor/src/main/java/org/wisdom/monitor/extensions/wisdom/ControllerModel.java | ControllerModel.extractTemplateName | private static String extractTemplateName(String filter) {
Matcher matcher = TEMPLATE_FILTER_PATTERN.matcher(filter);
if (matcher.matches()) {
return matcher.group(1);
} else {
return "Unknown template";
}
} | java | private static String extractTemplateName(String filter) {
Matcher matcher = TEMPLATE_FILTER_PATTERN.matcher(filter);
if (matcher.matches()) {
return matcher.group(1);
} else {
return "Unknown template";
}
} | [
"private",
"static",
"String",
"extractTemplateName",
"(",
"String",
"filter",
")",
"{",
"Matcher",
"matcher",
"=",
"TEMPLATE_FILTER_PATTERN",
".",
"matcher",
"(",
"filter",
")",
";",
"if",
"(",
"matcher",
".",
"matches",
"(",
")",
")",
"{",
"return",
"match... | Extracts the template name from the given LDAP filter.
The LDAP filter is structure as established in the WisdomViewVisitor.
@param filter the filter
@return the extracted template name | [
"Extracts",
"the",
"template",
"name",
"from",
"the",
"given",
"LDAP",
"filter",
".",
"The",
"LDAP",
"filter",
"is",
"structure",
"as",
"established",
"in",
"the",
"WisdomViewVisitor",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-monitor/src/main/java/org/wisdom/monitor/extensions/wisdom/ControllerModel.java#L135-L142 |
103,755 | wisdom-framework/wisdom | extensions/wisdom-monitor/src/main/java/org/wisdom/monitor/extensions/wisdom/ControllerModel.java | ControllerModel.extractModelName | private static String extractModelName(String filter) {
Matcher matcher = MODEL_FILTER_PATTERN.matcher(filter);
if (matcher.matches()) {
return matcher.group(1);
} else {
return "Unknown model";
}
} | java | private static String extractModelName(String filter) {
Matcher matcher = MODEL_FILTER_PATTERN.matcher(filter);
if (matcher.matches()) {
return matcher.group(1);
} else {
return "Unknown model";
}
} | [
"private",
"static",
"String",
"extractModelName",
"(",
"String",
"filter",
")",
"{",
"Matcher",
"matcher",
"=",
"MODEL_FILTER_PATTERN",
".",
"matcher",
"(",
"filter",
")",
";",
"if",
"(",
"matcher",
".",
"matches",
"(",
")",
")",
"{",
"return",
"matcher",
... | Extracts the model name from the given LDAP filter.
The LDAP filter is structure as established in the WisdomModelVisitor.
@param filter the filter
@return the extracted template name | [
"Extracts",
"the",
"model",
"name",
"from",
"the",
"given",
"LDAP",
"filter",
".",
"The",
"LDAP",
"filter",
"is",
"structure",
"as",
"established",
"in",
"the",
"WisdomModelVisitor",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-monitor/src/main/java/org/wisdom/monitor/extensions/wisdom/ControllerModel.java#L151-L158 |
103,756 | wisdom-framework/wisdom | core/wisdom-ipojo-module/src/main/java/org/wisdom/ipojo/module/WisdomModelVisitor.java | WisdomModelVisitor.visitEnd | @Override
public void visitEnd() {
if (name == null || name.length() == 0) {
reporter.error("The 'name' attribute of @Model from " + workbench.getType().getClassName() + " must be " +
"set");
return;
}
// Check the type of the field
if (!... | java | @Override
public void visitEnd() {
if (name == null || name.length() == 0) {
reporter.error("The 'name' attribute of @Model from " + workbench.getType().getClassName() + " must be " +
"set");
return;
}
// Check the type of the field
if (!... | [
"@",
"Override",
"public",
"void",
"visitEnd",
"(",
")",
"{",
"if",
"(",
"name",
"==",
"null",
"||",
"name",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"reporter",
".",
"error",
"(",
"\"The 'name' attribute of @Model from \"",
"+",
"workbench",
".",
"... | Generates the element-attribute structure to be added. | [
"Generates",
"the",
"element",
"-",
"attribute",
"structure",
"to",
"be",
"added",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-ipojo-module/src/main/java/org/wisdom/ipojo/module/WisdomModelVisitor.java#L74-L93 |
103,757 | wisdom-framework/wisdom | core/wisdom-api/src/main/java/org/wisdom/api/interception/RequestContext.java | RequestContext.getConfigurationForInterceptor | <A> A getConfigurationForInterceptor(Interceptor<A> interceptor) {
return (A) interceptors.get(interceptor);
} | java | <A> A getConfigurationForInterceptor(Interceptor<A> interceptor) {
return (A) interceptors.get(interceptor);
} | [
"<",
"A",
">",
"A",
"getConfigurationForInterceptor",
"(",
"Interceptor",
"<",
"A",
">",
"interceptor",
")",
"{",
"return",
"(",
"A",
")",
"interceptors",
".",
"get",
"(",
"interceptor",
")",
";",
"}"
] | Retrieves the configuration annotation for the given interceptor.
@param interceptor the interceptor
@return the configuration, {@code null} if not found | [
"Retrieves",
"the",
"configuration",
"annotation",
"for",
"the",
"given",
"interceptor",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-api/src/main/java/org/wisdom/api/interception/RequestContext.java#L106-L108 |
103,758 | wisdom-framework/wisdom | core/wisdom-api/src/main/java/org/wisdom/api/interception/RequestContext.java | RequestContext.proceed | public Result proceed() throws Exception {
if (iterator == null) {
iterator = chain.listIterator();
}
if (!iterator.hasNext()) {
throw new IllegalStateException("Reached the end of the chain without result.");
}
Filter filter = iterator.next();
ret... | java | public Result proceed() throws Exception {
if (iterator == null) {
iterator = chain.listIterator();
}
if (!iterator.hasNext()) {
throw new IllegalStateException("Reached the end of the chain without result.");
}
Filter filter = iterator.next();
ret... | [
"public",
"Result",
"proceed",
"(",
")",
"throws",
"Exception",
"{",
"if",
"(",
"iterator",
"==",
"null",
")",
"{",
"iterator",
"=",
"chain",
".",
"listIterator",
"(",
")",
";",
"}",
"if",
"(",
"!",
"iterator",
".",
"hasNext",
"(",
")",
")",
"{",
"... | Calls the next interceptors.
@return the result from the next interceptor
@throws java.lang.Exception if the invocation fails. | [
"Calls",
"the",
"next",
"interceptors",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-api/src/main/java/org/wisdom/api/interception/RequestContext.java#L116-L125 |
103,759 | wisdom-framework/wisdom | core/wisdom-api/src/main/java/org/wisdom/api/router/RouteBuilder.java | RouteBuilder._build | private Route _build() {
Preconditions.checkNotNull(controller);
Preconditions.checkNotNull(httpMethod);
Preconditions.checkNotNull(uri);
Preconditions.checkNotNull(httpMethod);
return new Route(httpMethod, uri, controller, controllerMethod);
} | java | private Route _build() {
Preconditions.checkNotNull(controller);
Preconditions.checkNotNull(httpMethod);
Preconditions.checkNotNull(uri);
Preconditions.checkNotNull(httpMethod);
return new Route(httpMethod, uri, controller, controllerMethod);
} | [
"private",
"Route",
"_build",
"(",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"controller",
")",
";",
"Preconditions",
".",
"checkNotNull",
"(",
"httpMethod",
")",
";",
"Preconditions",
".",
"checkNotNull",
"(",
"uri",
")",
";",
"Preconditions",
".",... | Internal method building the route.
@return the route. | [
"Internal",
"method",
"building",
"the",
"route",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-api/src/main/java/org/wisdom/api/router/RouteBuilder.java#L122-L129 |
103,760 | wisdom-framework/wisdom | core/wisdom-api/src/main/java/org/wisdom/api/router/RouteBuilder.java | RouteBuilder.verifyThatControllerAndMethodExists | private Method verifyThatControllerAndMethodExists(Class<?> controller,
String controllerMethod) throws NoSuchMethodException {
Method methodFromQueryingClass = null;
// 1. Make sure method is in class
// 2. Make sure only one method is th... | java | private Method verifyThatControllerAndMethodExists(Class<?> controller,
String controllerMethod) throws NoSuchMethodException {
Method methodFromQueryingClass = null;
// 1. Make sure method is in class
// 2. Make sure only one method is th... | [
"private",
"Method",
"verifyThatControllerAndMethodExists",
"(",
"Class",
"<",
"?",
">",
"controller",
",",
"String",
"controllerMethod",
")",
"throws",
"NoSuchMethodException",
"{",
"Method",
"methodFromQueryingClass",
"=",
"null",
";",
"// 1. Make sure method is in class"... | Checks that the action method really exists.
@param controller the controller object
@param controllerMethod the method name
@return the Method object.
@throws NoSuchMethodException if the action method does not exist in the given controller object. | [
"Checks",
"that",
"the",
"action",
"method",
"really",
"exists",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-api/src/main/java/org/wisdom/api/router/RouteBuilder.java#L139-L171 |
103,761 | wisdom-framework/wisdom | extensions/wisdom-raml/wisdom-source-watcher/src/main/java/org/wisdom/source/mojo/AbstractWisdomSourceWatcherMojo.java | AbstractWisdomSourceWatcherMojo.accept | public boolean accept(File file) {
if( !WatcherUtils.isInDirectory(file, javaSourceDir) || !WatcherUtils.hasExtension(file,"java")){
return false;
}
// If the file has been deleted by may have been a controller, return true.
// The cleanup will be applied.
if (! file... | java | public boolean accept(File file) {
if( !WatcherUtils.isInDirectory(file, javaSourceDir) || !WatcherUtils.hasExtension(file,"java")){
return false;
}
// If the file has been deleted by may have been a controller, return true.
// The cleanup will be applied.
if (! file... | [
"public",
"boolean",
"accept",
"(",
"File",
"file",
")",
"{",
"if",
"(",
"!",
"WatcherUtils",
".",
"isInDirectory",
"(",
"file",
",",
"javaSourceDir",
")",
"||",
"!",
"WatcherUtils",
".",
"hasExtension",
"(",
"file",
",",
"\"java\"",
")",
")",
"{",
"retu... | Check if we can create a model from the given source.
@param file {@link File} required to be processed by this plugin.
@return <code>true</code> if the <code>file</code> implements
{@link org.wisdom.api.Controller}, <code>false</code> otherwise. | [
"Check",
"if",
"we",
"can",
"create",
"a",
"model",
"from",
"the",
"given",
"source",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-raml/wisdom-source-watcher/src/main/java/org/wisdom/source/mojo/AbstractWisdomSourceWatcherMojo.java#L114-L135 |
103,762 | wisdom-framework/wisdom | extensions/wisdom-monitor/src/main/java/org/wisdom/monitor/extensions/wisdom/RouteModel.java | RouteModel.from | public static ObjectNode from(Route route, Json json) {
return json.newObject().put("url", route.getUrl())
.put("controller", route.getControllerClass().getName())
.put("method", route.getControllerMethod().getName())
.put("http_method", route.getHttpMethod().toSt... | java | public static ObjectNode from(Route route, Json json) {
return json.newObject().put("url", route.getUrl())
.put("controller", route.getControllerClass().getName())
.put("method", route.getControllerMethod().getName())
.put("http_method", route.getHttpMethod().toSt... | [
"public",
"static",
"ObjectNode",
"from",
"(",
"Route",
"route",
",",
"Json",
"json",
")",
"{",
"return",
"json",
".",
"newObject",
"(",
")",
".",
"put",
"(",
"\"url\"",
",",
"route",
".",
"getUrl",
"(",
")",
")",
".",
"put",
"(",
"\"controller\"",
"... | Creates the JSON representation of the given route.
@param route the route
@param json the JSON service
@return the json representation | [
"Creates",
"the",
"JSON",
"representation",
"of",
"the",
"given",
"route",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-monitor/src/main/java/org/wisdom/monitor/extensions/wisdom/RouteModel.java#L37-L42 |
103,763 | wisdom-framework/wisdom | core/content-manager/src/main/java/org/wisdom/content/jackson/JacksonSingleton.java | JacksonSingleton.toJsonP | public String toJsonP(final String callback, final Object data) {
synchronized (lock) {
try {
return callback + "(" + stringify((JsonNode) mapper.valueToTree(data)) + ");";
} catch (Exception e) {
throw new RuntimeException(e);
}
}
... | java | public String toJsonP(final String callback, final Object data) {
synchronized (lock) {
try {
return callback + "(" + stringify((JsonNode) mapper.valueToTree(data)) + ");";
} catch (Exception e) {
throw new RuntimeException(e);
}
}
... | [
"public",
"String",
"toJsonP",
"(",
"final",
"String",
"callback",
",",
"final",
"Object",
"data",
")",
"{",
"synchronized",
"(",
"lock",
")",
"{",
"try",
"{",
"return",
"callback",
"+",
"\"(\"",
"+",
"stringify",
"(",
"(",
"JsonNode",
")",
"mapper",
"."... | Gets the JSONP response for the given callback and value.
@param callback the callback name
@param data the data to transform to json
@return the String built as follows: "callback(json(data))" | [
"Gets",
"the",
"JSONP",
"response",
"for",
"the",
"given",
"callback",
"and",
"value",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/content-manager/src/main/java/org/wisdom/content/jackson/JacksonSingleton.java#L154-L162 |
103,764 | wisdom-framework/wisdom | core/content-manager/src/main/java/org/wisdom/content/jackson/JacksonSingleton.java | JacksonSingleton.stringify | public String stringify(JsonNode json) {
try {
return mapper().writerWithDefaultPrettyPrinter().writeValueAsString(json);
} catch (JsonProcessingException e) {
throw new RuntimeException("Cannot stringify the input json node", e);
}
} | java | public String stringify(JsonNode json) {
try {
return mapper().writerWithDefaultPrettyPrinter().writeValueAsString(json);
} catch (JsonProcessingException e) {
throw new RuntimeException("Cannot stringify the input json node", e);
}
} | [
"public",
"String",
"stringify",
"(",
"JsonNode",
"json",
")",
"{",
"try",
"{",
"return",
"mapper",
"(",
")",
".",
"writerWithDefaultPrettyPrinter",
"(",
")",
".",
"writeValueAsString",
"(",
"json",
")",
";",
"}",
"catch",
"(",
"JsonProcessingException",
"e",
... | Converts a JsonNode to its string representation.
This implementation use a `pretty printer`.
@param json the json node
@return the String representation of the given Json Object
@throws java.lang.RuntimeException if the String form cannot be created | [
"Converts",
"a",
"JsonNode",
"to",
"its",
"string",
"representation",
".",
"This",
"implementation",
"use",
"a",
"pretty",
"printer",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/content-manager/src/main/java/org/wisdom/content/jackson/JacksonSingleton.java#L209-L215 |
103,765 | wisdom-framework/wisdom | core/content-manager/src/main/java/org/wisdom/content/jackson/JacksonSingleton.java | JacksonSingleton.parse | public JsonNode parse(String src) {
synchronized (lock) {
try {
return mapper.readValue(src, JsonNode.class);
} catch (Exception t) {
throw new RuntimeException(t);
}
}
} | java | public JsonNode parse(String src) {
synchronized (lock) {
try {
return mapper.readValue(src, JsonNode.class);
} catch (Exception t) {
throw new RuntimeException(t);
}
}
} | [
"public",
"JsonNode",
"parse",
"(",
"String",
"src",
")",
"{",
"synchronized",
"(",
"lock",
")",
"{",
"try",
"{",
"return",
"mapper",
".",
"readValue",
"(",
"src",
",",
"JsonNode",
".",
"class",
")",
";",
"}",
"catch",
"(",
"Exception",
"t",
")",
"{"... | Parses a String representing a json, and return it as a JsonNode.
@param src the JSON String
@return the Json Node
@throws java.lang.RuntimeException if the given string is not a valid JSON String | [
"Parses",
"a",
"String",
"representing",
"a",
"json",
"and",
"return",
"it",
"as",
"a",
"JsonNode",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/content-manager/src/main/java/org/wisdom/content/jackson/JacksonSingleton.java#L224-L232 |
103,766 | wisdom-framework/wisdom | core/content-manager/src/main/java/org/wisdom/content/jackson/JacksonSingleton.java | JacksonSingleton.setMappers | private void setMappers(ObjectMapper mapper, XmlMapper xml) {
synchronized (lock) {
this.mapper = mapper;
this.xml = xml;
// mapper and xml are set to null on invalidation.
if (mapper != null && xml != null) {
applyMapperConfiguration(mapper, xml);... | java | private void setMappers(ObjectMapper mapper, XmlMapper xml) {
synchronized (lock) {
this.mapper = mapper;
this.xml = xml;
// mapper and xml are set to null on invalidation.
if (mapper != null && xml != null) {
applyMapperConfiguration(mapper, xml);... | [
"private",
"void",
"setMappers",
"(",
"ObjectMapper",
"mapper",
",",
"XmlMapper",
"xml",
")",
"{",
"synchronized",
"(",
"lock",
")",
"{",
"this",
".",
"mapper",
"=",
"mapper",
";",
"this",
".",
"xml",
"=",
"xml",
";",
"// mapper and xml are set to null on inva... | Sets the object mapper.
@param mapper the object mapper to use | [
"Sets",
"the",
"object",
"mapper",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/content-manager/src/main/java/org/wisdom/content/jackson/JacksonSingleton.java#L287-L296 |
103,767 | wisdom-framework/wisdom | core/content-manager/src/main/java/org/wisdom/content/jackson/JacksonSingleton.java | JacksonSingleton.register | @Override
public void register(Module module) {
if (module == null) {
return;
}
LOGGER.info("Adding JSON module {}", module.getModuleName());
synchronized (lock) {
modules.add(module);
rebuildMappers();
}
} | java | @Override
public void register(Module module) {
if (module == null) {
return;
}
LOGGER.info("Adding JSON module {}", module.getModuleName());
synchronized (lock) {
modules.add(module);
rebuildMappers();
}
} | [
"@",
"Override",
"public",
"void",
"register",
"(",
"Module",
"module",
")",
"{",
"if",
"(",
"module",
"==",
"null",
")",
"{",
"return",
";",
"}",
"LOGGER",
".",
"info",
"(",
"\"Adding JSON module {}\"",
",",
"module",
".",
"getModuleName",
"(",
")",
")"... | Registers a new Jackson Module.
@param module the module to register | [
"Registers",
"a",
"new",
"Jackson",
"Module",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/content-manager/src/main/java/org/wisdom/content/jackson/JacksonSingleton.java#L384-L394 |
103,768 | wisdom-framework/wisdom | core/content-manager/src/main/java/org/wisdom/content/jackson/JacksonSingleton.java | JacksonSingleton.unregister | @Override
public void unregister(Module module) {
if (module == null) {
// May happen on departure.
return;
}
LOGGER.info("Removing Jackson module {}", module.getModuleName());
synchronized (lock) {
if (modules.remove(module)) {
reb... | java | @Override
public void unregister(Module module) {
if (module == null) {
// May happen on departure.
return;
}
LOGGER.info("Removing Jackson module {}", module.getModuleName());
synchronized (lock) {
if (modules.remove(module)) {
reb... | [
"@",
"Override",
"public",
"void",
"unregister",
"(",
"Module",
"module",
")",
"{",
"if",
"(",
"module",
"==",
"null",
")",
"{",
"// May happen on departure.",
"return",
";",
"}",
"LOGGER",
".",
"info",
"(",
"\"Removing Jackson module {}\"",
",",
"module",
"."... | Un-registers a JSON Module.
@param module the module | [
"Un",
"-",
"registers",
"a",
"JSON",
"Module",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/content-manager/src/main/java/org/wisdom/content/jackson/JacksonSingleton.java#L415-L427 |
103,769 | wisdom-framework/wisdom | core/content-manager/src/main/java/org/wisdom/content/jackson/JacksonSingleton.java | JacksonSingleton.fromInputStream | @Override
public Document fromInputStream(InputStream stream, Charset encoding) throws IOException {
try {
DocumentBuilder builder = factory.newDocumentBuilder();
InputSource is = new InputSource(stream);
if (encoding == null) {
is.setEncoding(Charsets.UT... | java | @Override
public Document fromInputStream(InputStream stream, Charset encoding) throws IOException {
try {
DocumentBuilder builder = factory.newDocumentBuilder();
InputSource is = new InputSource(stream);
if (encoding == null) {
is.setEncoding(Charsets.UT... | [
"@",
"Override",
"public",
"Document",
"fromInputStream",
"(",
"InputStream",
"stream",
",",
"Charset",
"encoding",
")",
"throws",
"IOException",
"{",
"try",
"{",
"DocumentBuilder",
"builder",
"=",
"factory",
".",
"newDocumentBuilder",
"(",
")",
";",
"InputSource"... | Builds a new XML Document from the given input stream. The stream is not closed by this method,
and so you must close it.
@param stream the input stream, must not be {@literal null}
@param encoding the encoding, if {@literal null}, UTF-8 is used.
@return the built document
@throws java.io.IOException if the given st... | [
"Builds",
"a",
"new",
"XML",
"Document",
"from",
"the",
"given",
"input",
"stream",
".",
"The",
"stream",
"is",
"not",
"closed",
"by",
"this",
"method",
"and",
"so",
"you",
"must",
"close",
"it",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/content-manager/src/main/java/org/wisdom/content/jackson/JacksonSingleton.java#L477-L494 |
103,770 | wisdom-framework/wisdom | core/content-manager/src/main/java/org/wisdom/content/jackson/JacksonSingleton.java | JacksonSingleton.stringify | @Override
public String stringify(Document document) {
try {
StringWriter sw = new StringWriter();
TransformerFactory tf = TransformerFactory.newInstance();
Transformer transformer = tf.newTransformer();
transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLAR... | java | @Override
public String stringify(Document document) {
try {
StringWriter sw = new StringWriter();
TransformerFactory tf = TransformerFactory.newInstance();
Transformer transformer = tf.newTransformer();
transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLAR... | [
"@",
"Override",
"public",
"String",
"stringify",
"(",
"Document",
"document",
")",
"{",
"try",
"{",
"StringWriter",
"sw",
"=",
"new",
"StringWriter",
"(",
")",
";",
"TransformerFactory",
"tf",
"=",
"TransformerFactory",
".",
"newInstance",
"(",
")",
";",
"T... | Retrieves the string form of the given XML document.
@param document the XML document, must not be {@literal null}
@return the String form of the object | [
"Retrieves",
"the",
"string",
"form",
"of",
"the",
"given",
"XML",
"document",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/content-manager/src/main/java/org/wisdom/content/jackson/JacksonSingleton.java#L530-L546 |
103,771 | wisdom-framework/wisdom | core/content-manager/src/main/java/org/wisdom/content/jackson/JacksonSingleton.java | JacksonSingleton.bindModule | @Bind(optional = true, aggregate = true)
public synchronized void bindModule(Module module) {
register(module);
} | java | @Bind(optional = true, aggregate = true)
public synchronized void bindModule(Module module) {
register(module);
} | [
"@",
"Bind",
"(",
"optional",
"=",
"true",
",",
"aggregate",
"=",
"true",
")",
"public",
"synchronized",
"void",
"bindModule",
"(",
"Module",
"module",
")",
"{",
"register",
"(",
"module",
")",
";",
"}"
] | Binds a module.
@param module the module | [
"Binds",
"a",
"module",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/content-manager/src/main/java/org/wisdom/content/jackson/JacksonSingleton.java#L566-L569 |
103,772 | wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/pipeline/Watchers.java | Watchers.remove | public static synchronized boolean remove(MavenSession session, Watcher watcher) {
return !(session == null || watcher == null) && get(session).remove(watcher);
} | java | public static synchronized boolean remove(MavenSession session, Watcher watcher) {
return !(session == null || watcher == null) && get(session).remove(watcher);
} | [
"public",
"static",
"synchronized",
"boolean",
"remove",
"(",
"MavenSession",
"session",
",",
"Watcher",
"watcher",
")",
"{",
"return",
"!",
"(",
"session",
"==",
"null",
"||",
"watcher",
"==",
"null",
")",
"&&",
"get",
"(",
"session",
")",
".",
"remove",
... | Un-registers a watcher.
@param session the Maven session
@param watcher the watcher to remove
@return {@literal true} if the watcher was removed, {@literal false} otherwise. | [
"Un",
"-",
"registers",
"a",
"watcher",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/pipeline/Watchers.java#L67-L69 |
103,773 | wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/pipeline/Watchers.java | Watchers.get | static synchronized List<Watcher> get(MavenSession session) {
List<Watcher> watchers = (List<Watcher>) session.getExecutionProperties().get(WATCHERS_KEY);
if (watchers == null) {
watchers = new ArrayList<>();
session.getExecutionProperties().put(WATCHERS_KEY, watchers);
}... | java | static synchronized List<Watcher> get(MavenSession session) {
List<Watcher> watchers = (List<Watcher>) session.getExecutionProperties().get(WATCHERS_KEY);
if (watchers == null) {
watchers = new ArrayList<>();
session.getExecutionProperties().put(WATCHERS_KEY, watchers);
}... | [
"static",
"synchronized",
"List",
"<",
"Watcher",
">",
"get",
"(",
"MavenSession",
"session",
")",
"{",
"List",
"<",
"Watcher",
">",
"watchers",
"=",
"(",
"List",
"<",
"Watcher",
">",
")",
"session",
".",
"getExecutionProperties",
"(",
")",
".",
"get",
"... | Gets the list of watchers from the given MavenSession.
@param session the Maven session
@return the list of watcher, empty if none. Modifying the resulting list, updates the stored list. | [
"Gets",
"the",
"list",
"of",
"watchers",
"from",
"the",
"given",
"MavenSession",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/pipeline/Watchers.java#L88-L95 |
103,774 | wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/pipeline/Watchers.java | Watchers.get | static synchronized List<Watcher> get(Context context) {
List<Watcher> watchers;
if (context.contains(WATCHERS_KEY)) {
try {
watchers = (List<Watcher>) context.get(WATCHERS_KEY);
} catch (ContextException e) {
throw new IllegalStateException("Canno... | java | static synchronized List<Watcher> get(Context context) {
List<Watcher> watchers;
if (context.contains(WATCHERS_KEY)) {
try {
watchers = (List<Watcher>) context.get(WATCHERS_KEY);
} catch (ContextException e) {
throw new IllegalStateException("Canno... | [
"static",
"synchronized",
"List",
"<",
"Watcher",
">",
"get",
"(",
"Context",
"context",
")",
"{",
"List",
"<",
"Watcher",
">",
"watchers",
";",
"if",
"(",
"context",
".",
"contains",
"(",
"WATCHERS_KEY",
")",
")",
"{",
"try",
"{",
"watchers",
"=",
"("... | Gets the list of watchers from the given Plexus context.
@param context the Plexus context
@return the list of watcher, empty if none. Modifying the resulting list, updates the stored list. | [
"Gets",
"the",
"list",
"of",
"watchers",
"from",
"the",
"given",
"Plexus",
"context",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/pipeline/Watchers.java#L103-L116 |
103,775 | wisdom-framework/wisdom | framework/hibernate-validation-service/src/main/java/org/wisdom/validation/hibernate/ConstraintViolationSerializer.java | ConstraintViolationSerializer.serialize | @Override
public void serialize(ConstraintViolationImpl constraintViolation, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
jsonGenerator.writeStartObject();
jsonGenerator.writeStringField("message", constraintViolation.getMessage());
Object invalidV... | java | @Override
public void serialize(ConstraintViolationImpl constraintViolation, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
jsonGenerator.writeStartObject();
jsonGenerator.writeStringField("message", constraintViolation.getMessage());
Object invalidV... | [
"@",
"Override",
"public",
"void",
"serialize",
"(",
"ConstraintViolationImpl",
"constraintViolation",
",",
"JsonGenerator",
"jsonGenerator",
",",
"SerializerProvider",
"serializerProvider",
")",
"throws",
"IOException",
"{",
"jsonGenerator",
".",
"writeStartObject",
"(",
... | Writes the JSON form of the Constraint Violation.
@param constraintViolation the violation
@param jsonGenerator the generator
@param serializerProvider the provider
@throws IOException if it cannot be serialized | [
"Writes",
"the",
"JSON",
"form",
"of",
"the",
"Constraint",
"Violation",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/framework/hibernate-validation-service/src/main/java/org/wisdom/validation/hibernate/ConstraintViolationSerializer.java#L54-L66 |
103,776 | wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/ChameleonInstanceHolder.java | ChameleonInstanceHolder.set | public static synchronized void set(Chameleon chameleon) {
if (INSTANCE != null && chameleon != null) {
throw new IllegalStateException("A Chameleon instance is already stored");
}
INSTANCE = chameleon;
if (chameleon == null) {
// Reset metadata
HOST_N... | java | public static synchronized void set(Chameleon chameleon) {
if (INSTANCE != null && chameleon != null) {
throw new IllegalStateException("A Chameleon instance is already stored");
}
INSTANCE = chameleon;
if (chameleon == null) {
// Reset metadata
HOST_N... | [
"public",
"static",
"synchronized",
"void",
"set",
"(",
"Chameleon",
"chameleon",
")",
"{",
"if",
"(",
"INSTANCE",
"!=",
"null",
"&&",
"chameleon",
"!=",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"A Chameleon instance is already stored\"",
... | Stores a reference on a running chameleon.
@param chameleon the chameleon | [
"Stores",
"a",
"reference",
"on",
"a",
"running",
"chameleon",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/ChameleonInstanceHolder.java#L67-L78 |
103,777 | wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/ChameleonInstanceHolder.java | ChameleonInstanceHolder.retrieveServerMetadata | private static void retrieveServerMetadata() throws Exception {
if (get() == null) {
throw new IllegalStateException("Cannot retrieve the server metadata - no reference to Chameleon stored " +
"in the holder");
}
int factor = Integer.getInteger("time.factor", 1);... | java | private static void retrieveServerMetadata() throws Exception {
if (get() == null) {
throw new IllegalStateException("Cannot retrieve the server metadata - no reference to Chameleon stored " +
"in the holder");
}
int factor = Integer.getInteger("time.factor", 1);... | [
"private",
"static",
"void",
"retrieveServerMetadata",
"(",
")",
"throws",
"Exception",
"{",
"if",
"(",
"get",
"(",
")",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Cannot retrieve the server metadata - no reference to Chameleon stored \"",
... | Methods call by the test framework to discover the server name and port.
@throws Exception if the service is not running. | [
"Methods",
"call",
"by",
"the",
"test",
"framework",
"to",
"discover",
"the",
"server",
"name",
"and",
"port",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/ChameleonInstanceHolder.java#L168-L195 |
103,778 | wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/ExecUtils.java | ExecUtils.isLinux | public static boolean isLinux(String os) {
if (os == null) {
return false;
}
String operating = os.toLowerCase();
return operating.contains("nix") || operating.contains("nux") || operating.contains("aix");
} | java | public static boolean isLinux(String os) {
if (os == null) {
return false;
}
String operating = os.toLowerCase();
return operating.contains("nix") || operating.contains("nux") || operating.contains("aix");
} | [
"public",
"static",
"boolean",
"isLinux",
"(",
"String",
"os",
")",
"{",
"if",
"(",
"os",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"String",
"operating",
"=",
"os",
".",
"toLowerCase",
"(",
")",
";",
"return",
"operating",
".",
"contains",
... | Checks whether the given operating system name is Linux, Unix, or AIX.
@param os the operating system name (value of the {@code os.name} system property
@return {@code true} if the os is Linux, Unix, or AIX, {@code false} otherwise. | [
"Checks",
"whether",
"the",
"given",
"operating",
"system",
"name",
"is",
"Linux",
"Unix",
"or",
"AIX",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/ExecUtils.java#L179-L185 |
103,779 | wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/ExecUtils.java | ExecUtils.is64bits | public static boolean is64bits() {
String arch = System.getProperty("sun.arch.data.model");
if (Strings.isNullOrEmpty(arch)) {
arch = System.getProperty("os.arch");
}
return is64bits(arch);
} | java | public static boolean is64bits() {
String arch = System.getProperty("sun.arch.data.model");
if (Strings.isNullOrEmpty(arch)) {
arch = System.getProperty("os.arch");
}
return is64bits(arch);
} | [
"public",
"static",
"boolean",
"is64bits",
"(",
")",
"{",
"String",
"arch",
"=",
"System",
".",
"getProperty",
"(",
"\"sun.arch.data.model\"",
")",
";",
"if",
"(",
"Strings",
".",
"isNullOrEmpty",
"(",
"arch",
")",
")",
"{",
"arch",
"=",
"System",
".",
"... | Checks if the CPU architecture of the current computer is 64 bits.
@return {@code true} if the CPU architecture of the current computer is 64 bits. {@code false} otherwise. This
methods checks first the {@literal sun.arch.data.model} system's property and then the {@literal os.arch} one.
If none of these two propertie... | [
"Checks",
"if",
"the",
"CPU",
"architecture",
"of",
"the",
"current",
"computer",
"is",
"64",
"bits",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/ExecUtils.java#L194-L200 |
103,780 | wisdom-framework/wisdom | core/wisdom-api/src/main/java/org/wisdom/api/router/AbstractRouter.java | AbstractRouter.getReverseRouteFor | @Override
public String getReverseRouteFor(Controller controller, String method) {
return getReverseRouteFor(controller.getClass(), method, null);
} | java | @Override
public String getReverseRouteFor(Controller controller, String method) {
return getReverseRouteFor(controller.getClass(), method, null);
} | [
"@",
"Override",
"public",
"String",
"getReverseRouteFor",
"(",
"Controller",
"controller",
",",
"String",
"method",
")",
"{",
"return",
"getReverseRouteFor",
"(",
"controller",
".",
"getClass",
"(",
")",
",",
"method",
",",
"null",
")",
";",
"}"
] | Gets the url of the route handled by the specified action method. The action does not takes parameters.
@param controller the controller object
@param method the controller method
@return the url, {@literal null} if the action method is not found | [
"Gets",
"the",
"url",
"of",
"the",
"route",
"handled",
"by",
"the",
"specified",
"action",
"method",
".",
"The",
"action",
"does",
"not",
"takes",
"parameters",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-api/src/main/java/org/wisdom/api/router/AbstractRouter.java#L140-L143 |
103,781 | wisdom-framework/wisdom | core/wisdom-api/src/main/java/org/wisdom/api/router/AbstractRouter.java | AbstractRouter.getReverseRouteFor | @Override
public String getReverseRouteFor(Controller controller, String method, String var1, Object val1) {
return getReverseRouteFor(controller, method, ImmutableMap.of(var1, val1));
} | java | @Override
public String getReverseRouteFor(Controller controller, String method, String var1, Object val1) {
return getReverseRouteFor(controller, method, ImmutableMap.of(var1, val1));
} | [
"@",
"Override",
"public",
"String",
"getReverseRouteFor",
"(",
"Controller",
"controller",
",",
"String",
"method",
",",
"String",
"var1",
",",
"Object",
"val1",
")",
"{",
"return",
"getReverseRouteFor",
"(",
"controller",
",",
"method",
",",
"ImmutableMap",
".... | Gets the url of the route handled by the specified action method.
@param controller the controller object
@param method the controller method
@param var1 the first parameter name
@param val1 the first parameter value
@return the url, {@literal null} if the action method is not found. | [
"Gets",
"the",
"url",
"of",
"the",
"route",
"handled",
"by",
"the",
"specified",
"action",
"method",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-api/src/main/java/org/wisdom/api/router/AbstractRouter.java#L154-L157 |
103,782 | wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/mojos/JavaScriptCompilerMojo.java | JavaScriptCompilerMojo.isNotMinified | public boolean isNotMinified(File file) {
return !file.getName().endsWith("min.js")
&& !file.getName().endsWith(googleClosureMinifierSuffix + ".js");
} | java | public boolean isNotMinified(File file) {
return !file.getName().endsWith("min.js")
&& !file.getName().endsWith(googleClosureMinifierSuffix + ".js");
} | [
"public",
"boolean",
"isNotMinified",
"(",
"File",
"file",
")",
"{",
"return",
"!",
"file",
".",
"getName",
"(",
")",
".",
"endsWith",
"(",
"\"min.js\"",
")",
"&&",
"!",
"file",
".",
"getName",
"(",
")",
".",
"endsWith",
"(",
"googleClosureMinifierSuffix",... | Checks whether or not the file is minified.
@param file the file to check
@return {@code true} if the file is minified, {@code false} otherwise. This method only check for the file
extension. | [
"Checks",
"whether",
"or",
"not",
"the",
"file",
"is",
"minified",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/mojos/JavaScriptCompilerMojo.java#L342-L345 |
103,783 | wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/mojos/JavaScriptCompilerMojo.java | JavaScriptCompilerMojo.getMinifiedFile | public File getMinifiedFile(File file) {
File output = getOutputFile(file);
return new File(output.getParentFile().getAbsoluteFile(),
output.getName().replace(".js", googleClosureMinifierSuffix + ".js"));
} | java | public File getMinifiedFile(File file) {
File output = getOutputFile(file);
return new File(output.getParentFile().getAbsoluteFile(),
output.getName().replace(".js", googleClosureMinifierSuffix + ".js"));
} | [
"public",
"File",
"getMinifiedFile",
"(",
"File",
"file",
")",
"{",
"File",
"output",
"=",
"getOutputFile",
"(",
"file",
")",
";",
"return",
"new",
"File",
"(",
"output",
".",
"getParentFile",
"(",
")",
".",
"getAbsoluteFile",
"(",
")",
",",
"output",
".... | Computes the file object for the minified version of the given file. The given file must be a '.js' file.
@param file the file
@return the associated minified file | [
"Computes",
"the",
"file",
"object",
"for",
"the",
"minified",
"version",
"of",
"the",
"given",
"file",
".",
"The",
"given",
"file",
"must",
"be",
"a",
".",
"js",
"file",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/mojos/JavaScriptCompilerMojo.java#L353-L357 |
103,784 | wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/mojos/JavaScriptCompilerMojo.java | JavaScriptCompilerMojo.createSourceMapFile | private void createSourceMapFile(File output,SourceMap sourceMap) throws WatchingException{
if (googleClosureMap) {
PrintWriter mapWriter = null;
File mapFile = new File(output.getPath() + ".map");
FileUtils.deleteQuietly(mapFile);
try {
mapWriter... | java | private void createSourceMapFile(File output,SourceMap sourceMap) throws WatchingException{
if (googleClosureMap) {
PrintWriter mapWriter = null;
File mapFile = new File(output.getPath() + ".map");
FileUtils.deleteQuietly(mapFile);
try {
mapWriter... | [
"private",
"void",
"createSourceMapFile",
"(",
"File",
"output",
",",
"SourceMap",
"sourceMap",
")",
"throws",
"WatchingException",
"{",
"if",
"(",
"googleClosureMap",
")",
"{",
"PrintWriter",
"mapWriter",
"=",
"null",
";",
"File",
"mapFile",
"=",
"new",
"File",... | Create a source map file corresponding to the given compiled js file.
@param output The compiled js file
@param sourceMap The {@link SourceMap} retrieved from the compiler
@throws WatchingException If an IOException occurred while creating the source map file. | [
"Create",
"a",
"source",
"map",
"file",
"corresponding",
"to",
"the",
"given",
"compiled",
"js",
"file",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/mojos/JavaScriptCompilerMojo.java#L466-L483 |
103,785 | wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/mojos/JavaScriptCompilerMojo.java | JavaScriptCompilerMojo.listErrors | private void listErrors(final Result result) {
for (JSError warning : result.warnings) {
getLog().warn(warning.toString());
}
for (JSError error : result.errors) {
getLog().error(error.toString());
}
} | java | private void listErrors(final Result result) {
for (JSError warning : result.warnings) {
getLog().warn(warning.toString());
}
for (JSError error : result.errors) {
getLog().error(error.toString());
}
} | [
"private",
"void",
"listErrors",
"(",
"final",
"Result",
"result",
")",
"{",
"for",
"(",
"JSError",
"warning",
":",
"result",
".",
"warnings",
")",
"{",
"getLog",
"(",
")",
".",
"warn",
"(",
"warning",
".",
"toString",
"(",
")",
")",
";",
"}",
"for",... | List the errors that google is providing from the compiler output.
@param result the results from the compiler | [
"List",
"the",
"errors",
"that",
"google",
"is",
"providing",
"from",
"the",
"compiler",
"output",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/mojos/JavaScriptCompilerMojo.java#L490-L498 |
103,786 | wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/mojos/BundlePackagerMojo.java | BundlePackagerMojo.fileCreated | @Override
public boolean fileCreated(File file) throws WatchingException {
try {
createApplicationBundle();
} catch (Exception e) {
throw new WatchingException(e.getMessage(), file, e);
}
return true;
} | java | @Override
public boolean fileCreated(File file) throws WatchingException {
try {
createApplicationBundle();
} catch (Exception e) {
throw new WatchingException(e.getMessage(), file, e);
}
return true;
} | [
"@",
"Override",
"public",
"boolean",
"fileCreated",
"(",
"File",
"file",
")",
"throws",
"WatchingException",
"{",
"try",
"{",
"createApplicationBundle",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"new",
"WatchingException",
"(",
... | On any change, we just repackage the bundle.
@param file the created file.
@return {@literal true} as the pipeline must continue its execution.
@throws WatchingException if the bundle creation failed | [
"On",
"any",
"change",
"we",
"just",
"repackage",
"the",
"bundle",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/mojos/BundlePackagerMojo.java#L231-L239 |
103,787 | wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/mojos/CreateMojo.java | CreateMojo.execute | @Override
public void execute() throws MojoExecutionException {
try {
ensureNotExisting();
createDirectories();
if ("blank".equalsIgnoreCase(skel)) {
createApplicationConfiguration();
createBlankPomFile();
createPackageStru... | java | @Override
public void execute() throws MojoExecutionException {
try {
ensureNotExisting();
createDirectories();
if ("blank".equalsIgnoreCase(skel)) {
createApplicationConfiguration();
createBlankPomFile();
createPackageStru... | [
"@",
"Override",
"public",
"void",
"execute",
"(",
")",
"throws",
"MojoExecutionException",
"{",
"try",
"{",
"ensureNotExisting",
"(",
")",
";",
"createDirectories",
"(",
")",
";",
"if",
"(",
"\"blank\"",
".",
"equalsIgnoreCase",
"(",
"skel",
")",
")",
"{",
... | Generates the project structure.
If a directory with the 'artifactId\ name already exist, nothing is generated as we don't want to overridde
anything.
@throws MojoExecutionException | [
"Generates",
"the",
"project",
"structure",
".",
"If",
"a",
"directory",
"with",
"the",
"artifactId",
"\\",
"name",
"already",
"exist",
"nothing",
"is",
"generated",
"as",
"we",
"don",
"t",
"want",
"to",
"overridde",
"anything",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/mojos/CreateMojo.java#L89-L115 |
103,788 | wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/BundleExclusions.java | BundleExclusions.isExcluded | public static boolean isExcluded(Artifact artifact) {
Set<String> excluded = EXCLUSIONS.get(artifact.getGroupId());
return excluded != null && excluded.contains(artifact.getArtifactId());
} | java | public static boolean isExcluded(Artifact artifact) {
Set<String> excluded = EXCLUSIONS.get(artifact.getGroupId());
return excluded != null && excluded.contains(artifact.getArtifactId());
} | [
"public",
"static",
"boolean",
"isExcluded",
"(",
"Artifact",
"artifact",
")",
"{",
"Set",
"<",
"String",
">",
"excluded",
"=",
"EXCLUSIONS",
".",
"get",
"(",
"artifact",
".",
"getGroupId",
"(",
")",
")",
";",
"return",
"excluded",
"!=",
"null",
"&&",
"e... | Checks whether the given artifact is on the excluded list.
@param artifact the artifact
@return {@literal true} if the artifact is excluded, {@literal false} otherwise | [
"Checks",
"whether",
"the",
"given",
"artifact",
"is",
"on",
"the",
"excluded",
"list",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/BundleExclusions.java#L73-L76 |
103,789 | wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/WisdomExecutor.java | WisdomExecutor.stop | public void stop(AbstractWisdomMojo mojo) throws MojoExecutionException {
File script = new File(mojo.getWisdomRootDirectory(), "chameleon.sh");
if (!script.isFile()) {
throw new MojoExecutionException("The 'chameleon.sh' file does not exist in " + mojo
.getWisdomRootDire... | java | public void stop(AbstractWisdomMojo mojo) throws MojoExecutionException {
File script = new File(mojo.getWisdomRootDirectory(), "chameleon.sh");
if (!script.isFile()) {
throw new MojoExecutionException("The 'chameleon.sh' file does not exist in " + mojo
.getWisdomRootDire... | [
"public",
"void",
"stop",
"(",
"AbstractWisdomMojo",
"mojo",
")",
"throws",
"MojoExecutionException",
"{",
"File",
"script",
"=",
"new",
"File",
"(",
"mojo",
".",
"getWisdomRootDirectory",
"(",
")",
",",
"\"chameleon.sh\"",
")",
";",
"if",
"(",
"!",
"script",
... | Stops a running instance of wisdom using 'chameleon stop'.
@param mojo the mojo
@throws MojoExecutionException if the instance cannot be stopped | [
"Stops",
"a",
"running",
"instance",
"of",
"wisdom",
"using",
"chameleon",
"stop",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/WisdomExecutor.java#L188-L212 |
103,790 | wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/WisdomExecutor.java | WisdomExecutor.waitForFile | public static boolean waitForFile(File file) {
if (file.isFile()) {
return true;
} else {
// Start waiting 10 seconds maximum
long timeout = System.currentTimeMillis() + FILE_WAIT_TIMEOUT;
while (System.currentTimeMillis() <= timeout) {
sle... | java | public static boolean waitForFile(File file) {
if (file.isFile()) {
return true;
} else {
// Start waiting 10 seconds maximum
long timeout = System.currentTimeMillis() + FILE_WAIT_TIMEOUT;
while (System.currentTimeMillis() <= timeout) {
sle... | [
"public",
"static",
"boolean",
"waitForFile",
"(",
"File",
"file",
")",
"{",
"if",
"(",
"file",
".",
"isFile",
"(",
")",
")",
"{",
"return",
"true",
";",
"}",
"else",
"{",
"// Start waiting 10 seconds maximum",
"long",
"timeout",
"=",
"System",
".",
"curre... | Waits for a file to be created.
@param file the file
@return {@literal true} if the file was created, {@literal false} otherwise | [
"Waits",
"for",
"a",
"file",
"to",
"be",
"created",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/WisdomExecutor.java#L220-L235 |
103,791 | wisdom-framework/wisdom | core/application-configuration/src/main/java/org/wisdom/configuration/ConfigurationImpl.java | ConfigurationImpl.get | @Override
public String get(final String key) {
return retrieve(new Callable<String>() {
@Override
public String call() throws Exception {
return configuration.getString(key);
}
}, null);
} | java | @Override
public String get(final String key) {
return retrieve(new Callable<String>() {
@Override
public String call() throws Exception {
return configuration.getString(key);
}
}, null);
} | [
"@",
"Override",
"public",
"String",
"get",
"(",
"final",
"String",
"key",
")",
"{",
"return",
"retrieve",
"(",
"new",
"Callable",
"<",
"String",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"String",
"call",
"(",
")",
"throws",
"Exception",
"{",
"re... | Get a String property or null if it is not there...
@param key the key
@return the property of null if not there | [
"Get",
"a",
"String",
"property",
"or",
"null",
"if",
"it",
"is",
"not",
"there",
"..."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/application-configuration/src/main/java/org/wisdom/configuration/ConfigurationImpl.java#L83-L91 |
103,792 | wisdom-framework/wisdom | core/application-configuration/src/main/java/org/wisdom/configuration/ConfigurationImpl.java | ConfigurationImpl.getWithDefault | @Override
public String getWithDefault(final String key, String defaultValue) {
return retrieve(new Callable<String>() {
@Override
public String call() throws Exception {
return configuration.getString(key);
}
}, defaultValue);
} | java | @Override
public String getWithDefault(final String key, String defaultValue) {
return retrieve(new Callable<String>() {
@Override
public String call() throws Exception {
return configuration.getString(key);
}
}, defaultValue);
} | [
"@",
"Override",
"public",
"String",
"getWithDefault",
"(",
"final",
"String",
"key",
",",
"String",
"defaultValue",
")",
"{",
"return",
"retrieve",
"(",
"new",
"Callable",
"<",
"String",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"String",
"call",
"("... | Get a String property or a default value when property cannot be found in
any configuration file.
@param key the key used in the configuration file.
@param defaultValue Default value returned, when value cannot be found in
configuration.
@return the value of the key or the default value. | [
"Get",
"a",
"String",
"property",
"or",
"a",
"default",
"value",
"when",
"property",
"cannot",
"be",
"found",
"in",
"any",
"configuration",
"file",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/application-configuration/src/main/java/org/wisdom/configuration/ConfigurationImpl.java#L122-L130 |
103,793 | wisdom-framework/wisdom | core/application-configuration/src/main/java/org/wisdom/configuration/ConfigurationImpl.java | ConfigurationImpl.getIntegerWithDefault | @Override
public Integer getIntegerWithDefault(final String key, Integer defaultValue) {
return retrieve(new Callable<Integer>() {
@Override
public Integer call() throws Exception {
return configuration.getInt(key);
}
}, defaultValue);
} | java | @Override
public Integer getIntegerWithDefault(final String key, Integer defaultValue) {
return retrieve(new Callable<Integer>() {
@Override
public Integer call() throws Exception {
return configuration.getInt(key);
}
}, defaultValue);
} | [
"@",
"Override",
"public",
"Integer",
"getIntegerWithDefault",
"(",
"final",
"String",
"key",
",",
"Integer",
"defaultValue",
")",
"{",
"return",
"retrieve",
"(",
"new",
"Callable",
"<",
"Integer",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"Integer",
"c... | Get a Integer property or a default value when property cannot be found
in any configuration file.
@param key the key used in the configuration file.
@param defaultValue Default value returned, when value cannot be found in
configuration.
@return the value of the key or the default value. | [
"Get",
"a",
"Integer",
"property",
"or",
"a",
"default",
"value",
"when",
"property",
"cannot",
"be",
"found",
"in",
"any",
"configuration",
"file",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/application-configuration/src/main/java/org/wisdom/configuration/ConfigurationImpl.java#L157-L166 |
103,794 | wisdom-framework/wisdom | core/application-configuration/src/main/java/org/wisdom/configuration/ConfigurationImpl.java | ConfigurationImpl.getDoubleWithDefault | @Override
public Double getDoubleWithDefault(final String key, Double defaultValue) {
return retrieve(new Callable<Double>() {
@Override
public Double call() throws Exception {
return configuration.getDouble(key);
}
}, defaultValue);
} | java | @Override
public Double getDoubleWithDefault(final String key, Double defaultValue) {
return retrieve(new Callable<Double>() {
@Override
public Double call() throws Exception {
return configuration.getDouble(key);
}
}, defaultValue);
} | [
"@",
"Override",
"public",
"Double",
"getDoubleWithDefault",
"(",
"final",
"String",
"key",
",",
"Double",
"defaultValue",
")",
"{",
"return",
"retrieve",
"(",
"new",
"Callable",
"<",
"Double",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"Double",
"call",... | Get a Double property or a default value when property cannot be found
in any configuration file.
@param key the key used in the configuration file.
@param defaultValue Default value returned, when value cannot be found in
configuration.
@return the value of the key or the default value. | [
"Get",
"a",
"Double",
"property",
"or",
"a",
"default",
"value",
"when",
"property",
"cannot",
"be",
"found",
"in",
"any",
"configuration",
"file",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/application-configuration/src/main/java/org/wisdom/configuration/ConfigurationImpl.java#L193-L201 |
103,795 | wisdom-framework/wisdom | core/application-configuration/src/main/java/org/wisdom/configuration/ConfigurationImpl.java | ConfigurationImpl.getBooleanWithDefault | @Override
public Boolean getBooleanWithDefault(final String key, Boolean defaultValue) {
return retrieve(new Callable<Boolean>() {
@Override
public Boolean call() throws Exception {
return configuration.getBoolean(key);
}
}, defaultValue);
} | java | @Override
public Boolean getBooleanWithDefault(final String key, Boolean defaultValue) {
return retrieve(new Callable<Boolean>() {
@Override
public Boolean call() throws Exception {
return configuration.getBoolean(key);
}
}, defaultValue);
} | [
"@",
"Override",
"public",
"Boolean",
"getBooleanWithDefault",
"(",
"final",
"String",
"key",
",",
"Boolean",
"defaultValue",
")",
"{",
"return",
"retrieve",
"(",
"new",
"Callable",
"<",
"Boolean",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"Boolean",
"c... | Get a Boolean property or a default value when property cannot be found
in any configuration file.
@param key the key used in the configuration file.
@param defaultValue Default value returned, when value cannot be found in
configuration.
@return the value of the key or the default value. | [
"Get",
"a",
"Boolean",
"property",
"or",
"a",
"default",
"value",
"when",
"property",
"cannot",
"be",
"found",
"in",
"any",
"configuration",
"file",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/application-configuration/src/main/java/org/wisdom/configuration/ConfigurationImpl.java#L227-L236 |
103,796 | wisdom-framework/wisdom | core/application-configuration/src/main/java/org/wisdom/configuration/ConfigurationImpl.java | ConfigurationImpl.getConfiguration | @Override
public Configuration getConfiguration(String prefix) {
try {
Config value = configuration.getConfig(prefix);
return new ConfigurationImpl(converters, value);
} catch (ConfigException.Missing e) {
// Ignore the exception.
return null;
... | java | @Override
public Configuration getConfiguration(String prefix) {
try {
Config value = configuration.getConfig(prefix);
return new ConfigurationImpl(converters, value);
} catch (ConfigException.Missing e) {
// Ignore the exception.
return null;
... | [
"@",
"Override",
"public",
"Configuration",
"getConfiguration",
"(",
"String",
"prefix",
")",
"{",
"try",
"{",
"Config",
"value",
"=",
"configuration",
".",
"getConfig",
"(",
"prefix",
")",
";",
"return",
"new",
"ConfigurationImpl",
"(",
"converters",
",",
"va... | Gets a configuration object with all the properties starting with the given prefix.
@param prefix the prefix (without the ending `.`)
@return a configuration object with all properties with a name starting with `prefix.`,
or {@literal null} if no properties start with the given prefix. | [
"Gets",
"a",
"configuration",
"object",
"with",
"all",
"the",
"properties",
"starting",
"with",
"the",
"given",
"prefix",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/application-configuration/src/main/java/org/wisdom/configuration/ConfigurationImpl.java#L455-L464 |
103,797 | wisdom-framework/wisdom | documentation/samples/src/main/java/org/wisdom/samples/async/SimpleAsyncController.java | SimpleAsyncController.heavyComputation | @Route(method = HttpMethod.GET, uri = "/async/hello/{name}")
public Result heavyComputation(@Parameter("name") final String name) {
return async(new Callable<Result>() {
@Override
public Result call() throws Exception {
System.out.println(System.currentTimeMillis() + ... | java | @Route(method = HttpMethod.GET, uri = "/async/hello/{name}")
public Result heavyComputation(@Parameter("name") final String name) {
return async(new Callable<Result>() {
@Override
public Result call() throws Exception {
System.out.println(System.currentTimeMillis() + ... | [
"@",
"Route",
"(",
"method",
"=",
"HttpMethod",
".",
"GET",
",",
"uri",
"=",
"\"/async/hello/{name}\"",
")",
"public",
"Result",
"heavyComputation",
"(",
"@",
"Parameter",
"(",
"\"name\"",
")",
"final",
"String",
"name",
")",
"{",
"return",
"async",
"(",
"... | Waits ten second before sending the hello message. | [
"Waits",
"ten",
"second",
"before",
"sending",
"the",
"hello",
"message",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/documentation/samples/src/main/java/org/wisdom/samples/async/SimpleAsyncController.java#L41-L54 |
103,798 | wisdom-framework/wisdom | extensions/wisdom-filters/src/main/java/org/wisdom/framework/filters/ProxyFilter.java | ProxyFilter.newHttpClient | protected HttpClient newHttpClient() {
return HttpClients.custom()
// Do not manage redirection.
.setRedirectStrategy(new DefaultRedirectStrategy() {
@Override
protected boolean isRedirectable(String method) {
return... | java | protected HttpClient newHttpClient() {
return HttpClients.custom()
// Do not manage redirection.
.setRedirectStrategy(new DefaultRedirectStrategy() {
@Override
protected boolean isRedirectable(String method) {
return... | [
"protected",
"HttpClient",
"newHttpClient",
"(",
")",
"{",
"return",
"HttpClients",
".",
"custom",
"(",
")",
"// Do not manage redirection.",
".",
"setRedirectStrategy",
"(",
"new",
"DefaultRedirectStrategy",
"(",
")",
"{",
"@",
"Override",
"protected",
"boolean",
"... | Allows you do override the HTTP Client used to execute the requests.
By default, it used a custom client without cookies.
@return the HTTP Client instance | [
"Allows",
"you",
"do",
"override",
"the",
"HTTP",
"Client",
"used",
"to",
"execute",
"the",
"requests",
".",
"By",
"default",
"it",
"used",
"a",
"custom",
"client",
"without",
"cookies",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-filters/src/main/java/org/wisdom/framework/filters/ProxyFilter.java#L124-L140 |
103,799 | wisdom-framework/wisdom | framework/default-error-handler/src/main/java/org/wisdom/error/DefaultPageErrorHandler.java | DefaultPageErrorHandler.renderInternalError | private Result renderInternalError(Context context, Route route, Throwable e) {
Throwable localException;
// If the template is not there, just wrap the exception within a JSON Object.
if (internalerror == null) {
return internalServerError(e);
}
// Manage ITE
... | java | private Result renderInternalError(Context context, Route route, Throwable e) {
Throwable localException;
// If the template is not there, just wrap the exception within a JSON Object.
if (internalerror == null) {
return internalServerError(e);
}
// Manage ITE
... | [
"private",
"Result",
"renderInternalError",
"(",
"Context",
"context",
",",
"Route",
"route",
",",
"Throwable",
"e",
")",
"{",
"Throwable",
"localException",
";",
"// If the template is not there, just wrap the exception within a JSON Object.",
"if",
"(",
"internalerror",
"... | Generates the error page.
@param context the context.
@param route the route
@param e the thrown error
@return the HTTP result serving the error page | [
"Generates",
"the",
"error",
"page",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/framework/default-error-handler/src/main/java/org/wisdom/error/DefaultPageErrorHandler.java#L153-L201 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.