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,600 | wisdom-framework/wisdom | extensions/wisdom-browser-watch/src/main/java/org/wisdom/browserwatch/BrowserWatchController.java | BrowserWatchController.addedClient | @Opened(BROWSER_WATCH_SOCKET)
public void addedClient(@Parameter("client") String client) {
log.log(LogService.LOG_INFO, String.format("added client %s", client));
} | java | @Opened(BROWSER_WATCH_SOCKET)
public void addedClient(@Parameter("client") String client) {
log.log(LogService.LOG_INFO, String.format("added client %s", client));
} | [
"@",
"Opened",
"(",
"BROWSER_WATCH_SOCKET",
")",
"public",
"void",
"addedClient",
"(",
"@",
"Parameter",
"(",
"\"client\"",
")",
"String",
"client",
")",
"{",
"log",
".",
"log",
"(",
"LogService",
".",
"LOG_INFO",
",",
"String",
".",
"format",
"(",
"\"adde... | When a client is added, we get the service it should be associated with using the route resoluton
mechanism wisdom provides us
@param client
@param url | [
"When",
"a",
"client",
"is",
"added",
"we",
"get",
"the",
"service",
"it",
"should",
"be",
"associated",
"with",
"using",
"the",
"route",
"resoluton",
"mechanism",
"wisdom",
"provides",
"us"
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-browser-watch/src/main/java/org/wisdom/browserwatch/BrowserWatchController.java#L112-L115 |
103,601 | wisdom-framework/wisdom | extensions/wisdom-browser-watch/src/main/java/org/wisdom/browserwatch/BrowserWatchController.java | BrowserWatchController.removedClient | @Closed(BROWSER_WATCH_SOCKET)
public void removedClient(@Parameter("client") String client) {
displayedControllers.inverse().remove(client);
} | java | @Closed(BROWSER_WATCH_SOCKET)
public void removedClient(@Parameter("client") String client) {
displayedControllers.inverse().remove(client);
} | [
"@",
"Closed",
"(",
"BROWSER_WATCH_SOCKET",
")",
"public",
"void",
"removedClient",
"(",
"@",
"Parameter",
"(",
"\"client\"",
")",
"String",
"client",
")",
"{",
"displayedControllers",
".",
"inverse",
"(",
")",
".",
"remove",
"(",
"client",
")",
";",
"}"
] | And when client leaves, stop notifying it
@param client
client to remove | [
"And",
"when",
"client",
"leaves",
"stop",
"notifying",
"it"
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-browser-watch/src/main/java/org/wisdom/browserwatch/BrowserWatchController.java#L134-L137 |
103,602 | wisdom-framework/wisdom | core/wisdom-executors/src/main/java/org/wisdom/executors/Creator.java | Creator.start | @Validate
public void start() {
Configuration conf = configuration.getConfiguration("pools");
createExecutor(ManagedExecutorService.SYSTEM,
conf != null ? conf.getConfiguration("executors." + ManagedExecutorService.SYSTEM) : null);
createScheduler(ManagedScheduledExecutorSer... | java | @Validate
public void start() {
Configuration conf = configuration.getConfiguration("pools");
createExecutor(ManagedExecutorService.SYSTEM,
conf != null ? conf.getConfiguration("executors." + ManagedExecutorService.SYSTEM) : null);
createScheduler(ManagedScheduledExecutorSer... | [
"@",
"Validate",
"public",
"void",
"start",
"(",
")",
"{",
"Configuration",
"conf",
"=",
"configuration",
".",
"getConfiguration",
"(",
"\"pools\"",
")",
";",
"createExecutor",
"(",
"ManagedExecutorService",
".",
"SYSTEM",
",",
"conf",
"!=",
"null",
"?",
"conf... | Creates the system executors and the others specified executors. | [
"Creates",
"the",
"system",
"executors",
"and",
"the",
"others",
"specified",
"executors",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-executors/src/main/java/org/wisdom/executors/Creator.java#L70-L83 |
103,603 | wisdom-framework/wisdom | core/wisdom-executors/src/main/java/org/wisdom/executors/Creator.java | Creator.stop | @Invalidate
public void stop() {
for (Map.Entry<ServiceRegistration, ExecutorService> entry : instances.entrySet()) {
entry.getKey().unregister();
entry.getValue().shutdownNow();
}
instances.clear();
} | java | @Invalidate
public void stop() {
for (Map.Entry<ServiceRegistration, ExecutorService> entry : instances.entrySet()) {
entry.getKey().unregister();
entry.getValue().shutdownNow();
}
instances.clear();
} | [
"@",
"Invalidate",
"public",
"void",
"stop",
"(",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"ServiceRegistration",
",",
"ExecutorService",
">",
"entry",
":",
"instances",
".",
"entrySet",
"(",
")",
")",
"{",
"entry",
".",
"getKey",
"(",
")",
".",... | Shutdown all created executors. | [
"Shutdown",
"all",
"created",
"executors",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-executors/src/main/java/org/wisdom/executors/Creator.java#L169-L176 |
103,604 | wisdom-framework/wisdom | extensions/wisdom-monitor/src/main/java/org/wisdom/monitor/extensions/logger/LoggerExtension.java | LoggerExtension.loggers | @Route(method = HttpMethod.GET, uri = "/monitor/logs/loggers")
public Result loggers() {
LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
List<LoggerModel> loggers = new ArrayList<>();
for (Logger logger : context.getLoggerList()) {
loggers.add(new Logge... | java | @Route(method = HttpMethod.GET, uri = "/monitor/logs/loggers")
public Result loggers() {
LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
List<LoggerModel> loggers = new ArrayList<>();
for (Logger logger : context.getLoggerList()) {
loggers.add(new Logge... | [
"@",
"Route",
"(",
"method",
"=",
"HttpMethod",
".",
"GET",
",",
"uri",
"=",
"\"/monitor/logs/loggers\"",
")",
"public",
"Result",
"loggers",
"(",
")",
"{",
"LoggerContext",
"context",
"=",
"(",
"LoggerContext",
")",
"LoggerFactory",
".",
"getILoggerFactory",
... | Gets a json form of the list of logger.
@return the list of loggers as json. | [
"Gets",
"a",
"json",
"form",
"of",
"the",
"list",
"of",
"logger",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-monitor/src/main/java/org/wisdom/monitor/extensions/logger/LoggerExtension.java#L66-L74 |
103,605 | wisdom-framework/wisdom | extensions/wisdom-monitor/src/main/java/org/wisdom/monitor/extensions/logger/LoggerExtension.java | LoggerExtension.setLevel | @Route(method = HttpMethod.PUT, uri = "/monitor/logs/{name}")
public Result setLevel(@Parameter("name") String loggerName, @Parameter("level") String level) {
LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
Logger logger = context.getLogger(loggerName);
if (logger ... | java | @Route(method = HttpMethod.PUT, uri = "/monitor/logs/{name}")
public Result setLevel(@Parameter("name") String loggerName, @Parameter("level") String level) {
LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
Logger logger = context.getLogger(loggerName);
if (logger ... | [
"@",
"Route",
"(",
"method",
"=",
"HttpMethod",
".",
"PUT",
",",
"uri",
"=",
"\"/monitor/logs/{name}\"",
")",
"public",
"Result",
"setLevel",
"(",
"@",
"Parameter",
"(",
"\"name\"",
")",
"String",
"loggerName",
",",
"@",
"Parameter",
"(",
"\"level\"",
")",
... | Changes the log level of the specified logger.
@param loggerName the name of the logger
@param level the new level
@return the updated list of logger (as json), or not found if the given logger cannot be found | [
"Changes",
"the",
"log",
"level",
"of",
"the",
"specified",
"logger",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-monitor/src/main/java/org/wisdom/monitor/extensions/logger/LoggerExtension.java#L84-L96 |
103,606 | wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/node/LoggedOutputStream.java | LoggedOutputStream.write | @Override
public void write(int b) throws IOException {
byte[] bytes = new byte[1];
bytes[0] = (byte) (b & 0xff);
buffer = buffer + new String(bytes);
if (buffer.endsWith("\n")) {
buffer = buffer.substring(0, buffer.length() - 1);
flush();
}
} | java | @Override
public void write(int b) throws IOException {
byte[] bytes = new byte[1];
bytes[0] = (byte) (b & 0xff);
buffer = buffer + new String(bytes);
if (buffer.endsWith("\n")) {
buffer = buffer.substring(0, buffer.length() - 1);
flush();
}
} | [
"@",
"Override",
"public",
"void",
"write",
"(",
"int",
"b",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"bytes",
"=",
"new",
"byte",
"[",
"1",
"]",
";",
"bytes",
"[",
"0",
"]",
"=",
"(",
"byte",
")",
"(",
"b",
"&",
"0xff",
")",
";",
... | Writes a byte to the output stream. This method flushes automatically at the end of a line. | [
"Writes",
"a",
"byte",
"to",
"the",
"output",
"stream",
".",
"This",
"method",
"flushes",
"automatically",
"at",
"the",
"end",
"of",
"a",
"line",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/node/LoggedOutputStream.java#L67-L77 |
103,607 | wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/node/LoggedOutputStream.java | LoggedOutputStream.flush | public void flush() {
if (useWarn) {
log.warn(buffer);
} else {
log.info(buffer);
}
if (memory != null) {
memory += buffer + "\n";
}
buffer = "";
} | java | public void flush() {
if (useWarn) {
log.warn(buffer);
} else {
log.info(buffer);
}
if (memory != null) {
memory += buffer + "\n";
}
buffer = "";
} | [
"public",
"void",
"flush",
"(",
")",
"{",
"if",
"(",
"useWarn",
")",
"{",
"log",
".",
"warn",
"(",
"buffer",
")",
";",
"}",
"else",
"{",
"log",
".",
"info",
"(",
"buffer",
")",
";",
"}",
"if",
"(",
"memory",
"!=",
"null",
")",
"{",
"memory",
... | Flushes the output stream. | [
"Flushes",
"the",
"output",
"stream",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/node/LoggedOutputStream.java#L86-L96 |
103,608 | wisdom-framework/wisdom | core/router/src/main/java/org/wisdom/router/RequestRouter.java | RequestRouter.bindController | @Bind(aggregate = true, optional = true)
public synchronized void bindController(Controller controller) {
LOGGER.info("Adding routes from " + controller);
List<Route> newRoutes = new ArrayList<>();
try {
List<Route> annotatedNewRoutes = RouteUtils.collectRouteFromControllerAnno... | java | @Bind(aggregate = true, optional = true)
public synchronized void bindController(Controller controller) {
LOGGER.info("Adding routes from " + controller);
List<Route> newRoutes = new ArrayList<>();
try {
List<Route> annotatedNewRoutes = RouteUtils.collectRouteFromControllerAnno... | [
"@",
"Bind",
"(",
"aggregate",
"=",
"true",
",",
"optional",
"=",
"true",
")",
"public",
"synchronized",
"void",
"bindController",
"(",
"Controller",
"controller",
")",
"{",
"LOGGER",
".",
"info",
"(",
"\"Adding routes from \"",
"+",
"controller",
")",
";",
... | Binds a new controller.
@param controller the controller | [
"Binds",
"a",
"new",
"controller",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/router/src/main/java/org/wisdom/router/RequestRouter.java#L104-L129 |
103,609 | wisdom-framework/wisdom | core/router/src/main/java/org/wisdom/router/RequestRouter.java | RequestRouter.unbindController | @Unbind(aggregate = true)
public synchronized void unbindController(Controller controller) {
LOGGER.info("Removing routes from " + controller);
Collection<RouteDelegate> copy = new LinkedHashSet<>(routes);
for (RouteDelegate r : copy) {
if (r.getControllerObject().equals(controll... | java | @Unbind(aggregate = true)
public synchronized void unbindController(Controller controller) {
LOGGER.info("Removing routes from " + controller);
Collection<RouteDelegate> copy = new LinkedHashSet<>(routes);
for (RouteDelegate r : copy) {
if (r.getControllerObject().equals(controll... | [
"@",
"Unbind",
"(",
"aggregate",
"=",
"true",
")",
"public",
"synchronized",
"void",
"unbindController",
"(",
"Controller",
"controller",
")",
"{",
"LOGGER",
".",
"info",
"(",
"\"Removing routes from \"",
"+",
"controller",
")",
";",
"Collection",
"<",
"RouteDel... | Unbinds a controller.
@param controller the controller | [
"Unbinds",
"a",
"controller",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/router/src/main/java/org/wisdom/router/RequestRouter.java#L136-L145 |
103,610 | wisdom-framework/wisdom | core/router/src/main/java/org/wisdom/router/RequestRouter.java | RequestRouter.getReverseRouteFor | @Override
public String getReverseRouteFor(String className, String method, Map<String, Object> params) {
for (Route route : copy()) {
if (route.getControllerClass().getName().equals(className)
&& route.getControllerMethod().getName().equals(method)) {
return ... | java | @Override
public String getReverseRouteFor(String className, String method, Map<String, Object> params) {
for (Route route : copy()) {
if (route.getControllerClass().getName().equals(className)
&& route.getControllerMethod().getName().equals(method)) {
return ... | [
"@",
"Override",
"public",
"String",
"getReverseRouteFor",
"(",
"String",
"className",
",",
"String",
"method",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"params",
")",
"{",
"for",
"(",
"Route",
"route",
":",
"copy",
"(",
")",
")",
"{",
"if",
"(",... | Gets the URL that would invoke the given action method.
@param className the controller class
@param method the controller method
@param params map of parameter name - value
@return the computed URL, {@literal null} if no route matches the given action method | [
"Gets",
"the",
"URL",
"that",
"would",
"invoke",
"the",
"given",
"action",
"method",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/router/src/main/java/org/wisdom/router/RequestRouter.java#L304-L313 |
103,611 | wisdom-framework/wisdom | core/router/src/main/java/org/wisdom/router/RequestRouter.java | RequestRouter.bindFilter | @Bind(aggregate = true, optional = true)
public void bindFilter(Filter filter) {
filters.add(filter);
} | java | @Bind(aggregate = true, optional = true)
public void bindFilter(Filter filter) {
filters.add(filter);
} | [
"@",
"Bind",
"(",
"aggregate",
"=",
"true",
",",
"optional",
"=",
"true",
")",
"public",
"void",
"bindFilter",
"(",
"Filter",
"filter",
")",
"{",
"filters",
".",
"add",
"(",
"filter",
")",
";",
"}"
] | Binds a filter.
@param filter the filter | [
"Binds",
"a",
"filter",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/router/src/main/java/org/wisdom/router/RequestRouter.java#L445-L448 |
103,612 | wisdom-framework/wisdom | extensions/wisdom-raml/wisdom-source-watcher/src/main/java/org/wisdom/source/ast/visitor/ClassSourceVisitor.java | ClassSourceVisitor.visit | public Boolean visit(ClassOrInterfaceDeclaration declaration, Object extra) {
if (declaration.getAnnotations() != null
&& containsAnnotation(declaration.getAnnotations(), CONTROL_ANNO_NAME)) {
return true;
}
//Get the list of extended and implemented class
L... | java | public Boolean visit(ClassOrInterfaceDeclaration declaration, Object extra) {
if (declaration.getAnnotations() != null
&& containsAnnotation(declaration.getAnnotations(), CONTROL_ANNO_NAME)) {
return true;
}
//Get the list of extended and implemented class
L... | [
"public",
"Boolean",
"visit",
"(",
"ClassOrInterfaceDeclaration",
"declaration",
",",
"Object",
"extra",
")",
"{",
"if",
"(",
"declaration",
".",
"getAnnotations",
"(",
")",
"!=",
"null",
"&&",
"containsAnnotation",
"(",
"declaration",
".",
"getAnnotations",
"(",
... | Visit the Class declaration and return true if it corresponds to a wisdom controller.
@param declaration The class declaration created by the JavaParser.
@param extra Extra out value argument, not used here.
@return <code>true</code> if the declaration correspond to a wisdom controller, <code>false</code> otherw... | [
"Visit",
"the",
"Class",
"declaration",
"and",
"return",
"true",
"if",
"it",
"corresponds",
"to",
"a",
"wisdom",
"controller",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-raml/wisdom-source-watcher/src/main/java/org/wisdom/source/ast/visitor/ClassSourceVisitor.java#L84-L103 |
103,613 | wisdom-framework/wisdom | extensions/wisdom-raml/wisdom-source-watcher/src/main/java/org/wisdom/source/ast/visitor/ClassSourceVisitor.java | ClassSourceVisitor.containsAnnotation | private boolean containsAnnotation(List<AnnotationExpr> annos, String annotationName) {
for (AnnotationExpr anno : annos) {
if (anno.getName().getName().equals(annotationName)) {
return true;
}
}
return false;
} | java | private boolean containsAnnotation(List<AnnotationExpr> annos, String annotationName) {
for (AnnotationExpr anno : annos) {
if (anno.getName().getName().equals(annotationName)) {
return true;
}
}
return false;
} | [
"private",
"boolean",
"containsAnnotation",
"(",
"List",
"<",
"AnnotationExpr",
">",
"annos",
",",
"String",
"annotationName",
")",
"{",
"for",
"(",
"AnnotationExpr",
"anno",
":",
"annos",
")",
"{",
"if",
"(",
"anno",
".",
"getName",
"(",
")",
".",
"getNam... | Check if the list of annotation contains the annotation of given name.
@param annos, the annotation list
@param annotationName, the annotation name
@return <code>true</code> if the annotation list contains the given annotation. | [
"Check",
"if",
"the",
"list",
"of",
"annotation",
"contains",
"the",
"annotation",
"of",
"given",
"name",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-raml/wisdom-source-watcher/src/main/java/org/wisdom/source/ast/visitor/ClassSourceVisitor.java#L112-L119 |
103,614 | wisdom-framework/wisdom | core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/HttpUtils.java | HttpUtils.isKeepAlive | public static boolean isKeepAlive(HttpServerRequest request) {
String connection = request.headers().get(HeaderNames.CONNECTION);
if (connection != null && connection.equalsIgnoreCase(CLOSE)) {
return false;
}
if (request.version() == HttpVersion.HTTP_1_1) {
retur... | java | public static boolean isKeepAlive(HttpServerRequest request) {
String connection = request.headers().get(HeaderNames.CONNECTION);
if (connection != null && connection.equalsIgnoreCase(CLOSE)) {
return false;
}
if (request.version() == HttpVersion.HTTP_1_1) {
retur... | [
"public",
"static",
"boolean",
"isKeepAlive",
"(",
"HttpServerRequest",
"request",
")",
"{",
"String",
"connection",
"=",
"request",
".",
"headers",
"(",
")",
".",
"get",
"(",
"HeaderNames",
".",
"CONNECTION",
")",
";",
"if",
"(",
"connection",
"!=",
"null",... | Checks whether the given request should be closed or not once completed.
@param request the request
@return {@code true} if the connection is marked as {@literal keep-alive}, and so must not be closed. {@code
false} otherwise. Notice that if not set in the request, the default value depends on the HTTP version. | [
"Checks",
"whether",
"the",
"given",
"request",
"should",
"be",
"closed",
"or",
"not",
"once",
"completed",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/HttpUtils.java#L53-L63 |
103,615 | wisdom-framework/wisdom | core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/HttpUtils.java | HttpUtils.processResult | public static InputStream processResult(ServiceAccessor accessor, Context context, Renderable renderable,
Result result) throws Exception {
if (renderable.requireSerializer()) {
ContentSerializer serializer = null;
if (result.getContentType() !... | java | public static InputStream processResult(ServiceAccessor accessor, Context context, Renderable renderable,
Result result) throws Exception {
if (renderable.requireSerializer()) {
ContentSerializer serializer = null;
if (result.getContentType() !... | [
"public",
"static",
"InputStream",
"processResult",
"(",
"ServiceAccessor",
"accessor",
",",
"Context",
"context",
",",
"Renderable",
"renderable",
",",
"Result",
"result",
")",
"throws",
"Exception",
"{",
"if",
"(",
"renderable",
".",
"requireSerializer",
"(",
")... | Processes the given result. This method returns either the "rendered renderable",
but also applies required serialization if any.
@param accessor the service accessor
@param context the current HTTP context
@param renderable the renderable object
@param result the computed result
@return the stream of the res... | [
"Processes",
"the",
"given",
"result",
".",
"This",
"method",
"returns",
"either",
"the",
"rendered",
"renderable",
"but",
"also",
"applies",
"required",
"serialization",
"if",
"any",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/HttpUtils.java#L91-L126 |
103,616 | wisdom-framework/wisdom | core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/cookies/SessionCookieImpl.java | SessionCookieImpl.init | @Override
public void init(Context context) {
try {
// get the cookie that contains session information:
Cookie cookie = context.request().cookie(applicationCookiePrefix
+ SESSION_SUFFIX);
// check that the cookie is not empty:
if (cookie ... | java | @Override
public void init(Context context) {
try {
// get the cookie that contains session information:
Cookie cookie = context.request().cookie(applicationCookiePrefix
+ SESSION_SUFFIX);
// check that the cookie is not empty:
if (cookie ... | [
"@",
"Override",
"public",
"void",
"init",
"(",
"Context",
"context",
")",
"{",
"try",
"{",
"// get the cookie that contains session information:",
"Cookie",
"cookie",
"=",
"context",
".",
"request",
"(",
")",
".",
"cookie",
"(",
"applicationCookiePrefix",
"+",
"S... | Has to be called initially.
@param context the current http context. | [
"Has",
"to",
"be",
"called",
"initially",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/cookies/SessionCookieImpl.java#L87-L132 |
103,617 | wisdom-framework/wisdom | extensions/wisdom-npm-runner-maven-plugin/src/main/java/org/wisdom/mojo/npm/NpmRunnerMojo.java | NpmRunnerMojo.execute | public void execute()
throws MojoExecutionException {
if (watchFilter == null) {
removeFromWatching();
}
NPM.npm(this, name, version).execute(
binary != null ? binary : name, arguments);
} | java | public void execute()
throws MojoExecutionException {
if (watchFilter == null) {
removeFromWatching();
}
NPM.npm(this, name, version).execute(
binary != null ? binary : name, arguments);
} | [
"public",
"void",
"execute",
"(",
")",
"throws",
"MojoExecutionException",
"{",
"if",
"(",
"watchFilter",
"==",
"null",
")",
"{",
"removeFromWatching",
"(",
")",
";",
"}",
"NPM",
".",
"npm",
"(",
"this",
",",
"name",
",",
"version",
")",
".",
"execute",
... | Installs and executes the NPM.
@throws MojoExecutionException if the execution fails. | [
"Installs",
"and",
"executes",
"the",
"NPM",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-npm-runner-maven-plugin/src/main/java/org/wisdom/mojo/npm/NpmRunnerMojo.java#L79-L86 |
103,618 | wisdom-framework/wisdom | extensions/wisdom-npm-runner-maven-plugin/src/main/java/org/wisdom/mojo/npm/NpmRunnerMojo.java | NpmRunnerMojo.accept | @Override
public boolean accept(File file) {
WildcardFileFilter filter = new WildcardFileFilter(watchFilter);
return filter.accept(file);
} | java | @Override
public boolean accept(File file) {
WildcardFileFilter filter = new WildcardFileFilter(watchFilter);
return filter.accept(file);
} | [
"@",
"Override",
"public",
"boolean",
"accept",
"(",
"File",
"file",
")",
"{",
"WildcardFileFilter",
"filter",
"=",
"new",
"WildcardFileFilter",
"(",
"watchFilter",
")",
";",
"return",
"filter",
".",
"accept",
"(",
"file",
")",
";",
"}"
] | If the watcher has a filter set, creates a wildcard filter and test the file name against this filter.
@param file is the file.
@return {@code true} if the file is accepted. | [
"If",
"the",
"watcher",
"has",
"a",
"filter",
"set",
"creates",
"a",
"wildcard",
"filter",
"and",
"test",
"the",
"file",
"name",
"against",
"this",
"filter",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-npm-runner-maven-plugin/src/main/java/org/wisdom/mojo/npm/NpmRunnerMojo.java#L94-L98 |
103,619 | wisdom-framework/wisdom | extensions/wisdom-npm-runner-maven-plugin/src/main/java/org/wisdom/mojo/npm/NpmRunnerMojo.java | NpmRunnerMojo.fileCreated | @Override
public boolean fileCreated(File file) throws WatchingException {
try {
execute();
} catch (MojoExecutionException e) {
throw new WatchingException("Cannot execute the NPM '" + name + "'", e);
}
return true;
} | java | @Override
public boolean fileCreated(File file) throws WatchingException {
try {
execute();
} catch (MojoExecutionException e) {
throw new WatchingException("Cannot execute the NPM '" + name + "'", e);
}
return true;
} | [
"@",
"Override",
"public",
"boolean",
"fileCreated",
"(",
"File",
"file",
")",
"throws",
"WatchingException",
"{",
"try",
"{",
"execute",
"(",
")",
";",
"}",
"catch",
"(",
"MojoExecutionException",
"e",
")",
"{",
"throw",
"new",
"WatchingException",
"(",
"\"... | An accepted file was created - executes the NPM.
@param file is the file.
@return {@code true}
@throws org.wisdom.maven.WatchingException if the execution fails. | [
"An",
"accepted",
"file",
"was",
"created",
"-",
"executes",
"the",
"NPM",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-npm-runner-maven-plugin/src/main/java/org/wisdom/mojo/npm/NpmRunnerMojo.java#L107-L115 |
103,620 | wisdom-framework/wisdom | core/content-manager/src/main/java/org/wisdom/content/converters/ReflectionHelper.java | ReflectionHelper.getPrimitiveDefault | public static String getPrimitiveDefault(Class type) {
if (type == Boolean.class) {
return "false";
}
if (type == Character.class) {
return Character.toString((char) 0);
}
return "0";
} | java | public static String getPrimitiveDefault(Class type) {
if (type == Boolean.class) {
return "false";
}
if (type == Character.class) {
return Character.toString((char) 0);
}
return "0";
} | [
"public",
"static",
"String",
"getPrimitiveDefault",
"(",
"Class",
"type",
")",
"{",
"if",
"(",
"type",
"==",
"Boolean",
".",
"class",
")",
"{",
"return",
"\"false\"",
";",
"}",
"if",
"(",
"type",
"==",
"Character",
".",
"class",
")",
"{",
"return",
"C... | Gets the default value as String for the primitive types.
@param type the primitive type
@return the default value as String | [
"Gets",
"the",
"default",
"value",
"as",
"String",
"for",
"the",
"primitive",
"types",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/content-manager/src/main/java/org/wisdom/content/converters/ReflectionHelper.java#L226-L234 |
103,621 | wisdom-framework/wisdom | framework/thymeleaf-template-engine/src/main/java/org/wisdom/template/thymeleaf/dialect/Routes.java | Routes.asset | public String asset(String path) {
Asset asset = assets.assetAt(path);
if (asset == null) {
// If the path starts with "/", try without
if (path.startsWith("/")) {
return asset(path.substring(1));
}
// Not found.
throw new Templ... | java | public String asset(String path) {
Asset asset = assets.assetAt(path);
if (asset == null) {
// If the path starts with "/", try without
if (path.startsWith("/")) {
return asset(path.substring(1));
}
// Not found.
throw new Templ... | [
"public",
"String",
"asset",
"(",
"String",
"path",
")",
"{",
"Asset",
"asset",
"=",
"assets",
".",
"assetAt",
"(",
"path",
")",
";",
"if",
"(",
"asset",
"==",
"null",
")",
"{",
"// If the path starts with \"/\", try without",
"if",
"(",
"path",
".",
"star... | Gets the url of the given asset. Throws an exception if the asset cannot be found.
@param path the asset's path
@return the url | [
"Gets",
"the",
"url",
"of",
"the",
"given",
"asset",
".",
"Throws",
"an",
"exception",
"if",
"the",
"asset",
"cannot",
"be",
"found",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/framework/thymeleaf-template-engine/src/main/java/org/wisdom/template/thymeleaf/dialect/Routes.java#L377-L388 |
103,622 | wisdom-framework/wisdom | core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/file/DiskFileUpload.java | DiskFileUpload.push | @Override
public void push(final Buffer buffer) {
if (async == null) {
upload.pause();
vertx.fileSystem().open(file.getAbsolutePath(), new OpenOptions().setCreate(true),
new Handler<AsyncResult<AsyncFile>>() {
@Override
... | java | @Override
public void push(final Buffer buffer) {
if (async == null) {
upload.pause();
vertx.fileSystem().open(file.getAbsolutePath(), new OpenOptions().setCreate(true),
new Handler<AsyncResult<AsyncFile>>() {
@Override
... | [
"@",
"Override",
"public",
"void",
"push",
"(",
"final",
"Buffer",
"buffer",
")",
"{",
"if",
"(",
"async",
"==",
"null",
")",
"{",
"upload",
".",
"pause",
"(",
")",
";",
"vertx",
".",
"fileSystem",
"(",
")",
".",
"open",
"(",
"file",
".",
"getAbsol... | A new chunk has arrived, save it on disk.
@param buffer the chunk | [
"A",
"new",
"chunk",
"has",
"arrived",
"save",
"it",
"on",
"disk",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/file/DiskFileUpload.java#L103-L126 |
103,623 | wisdom-framework/wisdom | core/wisdom-api/src/main/java/org/wisdom/api/http/MimeTypes.java | MimeTypes.getMimeTypeForFile | public static String getMimeTypeForFile(URL url) {
if (url == null) {
//The input url is null so we can't retrieve a mimetype, therefore we return null.
return null;
}
String external = url.toExternalForm();
if (external.indexOf('.') == -1) {
return BI... | java | public static String getMimeTypeForFile(URL url) {
if (url == null) {
//The input url is null so we can't retrieve a mimetype, therefore we return null.
return null;
}
String external = url.toExternalForm();
if (external.indexOf('.') == -1) {
return BI... | [
"public",
"static",
"String",
"getMimeTypeForFile",
"(",
"URL",
"url",
")",
"{",
"if",
"(",
"url",
"==",
"null",
")",
"{",
"//The input url is null so we can't retrieve a mimetype, therefore we return null.",
"return",
"null",
";",
"}",
"String",
"external",
"=",
"url... | Makes an educated guess of the mime type of the resource pointed by this url.
It tries to extract an 'extension' part and confronts this extension to the list of known extensions.
@param url the url
@return the mime type, BINARY if not found. | [
"Makes",
"an",
"educated",
"guess",
"of",
"the",
"mime",
"type",
"of",
"the",
"resource",
"pointed",
"by",
"this",
"url",
".",
"It",
"tries",
"to",
"extract",
"an",
"extension",
"part",
"and",
"confronts",
"this",
"extension",
"to",
"the",
"list",
"of",
... | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-api/src/main/java/org/wisdom/api/http/MimeTypes.java#L103-L120 |
103,624 | wisdom-framework/wisdom | core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/VertxSingleton.java | VertxSingleton.start | @Validate
public void start() {
final Configuration configuration = appConfiguration.getConfiguration("vertx");
String log = System.getProperty("org.vertx.logger-delegate-factory-class-name");
if (log == null) {
// No logging backend configured, set one:
System.setP... | java | @Validate
public void start() {
final Configuration configuration = appConfiguration.getConfiguration("vertx");
String log = System.getProperty("org.vertx.logger-delegate-factory-class-name");
if (log == null) {
// No logging backend configured, set one:
System.setP... | [
"@",
"Validate",
"public",
"void",
"start",
"(",
")",
"{",
"final",
"Configuration",
"configuration",
"=",
"appConfiguration",
".",
"getConfiguration",
"(",
"\"vertx\"",
")",
";",
"String",
"log",
"=",
"System",
".",
"getProperty",
"(",
"\"org.vertx.logger-delegat... | Creates and exposed the instance of Vert.X. | [
"Creates",
"and",
"exposed",
"the",
"instance",
"of",
"Vert",
".",
"X",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/VertxSingleton.java#L61-L116 |
103,625 | wisdom-framework/wisdom | core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/VertxSingleton.java | VertxSingleton.stop | @Invalidate
public void stop() throws InterruptedException {
unregisterQuietly(vertxRegistration);
unregisterQuietly(busRegistration);
CountDownLatch latch = new CountDownLatch(1);
vertx.close(v -> latch.countDown());
latch.await();
vertx = null;
} | java | @Invalidate
public void stop() throws InterruptedException {
unregisterQuietly(vertxRegistration);
unregisterQuietly(busRegistration);
CountDownLatch latch = new CountDownLatch(1);
vertx.close(v -> latch.countDown());
latch.await();
vertx = null;
} | [
"@",
"Invalidate",
"public",
"void",
"stop",
"(",
")",
"throws",
"InterruptedException",
"{",
"unregisterQuietly",
"(",
"vertxRegistration",
")",
";",
"unregisterQuietly",
"(",
"busRegistration",
")",
";",
"CountDownLatch",
"latch",
"=",
"new",
"CountDownLatch",
"("... | Unregisters and shuts down the Vert.X singleton. | [
"Unregisters",
"and",
"shuts",
"down",
"the",
"Vert",
".",
"X",
"singleton",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/VertxSingleton.java#L121-L129 |
103,626 | wisdom-framework/wisdom | framework/resource-controller/src/main/java/org/wisdom/resources/AssetsSingleton.java | AssetsSingleton.assetAt | @Override
public Asset assetAt(String path) {
// The simplest implementation is to delegate to the provider and see if they return something.
for (AssetProvider provider : providers) {
Asset asset = provider.assetAt(path);
if (asset != null) {
return asset;
... | java | @Override
public Asset assetAt(String path) {
// The simplest implementation is to delegate to the provider and see if they return something.
for (AssetProvider provider : providers) {
Asset asset = provider.assetAt(path);
if (asset != null) {
return asset;
... | [
"@",
"Override",
"public",
"Asset",
"assetAt",
"(",
"String",
"path",
")",
"{",
"// The simplest implementation is to delegate to the provider and see if they return something.",
"for",
"(",
"AssetProvider",
"provider",
":",
"providers",
")",
"{",
"Asset",
"asset",
"=",
"... | Gets the path to retrieve the asset identified by its file name.
@param path the path
@return the path to retrieve the asset or {@literal null} if not found. If there are several matches,
return the first one. | [
"Gets",
"the",
"path",
"to",
"retrieve",
"the",
"asset",
"identified",
"by",
"its",
"file",
"name",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/framework/resource-controller/src/main/java/org/wisdom/resources/AssetsSingleton.java#L103-L113 |
103,627 | wisdom-framework/wisdom | framework/resource-controller/src/main/java/org/wisdom/resources/AssetsSingleton.java | AssetsSingleton.assets | @Override
public Collection<Asset<?>> assets(boolean useCache) {
if (useCache && !cache.isEmpty()) {
return new ArrayList<>(cache);
}
return assets();
} | java | @Override
public Collection<Asset<?>> assets(boolean useCache) {
if (useCache && !cache.isEmpty()) {
return new ArrayList<>(cache);
}
return assets();
} | [
"@",
"Override",
"public",
"Collection",
"<",
"Asset",
"<",
"?",
">",
">",
"assets",
"(",
"boolean",
"useCache",
")",
"{",
"if",
"(",
"useCache",
"&&",
"!",
"cache",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"new",
"ArrayList",
"<>",
"(",
"cache"... | Retrieve the list of all asset currently available on the platform.
@param useCache whether or not we can returned a cached version of the result. This cache may contain
invalidated data or may not contain all available assets.
@return the list of assets | [
"Retrieve",
"the",
"list",
"of",
"all",
"asset",
"currently",
"available",
"on",
"the",
"platform",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/framework/resource-controller/src/main/java/org/wisdom/resources/AssetsSingleton.java#L131-L138 |
103,628 | wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/osgi/Instructions.java | Instructions.sanitize | public static Properties sanitize(Properties properties) {
// convert any non-String keys/values to Strings
Properties sanitizedEntries = new Properties();
for (Iterator<?> itr = properties.entrySet().iterator(); itr.hasNext(); ) {
Map.Entry entry = (Map.Entry) itr.next();
... | java | public static Properties sanitize(Properties properties) {
// convert any non-String keys/values to Strings
Properties sanitizedEntries = new Properties();
for (Iterator<?> itr = properties.entrySet().iterator(); itr.hasNext(); ) {
Map.Entry entry = (Map.Entry) itr.next();
... | [
"public",
"static",
"Properties",
"sanitize",
"(",
"Properties",
"properties",
")",
"{",
"// convert any non-String keys/values to Strings",
"Properties",
"sanitizedEntries",
"=",
"new",
"Properties",
"(",
")",
";",
"for",
"(",
"Iterator",
"<",
"?",
">",
"itr",
"=",... | Utility method to sanitize the set of instructions.
@param properties the current instructions
@return the new set of instructions | [
"Utility",
"method",
"to",
"sanitize",
"the",
"set",
"of",
"instructions",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/osgi/Instructions.java#L122-L139 |
103,629 | wisdom-framework/wisdom | core/wisdom-api/src/main/java/org/wisdom/api/http/Result.java | Result.render | public Result render(Object object) {
if (object instanceof Renderable) {
this.content = (Renderable<?>) object;
} else {
this.content = new RenderableObject(object);
}
return this;
} | java | public Result render(Object object) {
if (object instanceof Renderable) {
this.content = (Renderable<?>) object;
} else {
this.content = new RenderableObject(object);
}
return this;
} | [
"public",
"Result",
"render",
"(",
"Object",
"object",
")",
"{",
"if",
"(",
"object",
"instanceof",
"Renderable",
")",
"{",
"this",
".",
"content",
"=",
"(",
"Renderable",
"<",
"?",
">",
")",
"object",
";",
"}",
"else",
"{",
"this",
".",
"content",
"... | Sets the content of the current result to the given object.
@param object the object
@return the current result | [
"Sets",
"the",
"content",
"of",
"the",
"current",
"result",
"to",
"the",
"given",
"object",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-api/src/main/java/org/wisdom/api/http/Result.java#L112-L119 |
103,630 | wisdom-framework/wisdom | core/wisdom-api/src/main/java/org/wisdom/api/http/Result.java | Result.with | public Result with(String headerName, String headerContent) {
headers.put(headerName, headerContent);
return this;
} | java | public Result with(String headerName, String headerContent) {
headers.put(headerName, headerContent);
return this;
} | [
"public",
"Result",
"with",
"(",
"String",
"headerName",
",",
"String",
"headerContent",
")",
"{",
"headers",
".",
"put",
"(",
"headerName",
",",
"headerContent",
")",
";",
"return",
"this",
";",
"}"
] | Sets a header. If this header was already set, the value is overridden.
@param headerName the header name
@param headerContent the header value
@return the current result. | [
"Sets",
"a",
"header",
".",
"If",
"this",
"header",
"was",
"already",
"set",
"the",
"value",
"is",
"overridden",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-api/src/main/java/org/wisdom/api/http/Result.java#L291-L294 |
103,631 | wisdom-framework/wisdom | core/wisdom-api/src/main/java/org/wisdom/api/http/Result.java | Result.discard | public Result discard(String name) {
Cookie cookie = getCookie(name);
if (cookie != null) {
cookies.remove(cookie);
cookies.add(Cookie.builder(cookie).setMaxAge(0).build());
} else {
cookies.add(Cookie.builder(name, "").setMaxAge(0).build());
}
... | java | public Result discard(String name) {
Cookie cookie = getCookie(name);
if (cookie != null) {
cookies.remove(cookie);
cookies.add(Cookie.builder(cookie).setMaxAge(0).build());
} else {
cookies.add(Cookie.builder(name, "").setMaxAge(0).build());
}
... | [
"public",
"Result",
"discard",
"(",
"String",
"name",
")",
"{",
"Cookie",
"cookie",
"=",
"getCookie",
"(",
"name",
")",
";",
"if",
"(",
"cookie",
"!=",
"null",
")",
"{",
"cookies",
".",
"remove",
"(",
"cookie",
")",
";",
"cookies",
".",
"add",
"(",
... | Discards the given cookie. The cookie max-age is set to 0, so is going to be invalidated.
@param name the name of the cookie
@return the current result | [
"Discards",
"the",
"given",
"cookie",
".",
"The",
"cookie",
"max",
"-",
"age",
"is",
"set",
"to",
"0",
"so",
"is",
"going",
"to",
"be",
"invalidated",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-api/src/main/java/org/wisdom/api/http/Result.java#L379-L388 |
103,632 | wisdom-framework/wisdom | core/wisdom-api/src/main/java/org/wisdom/api/http/Result.java | Result.redirect | public Result redirect(String url) {
status(Status.SEE_OTHER);
with(HeaderNames.LOCATION, url);
return this;
} | java | public Result redirect(String url) {
status(Status.SEE_OTHER);
with(HeaderNames.LOCATION, url);
return this;
} | [
"public",
"Result",
"redirect",
"(",
"String",
"url",
")",
"{",
"status",
"(",
"Status",
".",
"SEE_OTHER",
")",
";",
"with",
"(",
"HeaderNames",
".",
"LOCATION",
",",
"url",
")",
";",
"return",
"this",
";",
"}"
] | A redirect that uses 303 - SEE OTHER.
@param url The url used as redirect target.
@return A nicely configured result with status code 303 and the url set
as Location header. | [
"A",
"redirect",
"that",
"uses",
"303",
"-",
"SEE",
"OTHER",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-api/src/main/java/org/wisdom/api/http/Result.java#L432-L436 |
103,633 | wisdom-framework/wisdom | core/wisdom-api/src/main/java/org/wisdom/api/http/Result.java | Result.redirectTemporary | public Result redirectTemporary(String url) {
status(Status.TEMPORARY_REDIRECT);
with(HeaderNames.LOCATION, url);
return this;
} | java | public Result redirectTemporary(String url) {
status(Status.TEMPORARY_REDIRECT);
with(HeaderNames.LOCATION, url);
return this;
} | [
"public",
"Result",
"redirectTemporary",
"(",
"String",
"url",
")",
"{",
"status",
"(",
"Status",
".",
"TEMPORARY_REDIRECT",
")",
";",
"with",
"(",
"HeaderNames",
".",
"LOCATION",
",",
"url",
")",
";",
"return",
"this",
";",
"}"
] | A redirect that uses 307 see other.
@param url The url used as redirect target.
@return A nicely configured result with status code 307 and the url set
as Location header. | [
"A",
"redirect",
"that",
"uses",
"307",
"see",
"other",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-api/src/main/java/org/wisdom/api/http/Result.java#L445-L449 |
103,634 | wisdom-framework/wisdom | core/wisdom-api/src/main/java/org/wisdom/api/http/Result.java | Result.current | private Context current(boolean fail) {
Context context = Context.CONTEXT.get();
if (context == null && fail) {
throw new IllegalStateException("No context");
}
return context;
} | java | private Context current(boolean fail) {
Context context = Context.CONTEXT.get();
if (context == null && fail) {
throw new IllegalStateException("No context");
}
return context;
} | [
"private",
"Context",
"current",
"(",
"boolean",
"fail",
")",
"{",
"Context",
"context",
"=",
"Context",
".",
"CONTEXT",
".",
"get",
"(",
")",
";",
"if",
"(",
"context",
"==",
"null",
"&&",
"fail",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
... | Convenient method to retrieve the current HTTP context.
@param fail whether or no we should fail (i.e. throw an {@link java.lang.IllegalStateException}) if there are
no HTTP context
@return the HTTP context, {@code null} if none | [
"Convenient",
"method",
"to",
"retrieve",
"the",
"current",
"HTTP",
"context",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-api/src/main/java/org/wisdom/api/http/Result.java#L536-L542 |
103,635 | wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/mojos/StopMojo.java | StopMojo.execute | @Override
public void execute() throws MojoExecutionException {
new WisdomExecutor().stop(this);
File pid = new File(getWisdomRootDirectory(), "RUNNING_PID");
if (WisdomExecutor.waitForFileDeletion(pid)) {
getLog().info("Wisdom server stopped.");
} else {
thro... | java | @Override
public void execute() throws MojoExecutionException {
new WisdomExecutor().stop(this);
File pid = new File(getWisdomRootDirectory(), "RUNNING_PID");
if (WisdomExecutor.waitForFileDeletion(pid)) {
getLog().info("Wisdom server stopped.");
} else {
thro... | [
"@",
"Override",
"public",
"void",
"execute",
"(",
")",
"throws",
"MojoExecutionException",
"{",
"new",
"WisdomExecutor",
"(",
")",
".",
"stop",
"(",
"this",
")",
";",
"File",
"pid",
"=",
"new",
"File",
"(",
"getWisdomRootDirectory",
"(",
")",
",",
"\"RUNN... | Tries to stops the running Wisdom server.
@throws MojoExecutionException if the Wisdom server cannot be stopped | [
"Tries",
"to",
"stops",
"the",
"running",
"Wisdom",
"server",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/mojos/StopMojo.java#L45-L55 |
103,636 | wisdom-framework/wisdom | framework/ehcache-cache-service/src/main/java/org/wisdom/cache/ehcache/EhCacheService.java | EhCacheService.start | @Validate
public void start() {
Boolean enabled = configuration.getBooleanWithDefault("ehcache.enabled", true);
if (!enabled) {
return;
}
File config = new File(configuration.getBaseDir(), CUSTOM_CONFIGURATION);
final ClassLoader original = Thread.currentThread()... | java | @Validate
public void start() {
Boolean enabled = configuration.getBooleanWithDefault("ehcache.enabled", true);
if (!enabled) {
return;
}
File config = new File(configuration.getBaseDir(), CUSTOM_CONFIGURATION);
final ClassLoader original = Thread.currentThread()... | [
"@",
"Validate",
"public",
"void",
"start",
"(",
")",
"{",
"Boolean",
"enabled",
"=",
"configuration",
".",
"getBooleanWithDefault",
"(",
"\"ehcache.enabled\"",
",",
"true",
")",
";",
"if",
"(",
"!",
"enabled",
")",
"{",
"return",
";",
"}",
"File",
"config... | Creates the EhCache-based implementation of the Cache Service. | [
"Creates",
"the",
"EhCache",
"-",
"based",
"implementation",
"of",
"the",
"Cache",
"Service",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/framework/ehcache-cache-service/src/main/java/org/wisdom/cache/ehcache/EhCacheService.java#L70-L101 |
103,637 | wisdom-framework/wisdom | framework/ehcache-cache-service/src/main/java/org/wisdom/cache/ehcache/EhCacheService.java | EhCacheService.stop | @Invalidate
public void stop() {
if (registration != null) {
registration.unregister();
registration = null;
}
if (manager != null) {
manager.removeCache(WISDOM_KEY);
}
} | java | @Invalidate
public void stop() {
if (registration != null) {
registration.unregister();
registration = null;
}
if (manager != null) {
manager.removeCache(WISDOM_KEY);
}
} | [
"@",
"Invalidate",
"public",
"void",
"stop",
"(",
")",
"{",
"if",
"(",
"registration",
"!=",
"null",
")",
"{",
"registration",
".",
"unregister",
"(",
")",
";",
"registration",
"=",
"null",
";",
"}",
"if",
"(",
"manager",
"!=",
"null",
")",
"{",
"man... | Cleans up everything. | [
"Cleans",
"up",
"everything",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/framework/ehcache-cache-service/src/main/java/org/wisdom/cache/ehcache/EhCacheService.java#L107-L116 |
103,638 | wisdom-framework/wisdom | framework/ehcache-cache-service/src/main/java/org/wisdom/cache/ehcache/EhCacheService.java | EhCacheService.set | @Override
public void set(String key, Object value, int expiration) {
Element element = new Element(key, value);
if (expiration == 0) {
element.setEternal(true);
}
element.setTimeToLive(expiration);
cache.put(element);
} | java | @Override
public void set(String key, Object value, int expiration) {
Element element = new Element(key, value);
if (expiration == 0) {
element.setEternal(true);
}
element.setTimeToLive(expiration);
cache.put(element);
} | [
"@",
"Override",
"public",
"void",
"set",
"(",
"String",
"key",
",",
"Object",
"value",
",",
"int",
"expiration",
")",
"{",
"Element",
"element",
"=",
"new",
"Element",
"(",
"key",
",",
"value",
")",
";",
"if",
"(",
"expiration",
"==",
"0",
")",
"{",... | Adds an entry in the cache.
@param key Item key.
@param value Item value.
@param expiration Expiration time in seconds (0 second means eternity). | [
"Adds",
"an",
"entry",
"in",
"the",
"cache",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/framework/ehcache-cache-service/src/main/java/org/wisdom/cache/ehcache/EhCacheService.java#L125-L133 |
103,639 | wisdom-framework/wisdom | framework/ehcache-cache-service/src/main/java/org/wisdom/cache/ehcache/EhCacheService.java | EhCacheService.get | @Override
public Object get(String key) {
Element element = cache.get(key);
if (element != null) {
return element.getObjectValue();
}
return null;
} | java | @Override
public Object get(String key) {
Element element = cache.get(key);
if (element != null) {
return element.getObjectValue();
}
return null;
} | [
"@",
"Override",
"public",
"Object",
"get",
"(",
"String",
"key",
")",
"{",
"Element",
"element",
"=",
"cache",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"element",
"!=",
"null",
")",
"{",
"return",
"element",
".",
"getObjectValue",
"(",
")",
";",... | Gets an entry from the cache.
@param key Item key.
@return the stored object, {@literal null} if none of expired. | [
"Gets",
"an",
"entry",
"from",
"the",
"cache",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/framework/ehcache-cache-service/src/main/java/org/wisdom/cache/ehcache/EhCacheService.java#L159-L166 |
103,640 | wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/mojos/AbstractWisdomWatcherMojo.java | AbstractWisdomWatcherMojo.getResources | public Collection<File> getResources(List<String> extensions) {
List<File> files = new ArrayList<>();
files.addAll(WatcherUtils.getAllFilesFromDirectory(getInternalAssetsDirectory(), extensions));
files.addAll(WatcherUtils.getAllFilesFromDirectory(getExternalAssetsDirectory(), extensions));
... | java | public Collection<File> getResources(List<String> extensions) {
List<File> files = new ArrayList<>();
files.addAll(WatcherUtils.getAllFilesFromDirectory(getInternalAssetsDirectory(), extensions));
files.addAll(WatcherUtils.getAllFilesFromDirectory(getExternalAssetsDirectory(), extensions));
... | [
"public",
"Collection",
"<",
"File",
">",
"getResources",
"(",
"List",
"<",
"String",
">",
"extensions",
")",
"{",
"List",
"<",
"File",
">",
"files",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"files",
".",
"addAll",
"(",
"WatcherUtils",
".",
"getAl... | Finds all resources from internal and external assets directories having one of the specified extensions.
@param extensions the extensions
@return the set of file, potentially empty if no files match. | [
"Finds",
"all",
"resources",
"from",
"internal",
"and",
"external",
"assets",
"directories",
"having",
"one",
"of",
"the",
"specified",
"extensions",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/mojos/AbstractWisdomWatcherMojo.java#L73-L78 |
103,641 | wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/mojos/AbstractWisdomWatcherMojo.java | AbstractWisdomWatcherMojo.getFilteredVersion | public File getFilteredVersion(File input) {
File out = getOutputFile(input);
if (!out.isFile()) {
return null;
}
return out;
} | java | public File getFilteredVersion(File input) {
File out = getOutputFile(input);
if (!out.isFile()) {
return null;
}
return out;
} | [
"public",
"File",
"getFilteredVersion",
"(",
"File",
"input",
")",
"{",
"File",
"out",
"=",
"getOutputFile",
"(",
"input",
")",
";",
"if",
"(",
"!",
"out",
".",
"isFile",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"return",
"out",
";",
"}"
] | Searches if the given file has already being copied to its output directory and so may have been 'filtered'.
@param input the input file
@return the 'filtered' file if exists, {@code null} otherwise | [
"Searches",
"if",
"the",
"given",
"file",
"has",
"already",
"being",
"copied",
"to",
"its",
"output",
"directory",
"and",
"so",
"may",
"have",
"been",
"filtered",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/mojos/AbstractWisdomWatcherMojo.java#L86-L92 |
103,642 | wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/osgi/MavenArtifact.java | MavenArtifact.isValid | public static boolean isValid(Artifact artifact) {
return artifact.getGroupId() != null && !FAKE.equals(artifact.getGroupId());
} | java | public static boolean isValid(Artifact artifact) {
return artifact.getGroupId() != null && !FAKE.equals(artifact.getGroupId());
} | [
"public",
"static",
"boolean",
"isValid",
"(",
"Artifact",
"artifact",
")",
"{",
"return",
"artifact",
".",
"getGroupId",
"(",
")",
"!=",
"null",
"&&",
"!",
"FAKE",
".",
"equals",
"(",
"artifact",
".",
"getGroupId",
"(",
")",
")",
";",
"}"
] | Ensures that the given artifact was correctly populated.
@param artifact the artifact
@return {@code true} if the artifact is valid, @{code false} otherwise. | [
"Ensures",
"that",
"the",
"given",
"artifact",
"was",
"correctly",
"populated",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/osgi/MavenArtifact.java#L54-L56 |
103,643 | wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/osgi/MavenArtifact.java | MavenArtifact.filter | public static Collection<? extends Artifact> filter(Collection<Artifact> artifacts) {
LinkedHashSet<Artifact> set = new LinkedHashSet<>();
for (Artifact artifact : artifacts) {
if (MavenArtifact.isValid(artifact)) {
set.add(artifact);
}
}
return se... | java | public static Collection<? extends Artifact> filter(Collection<Artifact> artifacts) {
LinkedHashSet<Artifact> set = new LinkedHashSet<>();
for (Artifact artifact : artifacts) {
if (MavenArtifact.isValid(artifact)) {
set.add(artifact);
}
}
return se... | [
"public",
"static",
"Collection",
"<",
"?",
"extends",
"Artifact",
">",
"filter",
"(",
"Collection",
"<",
"Artifact",
">",
"artifacts",
")",
"{",
"LinkedHashSet",
"<",
"Artifact",
">",
"set",
"=",
"new",
"LinkedHashSet",
"<>",
"(",
")",
";",
"for",
"(",
... | Removes non valid artifacts from the given list.
@param artifacts the list of artifacts than may contain fake artifacts.
@return the cleaned up list | [
"Removes",
"non",
"valid",
"artifacts",
"from",
"the",
"given",
"list",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/osgi/MavenArtifact.java#L64-L72 |
103,644 | wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/osgi/MavenArtifact.java | MavenArtifact.setDependencyFilter | public void setDependencyFilter(ObjectNode filter) {
if (filter == null) {
return;
}
final JsonNode patterns = filter.get("patterns");
if (patterns != null && patterns.isArray()) {
List<String> ids = new ArrayList<>();
for (JsonNode exclusion : pattern... | java | public void setDependencyFilter(ObjectNode filter) {
if (filter == null) {
return;
}
final JsonNode patterns = filter.get("patterns");
if (patterns != null && patterns.isArray()) {
List<String> ids = new ArrayList<>();
for (JsonNode exclusion : pattern... | [
"public",
"void",
"setDependencyFilter",
"(",
"ObjectNode",
"filter",
")",
"{",
"if",
"(",
"filter",
"==",
"null",
")",
"{",
"return",
";",
"}",
"final",
"JsonNode",
"patterns",
"=",
"filter",
".",
"get",
"(",
"\"patterns\"",
")",
";",
"if",
"(",
"patter... | A setter method made especially for Jackson. Artifact's dependency filter is used for the exclusion list. As
the filter cannot be created directly by Jackson, we do the job directly here.
@param filter the Json representation of the filter | [
"A",
"setter",
"method",
"made",
"especially",
"for",
"Jackson",
".",
"Artifact",
"s",
"dependency",
"filter",
"is",
"used",
"for",
"the",
"exclusion",
"list",
".",
"As",
"the",
"filter",
"cannot",
"be",
"created",
"directly",
"by",
"Jackson",
"we",
"do",
... | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/osgi/MavenArtifact.java#L80-L92 |
103,645 | wisdom-framework/wisdom | framework/i18n-service/src/main/java/org/wisdom/i18n/I18nExtension.java | I18nExtension.get | public String get(String key, Object... args) {
String value = bundle.getString(key);
if (args.length != 0) {
value = MessageFormat.format(value, args);
}
return value;
} | java | public String get(String key, Object... args) {
String value = bundle.getString(key);
if (args.length != 0) {
value = MessageFormat.format(value, args);
}
return value;
} | [
"public",
"String",
"get",
"(",
"String",
"key",
",",
"Object",
"...",
"args",
")",
"{",
"String",
"value",
"=",
"bundle",
".",
"getString",
"(",
"key",
")",
";",
"if",
"(",
"args",
".",
"length",
"!=",
"0",
")",
"{",
"value",
"=",
"MessageFormat",
... | Gets the localized message for the given key.
@param key the key
@param args the message parameters, can be empty.
@return the localized message or {@literal null} if the key does not
exist in the bundle. If {@literal args} is not empty, the retrieve message is formatted using the given
arguments. This formatting use... | [
"Gets",
"the",
"localized",
"message",
"for",
"the",
"given",
"key",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/framework/i18n-service/src/main/java/org/wisdom/i18n/I18nExtension.java#L129-L135 |
103,646 | wisdom-framework/wisdom | framework/i18n-service/src/main/java/org/wisdom/i18n/I18nExtension.java | I18nExtension.keys | public Set<String> keys() {
Set<String> list = new LinkedHashSet<>();
Enumeration<String> keys = bundle.getKeys();
while (keys.hasMoreElements()) {
list.add(keys.nextElement());
}
return list;
} | java | public Set<String> keys() {
Set<String> list = new LinkedHashSet<>();
Enumeration<String> keys = bundle.getKeys();
while (keys.hasMoreElements()) {
list.add(keys.nextElement());
}
return list;
} | [
"public",
"Set",
"<",
"String",
">",
"keys",
"(",
")",
"{",
"Set",
"<",
"String",
">",
"list",
"=",
"new",
"LinkedHashSet",
"<>",
"(",
")",
";",
"Enumeration",
"<",
"String",
">",
"keys",
"=",
"bundle",
".",
"getKeys",
"(",
")",
";",
"while",
"(",
... | Gets the keys contained in the bundle.
@return the keys. At least one key is returned as empty bundle
was rejected. | [
"Gets",
"the",
"keys",
"contained",
"in",
"the",
"bundle",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/framework/i18n-service/src/main/java/org/wisdom/i18n/I18nExtension.java#L143-L150 |
103,647 | wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/DependencyCopy.java | DependencyCopy.copyBundles | public static void copyBundles(AbstractWisdomMojo mojo, DependencyGraphBuilder graph, boolean transitive,
boolean deployTestDependencies, boolean disableDefaultExclusions, Libraries libraries)
throws IOException {
File applicationDirectory = new File(mojo.getWisdom... | java | public static void copyBundles(AbstractWisdomMojo mojo, DependencyGraphBuilder graph, boolean transitive,
boolean deployTestDependencies, boolean disableDefaultExclusions, Libraries libraries)
throws IOException {
File applicationDirectory = new File(mojo.getWisdom... | [
"public",
"static",
"void",
"copyBundles",
"(",
"AbstractWisdomMojo",
"mojo",
",",
"DependencyGraphBuilder",
"graph",
",",
"boolean",
"transitive",
",",
"boolean",
"deployTestDependencies",
",",
"boolean",
"disableDefaultExclusions",
",",
"Libraries",
"libraries",
")",
... | Copies dependencies, that are bundles, to the application directory.
If the bundle is already in core or runtime, the bundle is not copied.
@param mojo the mojo
@param graph the dependency graph builder
@param transitive whether or not we include the transitive depe... | [
"Copies",
"dependencies",
"that",
"are",
"bundles",
"to",
"the",
"application",
"directory",
".",
"If",
"the",
"bundle",
"is",
"already",
"in",
"core",
"or",
"runtime",
"the",
"bundle",
"is",
"not",
"copied",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/DependencyCopy.java#L59-L120 |
103,648 | wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/DependencyCopy.java | DependencyCopy.getArtifactsToConsider | public static Set<Artifact> getArtifactsToConsider(AbstractWisdomMojo mojo, DependencyGraphBuilder graph,
boolean transitive, ArtifactFilter filter) {
// No transitive.
Set<Artifact> artifacts;
if (!transitive) {
// Direct depend... | java | public static Set<Artifact> getArtifactsToConsider(AbstractWisdomMojo mojo, DependencyGraphBuilder graph,
boolean transitive, ArtifactFilter filter) {
// No transitive.
Set<Artifact> artifacts;
if (!transitive) {
// Direct depend... | [
"public",
"static",
"Set",
"<",
"Artifact",
">",
"getArtifactsToConsider",
"(",
"AbstractWisdomMojo",
"mojo",
",",
"DependencyGraphBuilder",
"graph",
",",
"boolean",
"transitive",
",",
"ArtifactFilter",
"filter",
")",
"{",
"// No transitive.",
"Set",
"<",
"Artifact",
... | Gets the list of artifact to consider during the analysis.
@param mojo the mojo
@param graph the dependency graph builder
@param transitive do we have to include transitive dependencies
@return the set of artifacts | [
"Gets",
"the",
"list",
"of",
"artifact",
"to",
"consider",
"during",
"the",
"analysis",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/DependencyCopy.java#L191-L205 |
103,649 | wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/DependencyCopy.java | DependencyCopy.getTransitiveDependencies | private static Set<Artifact> getTransitiveDependencies(AbstractWisdomMojo mojo, DependencyGraphBuilder graph,
ArtifactFilter filter) {
Set<Artifact> artifacts;
artifacts = new LinkedHashSet<>();
try {
Set<Artifact> transitive... | java | private static Set<Artifact> getTransitiveDependencies(AbstractWisdomMojo mojo, DependencyGraphBuilder graph,
ArtifactFilter filter) {
Set<Artifact> artifacts;
artifacts = new LinkedHashSet<>();
try {
Set<Artifact> transitive... | [
"private",
"static",
"Set",
"<",
"Artifact",
">",
"getTransitiveDependencies",
"(",
"AbstractWisdomMojo",
"mojo",
",",
"DependencyGraphBuilder",
"graph",
",",
"ArtifactFilter",
"filter",
")",
"{",
"Set",
"<",
"Artifact",
">",
"artifacts",
";",
"artifacts",
"=",
"n... | Collects the transitive dependencies of the current projects.
@param mojo the mojo
@param graph the dependency graph builder
@return the set of resolved transitive dependencies. | [
"Collects",
"the",
"transitive",
"dependencies",
"of",
"the",
"current",
"projects",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/DependencyCopy.java#L214-L243 |
103,650 | wisdom-framework/wisdom | extensions/wisdom-filters/src/main/java/org/wisdom/framework/csrf/AddCSRFTokenInterceptor.java | AddCSRFTokenInterceptor.call | @Override
public Result call(AddCSRFToken configuration, RequestContext context) throws Exception {
if (csrf.eligibleForCSRF(context.context())
&& (csrf.extractTokenFromRequest(context.context()) == null || configuration.newTokenOnEachRequest())) {
// Generate a new token, it wil... | java | @Override
public Result call(AddCSRFToken configuration, RequestContext context) throws Exception {
if (csrf.eligibleForCSRF(context.context())
&& (csrf.extractTokenFromRequest(context.context()) == null || configuration.newTokenOnEachRequest())) {
// Generate a new token, it wil... | [
"@",
"Override",
"public",
"Result",
"call",
"(",
"AddCSRFToken",
"configuration",
",",
"RequestContext",
"context",
")",
"throws",
"Exception",
"{",
"if",
"(",
"csrf",
".",
"eligibleForCSRF",
"(",
"context",
".",
"context",
"(",
")",
")",
"&&",
"(",
"csrf",... | Injects a CSRF token into the result if the request is eligible.
@param configuration the interception configuration
@param context the interception context
@return the result with the token if a token was added
@throws Exception if anything bad happen | [
"Injects",
"a",
"CSRF",
"token",
"into",
"the",
"result",
"if",
"the",
"request",
"is",
"eligible",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-filters/src/main/java/org/wisdom/framework/csrf/AddCSRFTokenInterceptor.java#L50-L61 |
103,651 | wisdom-framework/wisdom | framework/resource-controller/src/main/java/org/wisdom/resources/WebJarController.java | WebJarController.start | @Validate
public void start() {
if (directory.isDirectory()) {
buildFileIndex();
}
if (tracker != null) {
tracker.open();
}
if (deployer != null) {
deployer.start();
}
} | java | @Validate
public void start() {
if (directory.isDirectory()) {
buildFileIndex();
}
if (tracker != null) {
tracker.open();
}
if (deployer != null) {
deployer.start();
}
} | [
"@",
"Validate",
"public",
"void",
"start",
"(",
")",
"{",
"if",
"(",
"directory",
".",
"isDirectory",
"(",
")",
")",
"{",
"buildFileIndex",
"(",
")",
";",
"}",
"if",
"(",
"tracker",
"!=",
"null",
")",
"{",
"tracker",
".",
"open",
"(",
")",
";",
... | Starts the controllers. | [
"Starts",
"the",
"controllers",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/framework/resource-controller/src/main/java/org/wisdom/resources/WebJarController.java#L149-L160 |
103,652 | wisdom-framework/wisdom | framework/resource-controller/src/main/java/org/wisdom/resources/WebJarController.java | WebJarController.stop | @Invalidate
public void stop() {
if (deployer != null) {
deployer.stop();
}
if (tracker != null) {
tracker.close();
}
libraries.clear();
} | java | @Invalidate
public void stop() {
if (deployer != null) {
deployer.stop();
}
if (tracker != null) {
tracker.close();
}
libraries.clear();
} | [
"@",
"Invalidate",
"public",
"void",
"stop",
"(",
")",
"{",
"if",
"(",
"deployer",
"!=",
"null",
")",
"{",
"deployer",
".",
"stop",
"(",
")",
";",
"}",
"if",
"(",
"tracker",
"!=",
"null",
")",
"{",
"tracker",
".",
"close",
"(",
")",
";",
"}",
"... | Stops the controllers. | [
"Stops",
"the",
"controllers",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/framework/resource-controller/src/main/java/org/wisdom/resources/WebJarController.java#L165-L174 |
103,653 | wisdom-framework/wisdom | framework/resource-controller/src/main/java/org/wisdom/resources/WebJarController.java | WebJarController.modifiedBundle | @Override
public void modifiedBundle(Bundle bundle, BundleEvent bundleEvent, List<BundleWebJarLib> webJarLibs) {
// Remove all WebJars from the given bundle, and then read tem.
synchronized (this) {
removedBundle(bundle, bundleEvent, webJarLibs);
addingBundle(bundle, bundleEv... | java | @Override
public void modifiedBundle(Bundle bundle, BundleEvent bundleEvent, List<BundleWebJarLib> webJarLibs) {
// Remove all WebJars from the given bundle, and then read tem.
synchronized (this) {
removedBundle(bundle, bundleEvent, webJarLibs);
addingBundle(bundle, bundleEv... | [
"@",
"Override",
"public",
"void",
"modifiedBundle",
"(",
"Bundle",
"bundle",
",",
"BundleEvent",
"bundleEvent",
",",
"List",
"<",
"BundleWebJarLib",
">",
"webJarLibs",
")",
"{",
"// Remove all WebJars from the given bundle, and then read tem.",
"synchronized",
"(",
"this... | A bundle is updated.
@param bundle the bundle
@param bundleEvent the event
@param webJarLibs the webjars that were embedded in the previous version of the bundle. | [
"A",
"bundle",
"is",
"updated",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/framework/resource-controller/src/main/java/org/wisdom/resources/WebJarController.java#L340-L347 |
103,654 | wisdom-framework/wisdom | framework/resource-controller/src/main/java/org/wisdom/resources/WebJarController.java | WebJarController.removedBundle | @Override
public void removedBundle(Bundle bundle, BundleEvent bundleEvent, List<BundleWebJarLib> webJarLibs) {
removeWebJarLibs(webJarLibs);
} | java | @Override
public void removedBundle(Bundle bundle, BundleEvent bundleEvent, List<BundleWebJarLib> webJarLibs) {
removeWebJarLibs(webJarLibs);
} | [
"@",
"Override",
"public",
"void",
"removedBundle",
"(",
"Bundle",
"bundle",
",",
"BundleEvent",
"bundleEvent",
",",
"List",
"<",
"BundleWebJarLib",
">",
"webJarLibs",
")",
"{",
"removeWebJarLibs",
"(",
"webJarLibs",
")",
";",
"}"
] | A bundle is removed.
@param bundle the bundle
@param bundleEvent the event
@param webJarLibs the webjars that were embedded in the bundle. | [
"A",
"bundle",
"is",
"removed",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/framework/resource-controller/src/main/java/org/wisdom/resources/WebJarController.java#L356-L359 |
103,655 | wisdom-framework/wisdom | extensions/wisdom-raml/wisdom-raml-maven-plugin/src/main/java/org/wisdom/raml/visitor/RamlControllerVisitor.java | RamlControllerVisitor.visit | @Override
public void visit(ControllerModel element, Raml raml) {
raml.setTitle(element.getName());
if (element.getDescription() != null && !element.getDescription().isEmpty()) {
DocumentationItem doc = new DocumentationItem();
doc.setContent(element.getDescription());
... | java | @Override
public void visit(ControllerModel element, Raml raml) {
raml.setTitle(element.getName());
if (element.getDescription() != null && !element.getDescription().isEmpty()) {
DocumentationItem doc = new DocumentationItem();
doc.setContent(element.getDescription());
... | [
"@",
"Override",
"public",
"void",
"visit",
"(",
"ControllerModel",
"element",
",",
"Raml",
"raml",
")",
"{",
"raml",
".",
"setTitle",
"(",
"element",
".",
"getName",
"(",
")",
")",
";",
"if",
"(",
"element",
".",
"getDescription",
"(",
")",
"!=",
"nul... | Visit the Wisdom Controller source model in order to populate the raml model.
@param element The wisdom controller model (we visit it).
@param raml The raml model (we construct it). | [
"Visit",
"the",
"Wisdom",
"Controller",
"source",
"model",
"in",
"order",
"to",
"populate",
"the",
"raml",
"model",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-raml/wisdom-raml-maven-plugin/src/main/java/org/wisdom/raml/visitor/RamlControllerVisitor.java#L63-L80 |
103,656 | wisdom-framework/wisdom | extensions/wisdom-raml/wisdom-raml-maven-plugin/src/main/java/org/wisdom/raml/visitor/RamlControllerVisitor.java | RamlControllerVisitor.addResponsesToAction | private void addResponsesToAction(ControllerRouteModel<Raml> elem, Action action) {
// get all mimeTypes defined in @Route.produces
LOGGER.debug("responsesMimes.size:"+elem.getResponseMimes().size());
List<String> mimes = new ArrayList<>();
mimes.addAll(elem.getResponseMimes());
... | java | private void addResponsesToAction(ControllerRouteModel<Raml> elem, Action action) {
// get all mimeTypes defined in @Route.produces
LOGGER.debug("responsesMimes.size:"+elem.getResponseMimes().size());
List<String> mimes = new ArrayList<>();
mimes.addAll(elem.getResponseMimes());
... | [
"private",
"void",
"addResponsesToAction",
"(",
"ControllerRouteModel",
"<",
"Raml",
">",
"elem",
",",
"Action",
"action",
")",
"{",
"// get all mimeTypes defined in @Route.produces",
"LOGGER",
".",
"debug",
"(",
"\"responsesMimes.size:\"",
"+",
"elem",
".",
"getRespons... | Add the response specification to the given action.
@param elem The ControllerRouteModel that contains the response specification.
@param action The Action on which to add the response specification. | [
"Add",
"the",
"response",
"specification",
"to",
"the",
"given",
"action",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-raml/wisdom-raml-maven-plugin/src/main/java/org/wisdom/raml/visitor/RamlControllerVisitor.java#L294-L337 |
103,657 | wisdom-framework/wisdom | extensions/wisdom-raml/wisdom-raml-maven-plugin/src/main/java/org/wisdom/raml/visitor/RamlControllerVisitor.java | RamlControllerVisitor.addActionFromRouteElem | private void addActionFromRouteElem(ControllerRouteModel<Raml> elem, Resource resource) {
Action action = new Action();
action.setType(ActionType.valueOf(elem.getHttpMethod().name()));
action.setDescription(elem.getDescription());
//handle body
addBodyToAction(elem, action);
... | java | private void addActionFromRouteElem(ControllerRouteModel<Raml> elem, Resource resource) {
Action action = new Action();
action.setType(ActionType.valueOf(elem.getHttpMethod().name()));
action.setDescription(elem.getDescription());
//handle body
addBodyToAction(elem, action);
... | [
"private",
"void",
"addActionFromRouteElem",
"(",
"ControllerRouteModel",
"<",
"Raml",
">",
"elem",
",",
"Resource",
"resource",
")",
"{",
"Action",
"action",
"=",
"new",
"Action",
"(",
")",
";",
"action",
".",
"setType",
"(",
"ActionType",
".",
"valueOf",
"... | Set the resource action from the wisdom route element.
@param elem The wisdom route element that we are visiting
@param resource The raml resource corresponding to the route element | [
"Set",
"the",
"resource",
"action",
"from",
"the",
"wisdom",
"route",
"element",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-raml/wisdom-raml-maven-plugin/src/main/java/org/wisdom/raml/visitor/RamlControllerVisitor.java#L345-L435 |
103,658 | wisdom-framework/wisdom | extensions/wisdom-raml/wisdom-raml-maven-plugin/src/main/java/org/wisdom/raml/visitor/RamlControllerVisitor.java | RamlControllerVisitor.ancestorOrIHasParam | private static Boolean ancestorOrIHasParam(final Resource resource, String uriParamName) {
Resource ancestor = resource;
while (ancestor != null) {
if (ancestor.getUriParameters().containsKey(uriParamName)) {
return true;
}
ancestor = ancestor.getPare... | java | private static Boolean ancestorOrIHasParam(final Resource resource, String uriParamName) {
Resource ancestor = resource;
while (ancestor != null) {
if (ancestor.getUriParameters().containsKey(uriParamName)) {
return true;
}
ancestor = ancestor.getPare... | [
"private",
"static",
"Boolean",
"ancestorOrIHasParam",
"(",
"final",
"Resource",
"resource",
",",
"String",
"uriParamName",
")",
"{",
"Resource",
"ancestor",
"=",
"resource",
";",
"while",
"(",
"ancestor",
"!=",
"null",
")",
"{",
"if",
"(",
"ancestor",
".",
... | Check if the given resource or its ancestor have the uri param of given name.
@param resource The resource on which to check.
@param uriParamName Name of the uri Param we are looking for.
@return <code>true</code> if this or its ancestor resource have the param of given name already define. | [
"Check",
"if",
"the",
"given",
"resource",
"or",
"its",
"ancestor",
"have",
"the",
"uri",
"param",
"of",
"given",
"name",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-raml/wisdom-raml-maven-plugin/src/main/java/org/wisdom/raml/visitor/RamlControllerVisitor.java#L444-L455 |
103,659 | wisdom-framework/wisdom | extensions/wisdom-raml/wisdom-raml-maven-plugin/src/main/java/org/wisdom/raml/visitor/RamlControllerVisitor.java | RamlControllerVisitor.typeConverter | private static ParamType typeConverter(String typeName) {
if (typeName == null || typeName.isEmpty()) {
return null;
}
if ("Number".equals(typeName) || "Long".equalsIgnoreCase(typeName)
|| "Integer".equals(typeName) || "int".equals(typeName)) {
return Par... | java | private static ParamType typeConverter(String typeName) {
if (typeName == null || typeName.isEmpty()) {
return null;
}
if ("Number".equals(typeName) || "Long".equalsIgnoreCase(typeName)
|| "Integer".equals(typeName) || "int".equals(typeName)) {
return Par... | [
"private",
"static",
"ParamType",
"typeConverter",
"(",
"String",
"typeName",
")",
"{",
"if",
"(",
"typeName",
"==",
"null",
"||",
"typeName",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"\"Number\"",
".",
"equals",
"(",
... | Convert a string version of the type name into a ParamType enum or null if nothing correspond.
@param typeName The type name.
@return the {@link ParamType} corresponding to the given type name. | [
"Convert",
"a",
"string",
"version",
"of",
"the",
"type",
"name",
"into",
"a",
"ParamType",
"enum",
"or",
"null",
"if",
"nothing",
"correspond",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-raml/wisdom-raml-maven-plugin/src/main/java/org/wisdom/raml/visitor/RamlControllerVisitor.java#L463-L490 |
103,660 | wisdom-framework/wisdom | core/content-manager/src/main/java/org/wisdom/content/converters/ParamConverterEngine.java | ParamConverterEngine.newInstance | @Override
public <T> T newInstance(Context context, Class<T> type) throws IllegalArgumentException {
// Retrieve the factory
for (ParameterFactory factory : factories) {
if (factory.getType().equals(type)) {
// Factory found - instantiate
//noinspection un... | java | @Override
public <T> T newInstance(Context context, Class<T> type) throws IllegalArgumentException {
// Retrieve the factory
for (ParameterFactory factory : factories) {
if (factory.getType().equals(type)) {
// Factory found - instantiate
//noinspection un... | [
"@",
"Override",
"public",
"<",
"T",
">",
"T",
"newInstance",
"(",
"Context",
"context",
",",
"Class",
"<",
"T",
">",
"type",
")",
"throws",
"IllegalArgumentException",
"{",
"// Retrieve the factory",
"for",
"(",
"ParameterFactory",
"factory",
":",
"factories",
... | Creates an instance of T from the given HTTP content. Unlike converters, it does not handler generics or
collections.
@param context the HTTP content
@param type the class to instantiate
@return the created object
@throws IllegalArgumentException if there are no {@link org.wisdom.api.content.ParameterFactory} avail... | [
"Creates",
"an",
"instance",
"of",
"T",
"from",
"the",
"given",
"HTTP",
"content",
".",
"Unlike",
"converters",
"it",
"does",
"not",
"handler",
"generics",
"or",
"collections",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/content-manager/src/main/java/org/wisdom/content/converters/ParamConverterEngine.java#L138-L150 |
103,661 | wisdom-framework/wisdom | core/content-manager/src/main/java/org/wisdom/content/converters/ParamConverterEngine.java | ParamConverterEngine.getConverter | @SuppressWarnings("unchecked")
private <T> ParameterConverter<T> getConverter(Class<T> type) {
// check for String first
if (type == String.class) {
return (ParameterConverter<T>) StringConverter.INSTANCE;
}
// Search for exposed converters.
for (ParameterConvert... | java | @SuppressWarnings("unchecked")
private <T> ParameterConverter<T> getConverter(Class<T> type) {
// check for String first
if (type == String.class) {
return (ParameterConverter<T>) StringConverter.INSTANCE;
}
// Search for exposed converters.
for (ParameterConvert... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"<",
"T",
">",
"ParameterConverter",
"<",
"T",
">",
"getConverter",
"(",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"// check for String first",
"if",
"(",
"type",
"==",
"String",
".",
"class",
... | Searches a suitable converter to convert String to the given type.
@param type the target type
@param <T> the class
@return the parameter converter able to creates instances of the target type from String representations.
@throws java.util.NoSuchElementException if no converter can be found | [
"Searches",
"a",
"suitable",
"converter",
"to",
"convert",
"String",
"to",
"the",
"given",
"type",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/content-manager/src/main/java/org/wisdom/content/converters/ParamConverterEngine.java#L272-L322 |
103,662 | wisdom-framework/wisdom | extensions/wisdom-monitor/src/main/java/org/wisdom/monitor/extensions/executors/ExecutorExtension.java | ExecutorExtension.start | @Validate
public void start() {
metrics.register("executors", new MetricSet() {
@Override
public Map<String, Metric> getMetrics() {
return ImmutableMap.<String, Metric>of(
"executors.count", new Gauge<Integer>() {
@O... | java | @Validate
public void start() {
metrics.register("executors", new MetricSet() {
@Override
public Map<String, Metric> getMetrics() {
return ImmutableMap.<String, Metric>of(
"executors.count", new Gauge<Integer>() {
@O... | [
"@",
"Validate",
"public",
"void",
"start",
"(",
")",
"{",
"metrics",
".",
"register",
"(",
"\"executors\"",
",",
"new",
"MetricSet",
"(",
")",
"{",
"@",
"Override",
"public",
"Map",
"<",
"String",
",",
"Metric",
">",
"getMetrics",
"(",
")",
"{",
"retu... | Starts the extension. It registers the different metrics into the metric registry. | [
"Starts",
"the",
"extension",
".",
"It",
"registers",
"the",
"different",
"metrics",
"into",
"the",
"metric",
"registry",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-monitor/src/main/java/org/wisdom/monitor/extensions/executors/ExecutorExtension.java#L63-L107 |
103,663 | wisdom-framework/wisdom | extensions/wisdom-monitor/src/main/java/org/wisdom/monitor/extensions/executors/ExecutorExtension.java | ExecutorExtension.data | @Route(method = HttpMethod.GET, uri = "/monitor/executors.json")
public Result data() {
return ok(ImmutableMap.builder()
.put("executors", getExecutorsAsMap(executors))
.put("schedulers", getExecutorsAsMap(schedulers))
.put("hung", getH... | java | @Route(method = HttpMethod.GET, uri = "/monitor/executors.json")
public Result data() {
return ok(ImmutableMap.builder()
.put("executors", getExecutorsAsMap(executors))
.put("schedulers", getExecutorsAsMap(schedulers))
.put("hung", getH... | [
"@",
"Route",
"(",
"method",
"=",
"HttpMethod",
".",
"GET",
",",
"uri",
"=",
"\"/monitor/executors.json\"",
")",
"public",
"Result",
"data",
"(",
")",
"{",
"return",
"ok",
"(",
"ImmutableMap",
".",
"builder",
"(",
")",
".",
"put",
"(",
"\"executors\"",
"... | Retrieves the metrics about the executors. This method is intended to be used to handled an AJAX call.
@return the metrics as JSON. | [
"Retrieves",
"the",
"metrics",
"about",
"the",
"executors",
".",
"This",
"method",
"is",
"intended",
"to",
"be",
"used",
"to",
"handled",
"an",
"AJAX",
"call",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-monitor/src/main/java/org/wisdom/monitor/extensions/executors/ExecutorExtension.java#L202-L211 |
103,664 | wisdom-framework/wisdom | core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/AsyncInputStream.java | AsyncInputStream.handler | @Override
public ReadStream<Buffer> handler(Handler<Buffer> handler) {
if (handler == null) {
throw new IllegalArgumentException("handler");
}
this.dataHandler = handler;
doRead();
return this;
} | java | @Override
public ReadStream<Buffer> handler(Handler<Buffer> handler) {
if (handler == null) {
throw new IllegalArgumentException("handler");
}
this.dataHandler = handler;
doRead();
return this;
} | [
"@",
"Override",
"public",
"ReadStream",
"<",
"Buffer",
">",
"handler",
"(",
"Handler",
"<",
"Buffer",
">",
"handler",
")",
"{",
"if",
"(",
"handler",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"handler\"",
")",
";",
"}",
... | Set a data handler. As data is read, the handler will be called with the data.
@param handler the handler.
@return a reference to this, so the API can be used fluently | [
"Set",
"a",
"data",
"handler",
".",
"As",
"data",
"is",
"read",
"the",
"handler",
"will",
"be",
"called",
"with",
"the",
"data",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/AsyncInputStream.java#L182-L190 |
103,665 | wisdom-framework/wisdom | core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/AsyncInputStream.java | AsyncInputStream.doRead | private void doRead() {
if (context == null) {
context = vertx.getOrCreateContext();
}
if (state == STATUS_ACTIVE) {
final Handler<Buffer> dataHandler = this.dataHandler;
final Handler<Void> closeHandler = this.closeHandler;
executor.submit(
... | java | private void doRead() {
if (context == null) {
context = vertx.getOrCreateContext();
}
if (state == STATUS_ACTIVE) {
final Handler<Buffer> dataHandler = this.dataHandler;
final Handler<Void> closeHandler = this.closeHandler;
executor.submit(
... | [
"private",
"void",
"doRead",
"(",
")",
"{",
"if",
"(",
"context",
"==",
"null",
")",
"{",
"context",
"=",
"vertx",
".",
"getOrCreateContext",
"(",
")",
";",
"}",
"if",
"(",
"state",
"==",
"STATUS_ACTIVE",
")",
"{",
"final",
"Handler",
"<",
"Buffer",
... | The method actually reading the stream.
Except the first calls, this method is executed within an Akka thread. | [
"The",
"method",
"actually",
"reading",
"the",
"stream",
".",
"Except",
"the",
"first",
"calls",
"this",
"method",
"is",
"executed",
"within",
"an",
"Akka",
"thread",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/AsyncInputStream.java#L197-L243 |
103,666 | wisdom-framework/wisdom | core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/AsyncInputStream.java | AsyncInputStream.resume | @Override
public AsyncInputStream resume() {
switch (state) {
case STATUS_CLOSED:
throw new IllegalStateException("Cannot resume, already closed");
case STATUS_PAUSED:
state = STATUS_ACTIVE;
doRead();
}
return this;
... | java | @Override
public AsyncInputStream resume() {
switch (state) {
case STATUS_CLOSED:
throw new IllegalStateException("Cannot resume, already closed");
case STATUS_PAUSED:
state = STATUS_ACTIVE;
doRead();
}
return this;
... | [
"@",
"Override",
"public",
"AsyncInputStream",
"resume",
"(",
")",
"{",
"switch",
"(",
"state",
")",
"{",
"case",
"STATUS_CLOSED",
":",
"throw",
"new",
"IllegalStateException",
"(",
"\"Cannot resume, already closed\"",
")",
";",
"case",
"STATUS_PAUSED",
":",
"stat... | Resumes the reading.
@return the current {@code AsyncInputStream} | [
"Resumes",
"the",
"reading",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/AsyncInputStream.java#L263-L273 |
103,667 | wisdom-framework/wisdom | core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/AsyncInputStream.java | AsyncInputStream.readChunk | private byte[] readChunk() throws Exception {
if (isEndOfInput()) {
return EMPTY_BYTE_ARRAY;
}
try {
// transfer to buffer
byte[] tmp = new byte[chunkSize];
int readBytes = in.read(tmp);
if (readBytes <= 0) {
return nul... | java | private byte[] readChunk() throws Exception {
if (isEndOfInput()) {
return EMPTY_BYTE_ARRAY;
}
try {
// transfer to buffer
byte[] tmp = new byte[chunkSize];
int readBytes = in.read(tmp);
if (readBytes <= 0) {
return nul... | [
"private",
"byte",
"[",
"]",
"readChunk",
"(",
")",
"throws",
"Exception",
"{",
"if",
"(",
"isEndOfInput",
"(",
")",
")",
"{",
"return",
"EMPTY_BYTE_ARRAY",
";",
"}",
"try",
"{",
"// transfer to buffer",
"byte",
"[",
"]",
"tmp",
"=",
"new",
"byte",
"[",
... | Reads a chunk.
@return the read bytes, empty if we reached the end of the stream. The returned array has exactly the sisize
of the chunk.
@throws Exception if the stream cannot be read. | [
"Reads",
"a",
"chunk",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-vertx-engine/src/main/java/org/wisdom/framework/vertx/AsyncInputStream.java#L327-L348 |
103,668 | wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/pipeline/Pipeline.java | Pipeline.watch | public Pipeline watch() {
// Delete all error reports before starting the watcher.
error = new File(baseDir, "target/pipeline");
FileUtils.deleteQuietly(error);
mojo.getLog().debug("Creating the target/pipeline directory : " + error.mkdirs());
// Start the watching process.
... | java | public Pipeline watch() {
// Delete all error reports before starting the watcher.
error = new File(baseDir, "target/pipeline");
FileUtils.deleteQuietly(error);
mojo.getLog().debug("Creating the target/pipeline directory : " + error.mkdirs());
// Start the watching process.
... | [
"public",
"Pipeline",
"watch",
"(",
")",
"{",
"// Delete all error reports before starting the watcher.",
"error",
"=",
"new",
"File",
"(",
"baseDir",
",",
"\"target/pipeline\"",
")",
";",
"FileUtils",
".",
"deleteQuietly",
"(",
"error",
")",
";",
"mojo",
".",
"ge... | Starts the watching.
@return the current pipeline. | [
"Starts",
"the",
"watching",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/pipeline/Pipeline.java#L98-L131 |
103,669 | wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/pipeline/Pipeline.java | Pipeline.createErrorFile | @SuppressWarnings("unchecked")
private void createErrorFile(Watcher watcher, WatchingException e) {
mojo.getLog().debug("Creating error file for '" + e.getMessage() + "' happening at " + e.getLine() + ":" + e
.getCharacter() + " of " + e.getFile() + ", created by watcher : " + watcher);
... | java | @SuppressWarnings("unchecked")
private void createErrorFile(Watcher watcher, WatchingException e) {
mojo.getLog().debug("Creating error file for '" + e.getMessage() + "' happening at " + e.getLine() + ":" + e
.getCharacter() + " of " + e.getFile() + ", created by watcher : " + watcher);
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"void",
"createErrorFile",
"(",
"Watcher",
"watcher",
",",
"WatchingException",
"e",
")",
"{",
"mojo",
".",
"getLog",
"(",
")",
".",
"debug",
"(",
"\"Creating error file for '\"",
"+",
"e",
".",
"g... | Creates the error file storing the information from the given exception in JSON. This file is consumed by the
Wisdom server to generate an error page reporting the watching exception.
@param watcher the watcher having thrown the exception
@param e the exception | [
"Creates",
"the",
"error",
"file",
"storing",
"the",
"information",
"from",
"the",
"given",
"exception",
"in",
"JSON",
".",
"This",
"file",
"is",
"consumed",
"by",
"the",
"Wisdom",
"server",
"to",
"generate",
"an",
"error",
"page",
"reporting",
"the",
"watch... | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/pipeline/Pipeline.java#L172-L203 |
103,670 | wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/pipeline/Pipeline.java | Pipeline.cleanupErrorFile | private void cleanupErrorFile(Watcher watcher) {
File file = getErrorFileForWatcher(watcher);
FileUtils.deleteQuietly(file);
} | java | private void cleanupErrorFile(Watcher watcher) {
File file = getErrorFileForWatcher(watcher);
FileUtils.deleteQuietly(file);
} | [
"private",
"void",
"cleanupErrorFile",
"(",
"Watcher",
"watcher",
")",
"{",
"File",
"file",
"=",
"getErrorFileForWatcher",
"(",
"watcher",
")",
";",
"FileUtils",
".",
"deleteQuietly",
"(",
"file",
")",
";",
"}"
] | Method called on each event before the processing, deleting the error file is this file exists.
@param watcher the watcher | [
"Method",
"called",
"on",
"each",
"event",
"before",
"the",
"processing",
"deleting",
"the",
"error",
"file",
"is",
"this",
"file",
"exists",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/pipeline/Pipeline.java#L210-L213 |
103,671 | wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/pipeline/Pipeline.java | Pipeline.onFileChange | public void onFileChange(File file) {
mojo.getLog().info(EMPTY_STRING);
mojo.getLog().info("The watcher has detected a change in " + file.getAbsolutePath());
mojo.getLog().info(EMPTY_STRING);
for (Watcher watcher : watchers) {
if (watcher.accept(file)) {
clean... | java | public void onFileChange(File file) {
mojo.getLog().info(EMPTY_STRING);
mojo.getLog().info("The watcher has detected a change in " + file.getAbsolutePath());
mojo.getLog().info(EMPTY_STRING);
for (Watcher watcher : watchers) {
if (watcher.accept(file)) {
clean... | [
"public",
"void",
"onFileChange",
"(",
"File",
"file",
")",
"{",
"mojo",
".",
"getLog",
"(",
")",
".",
"info",
"(",
"EMPTY_STRING",
")",
";",
"mojo",
".",
"getLog",
"(",
")",
".",
"info",
"(",
"\"The watcher has detected a change in \"",
"+",
"file",
".",
... | The FAM has detected a change in a file. It dispatches this event to the watchers plugged on the current
pipeline.
@param file the updated file | [
"The",
"FAM",
"has",
"detected",
"a",
"change",
"in",
"a",
"file",
".",
"It",
"dispatches",
"this",
"event",
"to",
"the",
"watchers",
"plugged",
"on",
"the",
"current",
"pipeline",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/pipeline/Pipeline.java#L229-L254 |
103,672 | wisdom-framework/wisdom | core/wisdom-api/src/main/java/org/wisdom/api/utils/KnownMimeTypes.java | KnownMimeTypes.addMimeToCompressedWithExtension | private static void addMimeToCompressedWithExtension(String extension) {
String mime = EXTENSIONS.get(extension);
if (mime != null && !COMPRESSED_MIME.contains(mime)) {
COMPRESSED_MIME.add(mime);
}
} | java | private static void addMimeToCompressedWithExtension(String extension) {
String mime = EXTENSIONS.get(extension);
if (mime != null && !COMPRESSED_MIME.contains(mime)) {
COMPRESSED_MIME.add(mime);
}
} | [
"private",
"static",
"void",
"addMimeToCompressedWithExtension",
"(",
"String",
"extension",
")",
"{",
"String",
"mime",
"=",
"EXTENSIONS",
".",
"get",
"(",
"extension",
")",
";",
"if",
"(",
"mime",
"!=",
"null",
"&&",
"!",
"COMPRESSED_MIME",
".",
"contains",
... | Adds a mime-type to the compressed list.
@param extension the extension, without the "." | [
"Adds",
"a",
"mime",
"-",
"type",
"to",
"the",
"compressed",
"list",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-api/src/main/java/org/wisdom/api/utils/KnownMimeTypes.java#L131-L136 |
103,673 | wisdom-framework/wisdom | core/wisdom-api/src/main/java/org/wisdom/api/utils/KnownMimeTypes.java | KnownMimeTypes.addMimeGroups | private static void addMimeGroups(String... groups) {
for (String mimeType : EXTENSIONS.values()) {
for (String group : groups) {
if (mimeType.startsWith(group) && !COMPRESSED_MIME.contains(mimeType)) {
COMPRESSED_MIME.add(mimeType);
}
... | java | private static void addMimeGroups(String... groups) {
for (String mimeType : EXTENSIONS.values()) {
for (String group : groups) {
if (mimeType.startsWith(group) && !COMPRESSED_MIME.contains(mimeType)) {
COMPRESSED_MIME.add(mimeType);
}
... | [
"private",
"static",
"void",
"addMimeGroups",
"(",
"String",
"...",
"groups",
")",
"{",
"for",
"(",
"String",
"mimeType",
":",
"EXTENSIONS",
".",
"values",
"(",
")",
")",
"{",
"for",
"(",
"String",
"group",
":",
"groups",
")",
"{",
"if",
"(",
"mimeType... | Adds a group to the compressed list.
@param groups the groups | [
"Adds",
"a",
"group",
"to",
"the",
"compressed",
"list",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-api/src/main/java/org/wisdom/api/utils/KnownMimeTypes.java#L143-L151 |
103,674 | wisdom-framework/wisdom | core/wisdom-executors/src/main/java/org/wisdom/executors/scheduler/Job.java | Job.function | public Runnable function() {
return new Runnable() {
@Override
public void run() {
try {
method.invoke(scheduled);
} catch (IllegalAccessException e) {
WisdomTaskScheduler.getLogger().error("Error while accessing to ... | java | public Runnable function() {
return new Runnable() {
@Override
public void run() {
try {
method.invoke(scheduled);
} catch (IllegalAccessException e) {
WisdomTaskScheduler.getLogger().error("Error while accessing to ... | [
"public",
"Runnable",
"function",
"(",
")",
"{",
"return",
"new",
"Runnable",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"run",
"(",
")",
"{",
"try",
"{",
"method",
".",
"invoke",
"(",
"scheduled",
")",
";",
"}",
"catch",
"(",
"IllegalAccessExce... | Gets the runnable invoking the scheduled method.
@return the runnable. | [
"Gets",
"the",
"runnable",
"invoking",
"the",
"scheduled",
"method",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-executors/src/main/java/org/wisdom/executors/scheduler/Job.java#L118-L133 |
103,675 | wisdom-framework/wisdom | extensions/wisdom-filters/src/main/java/org/wisdom/framework/filters/BalancerFilter.java | BalancerFilter.updateHeaders | @Override
public void updateHeaders(RequestContext context, Multimap<String, String> headers) {
if (!proxyPassReverse) {
return;
}
for (Map.Entry<String, String> h : new LinkedHashSet<>(headers.entries())) {
if (REVERSE_PROXY_HEADERS.contains(h.getKey())) {
... | java | @Override
public void updateHeaders(RequestContext context, Multimap<String, String> headers) {
if (!proxyPassReverse) {
return;
}
for (Map.Entry<String, String> h : new LinkedHashSet<>(headers.entries())) {
if (REVERSE_PROXY_HEADERS.contains(h.getKey())) {
... | [
"@",
"Override",
"public",
"void",
"updateHeaders",
"(",
"RequestContext",
"context",
",",
"Multimap",
"<",
"String",
",",
"String",
">",
"headers",
")",
"{",
"if",
"(",
"!",
"proxyPassReverse",
")",
"{",
"return",
";",
"}",
"for",
"(",
"Map",
".",
"Entr... | Callback that can be overridden to customize the header ot the request. This method implements the reverse
routing. It updates URLs contained in the headers.
@param context the request context
@param headers the current set of headers, that need to be modified | [
"Callback",
"that",
"can",
"be",
"overridden",
"to",
"customize",
"the",
"header",
"ot",
"the",
"request",
".",
"This",
"method",
"implements",
"the",
"reverse",
"routing",
".",
"It",
"updates",
"URLs",
"contained",
"in",
"the",
"headers",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-filters/src/main/java/org/wisdom/framework/filters/BalancerFilter.java#L202-L225 |
103,676 | wisdom-framework/wisdom | extensions/wisdom-filters/src/main/java/org/wisdom/framework/filters/BalancerFilter.java | BalancerFilter.addMember | public synchronized void addMember(BalancerMember member) {
if (member.getBalancerName().equals(name)) {
logger.info("Adding balancer member '{}' to balancer '{}'", member.getName(), name);
members.add(member);
}
} | java | public synchronized void addMember(BalancerMember member) {
if (member.getBalancerName().equals(name)) {
logger.info("Adding balancer member '{}' to balancer '{}'", member.getName(), name);
members.add(member);
}
} | [
"public",
"synchronized",
"void",
"addMember",
"(",
"BalancerMember",
"member",
")",
"{",
"if",
"(",
"member",
".",
"getBalancerName",
"(",
")",
".",
"equals",
"(",
"name",
")",
")",
"{",
"logger",
".",
"info",
"(",
"\"Adding balancer member '{}' to balancer '{}... | Adds a new member.
@param member the member. | [
"Adds",
"a",
"new",
"member",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-filters/src/main/java/org/wisdom/framework/filters/BalancerFilter.java#L293-L298 |
103,677 | wisdom-framework/wisdom | extensions/wisdom-filters/src/main/java/org/wisdom/framework/filters/BalancerFilter.java | BalancerFilter.removeMember | public synchronized void removeMember(BalancerMember member) {
if (members.remove(member)) {
logger.info("Removing balancer member '{}' from balancer '{}'", member.getName(), name);
}
} | java | public synchronized void removeMember(BalancerMember member) {
if (members.remove(member)) {
logger.info("Removing balancer member '{}' from balancer '{}'", member.getName(), name);
}
} | [
"public",
"synchronized",
"void",
"removeMember",
"(",
"BalancerMember",
"member",
")",
"{",
"if",
"(",
"members",
".",
"remove",
"(",
"member",
")",
")",
"{",
"logger",
".",
"info",
"(",
"\"Removing balancer member '{}' from balancer '{}'\"",
",",
"member",
".",
... | Removes a member.
@param member the member. | [
"Removes",
"a",
"member",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-filters/src/main/java/org/wisdom/framework/filters/BalancerFilter.java#L305-L309 |
103,678 | wisdom-framework/wisdom | framework/i18n-service/src/main/java/org/wisdom/i18n/InternationalizationServiceSingleton.java | InternationalizationServiceSingleton.bundles | @Override
public Collection<ResourceBundle> bundles() {
Set<ResourceBundle> bundles = new LinkedHashSet<>();
for (I18nExtension extension : extensions) {
bundles.add(extension.bundle());
}
return bundles;
} | java | @Override
public Collection<ResourceBundle> bundles() {
Set<ResourceBundle> bundles = new LinkedHashSet<>();
for (I18nExtension extension : extensions) {
bundles.add(extension.bundle());
}
return bundles;
} | [
"@",
"Override",
"public",
"Collection",
"<",
"ResourceBundle",
">",
"bundles",
"(",
")",
"{",
"Set",
"<",
"ResourceBundle",
">",
"bundles",
"=",
"new",
"LinkedHashSet",
"<>",
"(",
")",
";",
"for",
"(",
"I18nExtension",
"extension",
":",
"extensions",
")",
... | Retrieves the set of resource bundles handled by the system.
@return the set of resource bundle, empty if none. | [
"Retrieves",
"the",
"set",
"of",
"resource",
"bundles",
"handled",
"by",
"the",
"system",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/framework/i18n-service/src/main/java/org/wisdom/i18n/InternationalizationServiceSingleton.java#L111-L118 |
103,679 | wisdom-framework/wisdom | framework/i18n-service/src/main/java/org/wisdom/i18n/InternationalizationServiceSingleton.java | InternationalizationServiceSingleton.bundles | @Override
public Collection<ResourceBundle> bundles(Locale locale) {
Set<ResourceBundle> bundles = new LinkedHashSet<>();
for (I18nExtension extension : extensions) {
if (extension.locale().equals(locale)) {
bundles.add(extension.bundle());
}
}
... | java | @Override
public Collection<ResourceBundle> bundles(Locale locale) {
Set<ResourceBundle> bundles = new LinkedHashSet<>();
for (I18nExtension extension : extensions) {
if (extension.locale().equals(locale)) {
bundles.add(extension.bundle());
}
}
... | [
"@",
"Override",
"public",
"Collection",
"<",
"ResourceBundle",
">",
"bundles",
"(",
"Locale",
"locale",
")",
"{",
"Set",
"<",
"ResourceBundle",
">",
"bundles",
"=",
"new",
"LinkedHashSet",
"<>",
"(",
")",
";",
"for",
"(",
"I18nExtension",
"extension",
":",
... | Retrieves the set of resource bundles handled by the system providing messages for the given locale.
@param locale the locale
@return the set of resource bundle, empty if none. | [
"Retrieves",
"the",
"set",
"of",
"resource",
"bundles",
"handled",
"by",
"the",
"system",
"providing",
"messages",
"for",
"the",
"given",
"locale",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/framework/i18n-service/src/main/java/org/wisdom/i18n/InternationalizationServiceSingleton.java#L126-L135 |
103,680 | wisdom-framework/wisdom | framework/i18n-service/src/main/java/org/wisdom/i18n/InternationalizationServiceSingleton.java | InternationalizationServiceSingleton.etag | @Override
public String etag(Locale locale) {
String etag = etags.get(locale);
if (etag == null) {
// We don't have a stored etag, that means we don't have messages. We returns 0.
// There is a potential race condition here:
// We retrieve the etag get 0, but when... | java | @Override
public String etag(Locale locale) {
String etag = etags.get(locale);
if (etag == null) {
// We don't have a stored etag, that means we don't have messages. We returns 0.
// There is a potential race condition here:
// We retrieve the etag get 0, but when... | [
"@",
"Override",
"public",
"String",
"etag",
"(",
"Locale",
"locale",
")",
"{",
"String",
"etag",
"=",
"etags",
".",
"get",
"(",
"locale",
")",
";",
"if",
"(",
"etag",
"==",
"null",
")",
"{",
"// We don't have a stored etag, that means we don't have messages. We... | Retrieves the ETAG for the given locale.
@param locale the locale
@return the computed etag, must not be {@code null} or empty | [
"Retrieves",
"the",
"ETAG",
"for",
"the",
"given",
"locale",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/framework/i18n-service/src/main/java/org/wisdom/i18n/InternationalizationServiceSingleton.java#L232-L245 |
103,681 | wisdom-framework/wisdom | extensions/wisdom-instantiatedby/src/main/java/org/wisdom/framework/instances/InstantiatedByManager.java | InstantiatedByManager.bindFactory | @Bind(aggregate = true)
public void bindFactory(Factory factory) {
// Only support primitive component
if (!(factory instanceof ComponentFactory)) {
return;
}
String cn = factory.getClassName();
if (cn == null) {
return;
}
// Has the... | java | @Bind(aggregate = true)
public void bindFactory(Factory factory) {
// Only support primitive component
if (!(factory instanceof ComponentFactory)) {
return;
}
String cn = factory.getClassName();
if (cn == null) {
return;
}
// Has the... | [
"@",
"Bind",
"(",
"aggregate",
"=",
"true",
")",
"public",
"void",
"bindFactory",
"(",
"Factory",
"factory",
")",
"{",
"// Only support primitive component",
"if",
"(",
"!",
"(",
"factory",
"instanceof",
"ComponentFactory",
")",
")",
"{",
"return",
";",
"}",
... | Bind a factory.
@param factory the factory | [
"Bind",
"a",
"factory",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-instantiatedby/src/main/java/org/wisdom/framework/instances/InstantiatedByManager.java#L68-L97 |
103,682 | wisdom-framework/wisdom | extensions/wisdom-instantiatedby/src/main/java/org/wisdom/framework/instances/InstantiatedByManager.java | InstantiatedByManager.unbindFactory | @Unbind
public void unbindFactory(Factory factory) {
try {
lock.lock();
InstanceDeclaration declaration = getDeclarationByFactory(factory);
if (declaration != null) {
LOGGER.info("Disposing instance created by");
declaration.dispose();
... | java | @Unbind
public void unbindFactory(Factory factory) {
try {
lock.lock();
InstanceDeclaration declaration = getDeclarationByFactory(factory);
if (declaration != null) {
LOGGER.info("Disposing instance created by");
declaration.dispose();
... | [
"@",
"Unbind",
"public",
"void",
"unbindFactory",
"(",
"Factory",
"factory",
")",
"{",
"try",
"{",
"lock",
".",
"lock",
"(",
")",
";",
"InstanceDeclaration",
"declaration",
"=",
"getDeclarationByFactory",
"(",
"factory",
")",
";",
"if",
"(",
"declaration",
"... | Unbinds a factory.
@param factory the factory | [
"Unbinds",
"a",
"factory",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-instantiatedby/src/main/java/org/wisdom/framework/instances/InstantiatedByManager.java#L104-L117 |
103,683 | wisdom-framework/wisdom | extensions/wisdom-instantiatedby/src/main/java/org/wisdom/framework/instances/InstantiatedByManager.java | InstantiatedByManager.configurationEvent | @Override
public void configurationEvent(ConfigurationEvent event) {
LOGGER.debug("event received : " + event.getPid() + " - " + event.getType());
try {
lock.lock();
final List<InstanceDeclaration> impacted
= getDeclarationsByConfiguration(event.getPid(), ... | java | @Override
public void configurationEvent(ConfigurationEvent event) {
LOGGER.debug("event received : " + event.getPid() + " - " + event.getType());
try {
lock.lock();
final List<InstanceDeclaration> impacted
= getDeclarationsByConfiguration(event.getPid(), ... | [
"@",
"Override",
"public",
"void",
"configurationEvent",
"(",
"ConfigurationEvent",
"event",
")",
"{",
"LOGGER",
".",
"debug",
"(",
"\"event received : \"",
"+",
"event",
".",
"getPid",
"(",
")",
"+",
"\" - \"",
"+",
"event",
".",
"getType",
"(",
")",
")",
... | Receives a configuration event.
@param event the event. | [
"Receives",
"a",
"configuration",
"event",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-instantiatedby/src/main/java/org/wisdom/framework/instances/InstantiatedByManager.java#L186-L222 |
103,684 | wisdom-framework/wisdom | extensions/wisdom-monitor/src/main/java/org/wisdom/monitor/extensions/ipojo/FactoryModel.java | FactoryModel.factories | public static List<FactoryModel> factories(BundleContext context) {
List<FactoryModel> factories = new ArrayList<FactoryModel>();
try {
for (ServiceReference ref : context.getServiceReferences(Factory.class, null)) {
factories.add(new FactoryModel((Factory) context.getService... | java | public static List<FactoryModel> factories(BundleContext context) {
List<FactoryModel> factories = new ArrayList<FactoryModel>();
try {
for (ServiceReference ref : context.getServiceReferences(Factory.class, null)) {
factories.add(new FactoryModel((Factory) context.getService... | [
"public",
"static",
"List",
"<",
"FactoryModel",
">",
"factories",
"(",
"BundleContext",
"context",
")",
"{",
"List",
"<",
"FactoryModel",
">",
"factories",
"=",
"new",
"ArrayList",
"<",
"FactoryModel",
">",
"(",
")",
";",
"try",
"{",
"for",
"(",
"ServiceR... | Creates a list of factory model from the factory exposed. These factories are retrieved from the bundle context.
@param context the context
@return the list of factory model | [
"Creates",
"a",
"list",
"of",
"factory",
"model",
"from",
"the",
"factory",
"exposed",
".",
"These",
"factories",
"are",
"retrieved",
"from",
"the",
"bundle",
"context",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-monitor/src/main/java/org/wisdom/monitor/extensions/ipojo/FactoryModel.java#L43-L56 |
103,685 | wisdom-framework/wisdom | core/wisdom-api/src/main/java/org/wisdom/api/router/RouteUtils.java | RouteUtils.getPrefixedUri | public static String getPrefixedUri(String prefix, String uri) {
String localURI = uri;
if (localURI.length() > 0) {
// Put a / between the prefix and the tail only if:
// the prefix does not ends with a /
// the tail does not start with a /
// the tail st... | java | public static String getPrefixedUri(String prefix, String uri) {
String localURI = uri;
if (localURI.length() > 0) {
// Put a / between the prefix and the tail only if:
// the prefix does not ends with a /
// the tail does not start with a /
// the tail st... | [
"public",
"static",
"String",
"getPrefixedUri",
"(",
"String",
"prefix",
",",
"String",
"uri",
")",
"{",
"String",
"localURI",
"=",
"uri",
";",
"if",
"(",
"localURI",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"// Put a / between the prefix and the tail only... | Prepends the given prefix to the given uri.
@param prefix the prefix
@param uri the uri
@return the full uri | [
"Prepends",
"the",
"given",
"prefix",
"to",
"the",
"given",
"uri",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-api/src/main/java/org/wisdom/api/router/RouteUtils.java#L204-L223 |
103,686 | wisdom-framework/wisdom | core/wisdom-api/src/main/java/org/wisdom/api/router/RouteUtils.java | RouteUtils.buildActionParameterList | public static List<ActionParameter> buildActionParameterList(Method method) {
List<ActionParameter> arguments = new ArrayList<>();
Annotation[][] annotations = method.getParameterAnnotations();
Class<?>[] typesOfParameters = method.getParameterTypes();
Type[] genericTypeOfParameters = me... | java | public static List<ActionParameter> buildActionParameterList(Method method) {
List<ActionParameter> arguments = new ArrayList<>();
Annotation[][] annotations = method.getParameterAnnotations();
Class<?>[] typesOfParameters = method.getParameterTypes();
Type[] genericTypeOfParameters = me... | [
"public",
"static",
"List",
"<",
"ActionParameter",
">",
"buildActionParameterList",
"(",
"Method",
"method",
")",
"{",
"List",
"<",
"ActionParameter",
">",
"arguments",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"Annotation",
"[",
"]",
"[",
"]",
"annotat... | Gets the list of Argument, i.e. formal parameter metadata for the given method.
@param method the method
@return the list of arguments | [
"Gets",
"the",
"list",
"of",
"Argument",
"i",
".",
"e",
".",
"formal",
"parameter",
"metadata",
"for",
"the",
"given",
"method",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-api/src/main/java/org/wisdom/api/router/RouteUtils.java#L231-L241 |
103,687 | wisdom-framework/wisdom | core/wisdom-api/src/main/java/org/wisdom/api/router/parameters/ActionParameter.java | ActionParameter.from | public static ActionParameter from(Member member, Annotation[] annotations, Class<?> rawType,
Type genericType) {
ActionParameter parameter = null;
String defaultValue = null;
for (Annotation annotation : annotations) {
if (annotation instanceof... | java | public static ActionParameter from(Member member, Annotation[] annotations, Class<?> rawType,
Type genericType) {
ActionParameter parameter = null;
String defaultValue = null;
for (Annotation annotation : annotations) {
if (annotation instanceof... | [
"public",
"static",
"ActionParameter",
"from",
"(",
"Member",
"member",
",",
"Annotation",
"[",
"]",
"annotations",
",",
"Class",
"<",
"?",
">",
"rawType",
",",
"Type",
"genericType",
")",
"{",
"ActionParameter",
"parameter",
"=",
"null",
";",
"String",
"def... | Creates a new action parameter instance from the given parameter. Action Parameter contain the metadata of a
specific method or constructor parameter to identify the injected data.
@param member the constructor or method having the analyzed parameter.
@param annotations the parameter's annotations
@param rawType ... | [
"Creates",
"a",
"new",
"action",
"parameter",
"instance",
"from",
"the",
"given",
"parameter",
".",
"Action",
"Parameter",
"contain",
"the",
"metadata",
"of",
"a",
"specific",
"method",
"or",
"constructor",
"parameter",
"to",
"identify",
"the",
"injected",
"data... | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-api/src/main/java/org/wisdom/api/router/parameters/ActionParameter.java#L198-L223 |
103,688 | wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/osgi/Packages.java | Packages.toClause | public static String toClause(List<String> packages) {
return Joiner.on(", ").skipNulls().join(packages);
} | java | public static String toClause(List<String> packages) {
return Joiner.on(", ").skipNulls().join(packages);
} | [
"public",
"static",
"String",
"toClause",
"(",
"List",
"<",
"String",
">",
"packages",
")",
"{",
"return",
"Joiner",
".",
"on",
"(",
"\", \"",
")",
".",
"skipNulls",
"(",
")",
".",
"join",
"(",
"packages",
")",
";",
"}"
] | Computes the BND clause from the given set of packages.
@param packages the packages
@return the clause | [
"Computes",
"the",
"BND",
"clause",
"from",
"the",
"given",
"set",
"of",
"packages",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/osgi/Packages.java#L44-L46 |
103,689 | wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/osgi/Packages.java | Packages.shouldBeExported | public static boolean shouldBeExported(String packageName) {
boolean service = packageName.endsWith(".service");
service = service
|| packageName.contains(".service.")
|| packageName.endsWith(".services")
|| packageName.contains(".services.");
boo... | java | public static boolean shouldBeExported(String packageName) {
boolean service = packageName.endsWith(".service");
service = service
|| packageName.contains(".service.")
|| packageName.endsWith(".services")
|| packageName.contains(".services.");
boo... | [
"public",
"static",
"boolean",
"shouldBeExported",
"(",
"String",
"packageName",
")",
"{",
"boolean",
"service",
"=",
"packageName",
".",
"endsWith",
"(",
"\".service\"",
")",
";",
"service",
"=",
"service",
"||",
"packageName",
".",
"contains",
"(",
"\".service... | Checks whether the given package must be exported. The decision is made from heuristics.
@param packageName the package name
@return {@literal true} if the package has to be exported, {@literal false} otherwise. | [
"Checks",
"whether",
"the",
"given",
"package",
"must",
"be",
"exported",
".",
"The",
"decision",
"is",
"made",
"from",
"heuristics",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/osgi/Packages.java#L74-L100 |
103,690 | wisdom-framework/wisdom | framework/hibernate-validation-service/src/main/java/org/wisdom/validation/hibernate/HibernateValidatorService.java | HibernateValidatorService.tearDown | @Invalidate
public void tearDown() {
if (registration != null) {
registration.unregister();
registration = null;
}
if (factoryRegistration != null) {
factoryRegistration.unregister();
factoryRegistration = null;
}
} | java | @Invalidate
public void tearDown() {
if (registration != null) {
registration.unregister();
registration = null;
}
if (factoryRegistration != null) {
factoryRegistration.unregister();
factoryRegistration = null;
}
} | [
"@",
"Invalidate",
"public",
"void",
"tearDown",
"(",
")",
"{",
"if",
"(",
"registration",
"!=",
"null",
")",
"{",
"registration",
".",
"unregister",
"(",
")",
";",
"registration",
"=",
"null",
";",
"}",
"if",
"(",
"factoryRegistration",
"!=",
"null",
")... | Unregisters the validator service. | [
"Unregisters",
"the",
"validator",
"service",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/framework/hibernate-validation-service/src/main/java/org/wisdom/validation/hibernate/HibernateValidatorService.java#L98-L108 |
103,691 | wisdom-framework/wisdom | framework/resource-controller/src/main/java/org/wisdom/resources/CacheUtils.java | CacheUtils.addLastModified | public static void addLastModified(Result result, long lastModified) {
result.with(HeaderNames.LAST_MODIFIED, DateUtil.formatForHttpHeader(lastModified));
} | java | public static void addLastModified(Result result, long lastModified) {
result.with(HeaderNames.LAST_MODIFIED, DateUtil.formatForHttpHeader(lastModified));
} | [
"public",
"static",
"void",
"addLastModified",
"(",
"Result",
"result",
",",
"long",
"lastModified",
")",
"{",
"result",
".",
"with",
"(",
"HeaderNames",
".",
"LAST_MODIFIED",
",",
"DateUtil",
".",
"formatForHttpHeader",
"(",
"lastModified",
")",
")",
";",
"}"... | Add the last modified header to the given result. This method handle the HTTP Date format.
@param result the result
@param lastModified the date | [
"Add",
"the",
"last",
"modified",
"header",
"to",
"the",
"given",
"result",
".",
"This",
"method",
"handle",
"the",
"HTTP",
"Date",
"format",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/framework/resource-controller/src/main/java/org/wisdom/resources/CacheUtils.java#L61-L63 |
103,692 | wisdom-framework/wisdom | framework/resource-controller/src/main/java/org/wisdom/resources/CacheUtils.java | CacheUtils.isNotModified | public static boolean isNotModified(Context context, long lastModified, String etag) {
// First check etag. Important, if there is an If-None-Match header, we MUST not check the
// If-Modified-Since header, regardless of whether If-None-Match matches or not. This is in
// accordance with section... | java | public static boolean isNotModified(Context context, long lastModified, String etag) {
// First check etag. Important, if there is an If-None-Match header, we MUST not check the
// If-Modified-Since header, regardless of whether If-None-Match matches or not. This is in
// accordance with section... | [
"public",
"static",
"boolean",
"isNotModified",
"(",
"Context",
"context",
",",
"long",
"lastModified",
",",
"String",
"etag",
")",
"{",
"// First check etag. Important, if there is an If-None-Match header, we MUST not check the",
"// If-Modified-Since header, regardless of whether I... | Check whether the request can send a NOT_MODIFIED response.
@param context the context
@param lastModified the last modification date
@param etag the etag.
@return true if the content is modified | [
"Check",
"whether",
"the",
"request",
"can",
"send",
"a",
"NOT_MODIFIED",
"response",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/framework/resource-controller/src/main/java/org/wisdom/resources/CacheUtils.java#L73-L100 |
103,693 | wisdom-framework/wisdom | framework/resource-controller/src/main/java/org/wisdom/resources/CacheUtils.java | CacheUtils.computeEtag | public static String computeEtag(long lastModification, ApplicationConfiguration configuration, Crypto crypto) {
boolean useEtag = configuration.getBooleanWithDefault(HTTP_USE_ETAG,
HTTP_USE_ETAG_DEFAULT);
if (!useEtag) {
return null;
}
String raw = Long.toStr... | java | public static String computeEtag(long lastModification, ApplicationConfiguration configuration, Crypto crypto) {
boolean useEtag = configuration.getBooleanWithDefault(HTTP_USE_ETAG,
HTTP_USE_ETAG_DEFAULT);
if (!useEtag) {
return null;
}
String raw = Long.toStr... | [
"public",
"static",
"String",
"computeEtag",
"(",
"long",
"lastModification",
",",
"ApplicationConfiguration",
"configuration",
",",
"Crypto",
"crypto",
")",
"{",
"boolean",
"useEtag",
"=",
"configuration",
".",
"getBooleanWithDefault",
"(",
"HTTP_USE_ETAG",
",",
"HTT... | Computes the ETAG value based on the last modification date passed as parameter.
@param lastModification the last modification (must be valid)
@param configuration the configuration
@param crypto the crypto service
@return the encoded etag | [
"Computes",
"the",
"ETAG",
"value",
"based",
"on",
"the",
"last",
"modification",
"date",
"passed",
"as",
"parameter",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/framework/resource-controller/src/main/java/org/wisdom/resources/CacheUtils.java#L110-L118 |
103,694 | wisdom-framework/wisdom | framework/resource-controller/src/main/java/org/wisdom/resources/CacheUtils.java | CacheUtils.addCacheControlAndEtagToResult | public static void addCacheControlAndEtagToResult(Result result, String etag, ApplicationConfiguration configuration) {
String maxAge = configuration.getWithDefault(HTTP_CACHE_CONTROL_MAX_AGE,
HTTP_CACHE_CONTROL_DEFAULT);
if ("0".equals(maxAge)) {
result.with(HeaderNames.CAC... | java | public static void addCacheControlAndEtagToResult(Result result, String etag, ApplicationConfiguration configuration) {
String maxAge = configuration.getWithDefault(HTTP_CACHE_CONTROL_MAX_AGE,
HTTP_CACHE_CONTROL_DEFAULT);
if ("0".equals(maxAge)) {
result.with(HeaderNames.CAC... | [
"public",
"static",
"void",
"addCacheControlAndEtagToResult",
"(",
"Result",
"result",
",",
"String",
"etag",
",",
"ApplicationConfiguration",
"configuration",
")",
"{",
"String",
"maxAge",
"=",
"configuration",
".",
"getWithDefault",
"(",
"HTTP_CACHE_CONTROL_MAX_AGE",
... | Adds cache control and etag to the given result.
@param result the result
@param etag the etag
@param configuration the application configuration | [
"Adds",
"cache",
"control",
"and",
"etag",
"to",
"the",
"given",
"result",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/framework/resource-controller/src/main/java/org/wisdom/resources/CacheUtils.java#L127-L144 |
103,695 | wisdom-framework/wisdom | framework/resource-controller/src/main/java/org/wisdom/resources/CacheUtils.java | CacheUtils.fromFile | public static Result fromFile(File file, Context context, ApplicationConfiguration configuration, Crypto crypto) {
long lastModified = file.lastModified();
String etag = computeEtag(lastModified, configuration, crypto);
if (isNotModified(context, lastModified, etag)) {
return new Res... | java | public static Result fromFile(File file, Context context, ApplicationConfiguration configuration, Crypto crypto) {
long lastModified = file.lastModified();
String etag = computeEtag(lastModified, configuration, crypto);
if (isNotModified(context, lastModified, etag)) {
return new Res... | [
"public",
"static",
"Result",
"fromFile",
"(",
"File",
"file",
",",
"Context",
"context",
",",
"ApplicationConfiguration",
"configuration",
",",
"Crypto",
"crypto",
")",
"{",
"long",
"lastModified",
"=",
"file",
".",
"lastModified",
"(",
")",
";",
"String",
"e... | Computes the result to sent the given file. Cache headers are automatically set by this method.
@param file the file to send to the client
@param context the context
@param configuration the application configuration
@param crypto the crypto service
@return the result, it can be a NOT_MODIFIED if... | [
"Computes",
"the",
"result",
"to",
"sent",
"the",
"given",
"file",
".",
"Cache",
"headers",
"are",
"automatically",
"set",
"by",
"this",
"method",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/framework/resource-controller/src/main/java/org/wisdom/resources/CacheUtils.java#L156-L167 |
103,696 | wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/Properties2HoconConverter.java | Properties2HoconConverter.convertToHocon | public static String convertToHocon(File props) throws IOException {
StringBuilder output = new StringBuilder();
List<String> lines = FileUtils.readLines(props);
boolean readingValue = false;
for (String line : lines) {
if (isComment(line)) {
// Comment
... | java | public static String convertToHocon(File props) throws IOException {
StringBuilder output = new StringBuilder();
List<String> lines = FileUtils.readLines(props);
boolean readingValue = false;
for (String line : lines) {
if (isComment(line)) {
// Comment
... | [
"public",
"static",
"String",
"convertToHocon",
"(",
"File",
"props",
")",
"throws",
"IOException",
"{",
"StringBuilder",
"output",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"List",
"<",
"String",
">",
"lines",
"=",
"FileUtils",
".",
"readLines",
"(",
"pro... | Generates the hocon string resulting from the conversion of the given properties file.
@param props the properties file, must exist and be a valid properties file.
@return the converted configuration (hocon format).
@throws IOException | [
"Generates",
"the",
"hocon",
"string",
"resulting",
"from",
"the",
"conversion",
"of",
"the",
"given",
"properties",
"file",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/Properties2HoconConverter.java#L117-L181 |
103,697 | wisdom-framework/wisdom | extensions/wisdom-filters/src/main/java/org/wisdom/framework/filters/ConfBasedCorsFilter.java | ConfBasedCorsFilter.activate | @Validate
public void activate() {
active = configuration.getBooleanWithDefault(CORS_FILTER_ENABLED, false);
extraHeaders = configuration.getList(CORS_FILTER_ALLOW_HEADERS);
allowedHosts = configuration.getList(CORS_FILTER_ALLOW_ORIGIN);
allowCredentials = configuration.getBooleanWit... | java | @Validate
public void activate() {
active = configuration.getBooleanWithDefault(CORS_FILTER_ENABLED, false);
extraHeaders = configuration.getList(CORS_FILTER_ALLOW_HEADERS);
allowedHosts = configuration.getList(CORS_FILTER_ALLOW_ORIGIN);
allowCredentials = configuration.getBooleanWit... | [
"@",
"Validate",
"public",
"void",
"activate",
"(",
")",
"{",
"active",
"=",
"configuration",
".",
"getBooleanWithDefault",
"(",
"CORS_FILTER_ENABLED",
",",
"false",
")",
";",
"extraHeaders",
"=",
"configuration",
".",
"getList",
"(",
"CORS_FILTER_ALLOW_HEADERS",
... | Initialisation method. It checks whether the CORS support needs to be enabled or not. | [
"Initialisation",
"method",
".",
"It",
"checks",
"whether",
"the",
"CORS",
"support",
"needs",
"to",
"be",
"enabled",
"or",
"not",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/extensions/wisdom-filters/src/main/java/org/wisdom/framework/filters/ConfBasedCorsFilter.java#L77-L87 |
103,698 | wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/DefaultMaven2OsgiConverter.java | DefaultMaven2OsgiConverter.cleanupVersion | public static String cleanupVersion(String version) {
StringBuilder result = new StringBuilder();
Matcher m = FUZZY_VERSION.matcher(version);
if (m.matches()) {
String major = m.group(1);
String minor = m.group(3);
String micro = m.group(5);
String... | java | public static String cleanupVersion(String version) {
StringBuilder result = new StringBuilder();
Matcher m = FUZZY_VERSION.matcher(version);
if (m.matches()) {
String major = m.group(1);
String minor = m.group(3);
String micro = m.group(5);
String... | [
"public",
"static",
"String",
"cleanupVersion",
"(",
"String",
"version",
")",
"{",
"StringBuilder",
"result",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"Matcher",
"m",
"=",
"FUZZY_VERSION",
".",
"matcher",
"(",
"version",
")",
";",
"if",
"(",
"m",
".",
... | Cleans up the version to be OSGi compliant.
@param version a Maven version
@return the OSGi version computed from the given Maven version. | [
"Cleans",
"up",
"the",
"version",
"to",
"be",
"OSGi",
"compliant",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/utils/DefaultMaven2OsgiConverter.java#L160-L199 |
103,699 | wisdom-framework/wisdom | documentation/samples/src/main/java/org/wisdom/samples/session/SessionController.java | SessionController.clear | @Route(method = HttpMethod.POST, uri = "/session/clear")
public Result clear() {
session().clear();
return redirect(router.getReverseRouteFor(this, "index"));
} | java | @Route(method = HttpMethod.POST, uri = "/session/clear")
public Result clear() {
session().clear();
return redirect(router.getReverseRouteFor(this, "index"));
} | [
"@",
"Route",
"(",
"method",
"=",
"HttpMethod",
".",
"POST",
",",
"uri",
"=",
"\"/session/clear\"",
")",
"public",
"Result",
"clear",
"(",
")",
"{",
"session",
"(",
")",
".",
"clear",
"(",
")",
";",
"return",
"redirect",
"(",
"router",
".",
"getReverse... | Action called to clear the session | [
"Action",
"called",
"to",
"clear",
"the",
"session"
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/documentation/samples/src/main/java/org/wisdom/samples/session/SessionController.java#L58-L62 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.