Class UtilsKt
-
- All Implemented Interfaces:
public final class UtilsKt
-
-
Field Summary
Fields Modifier and Type Field Description private static BooleanprintStackTrace
-
Method Summary
Modifier and Type Method Description BooleangetPrintStackTrace()Global variable that gets toggled by a command line parameter parsed in the main entry points of the modules. voidsetPrintStackTrace(Boolean printStackTrace)Global variable that gets toggled by a command line parameter parsed in the main entry points of the modules. final static List<String>filterVersionNames(String version, List<String> names, String project)Filter a list of names to include only those that likely belong to the given version of an optional project. final static PasswordAuthenticationrequestPasswordAuthentication(String host, Integer port, String scheme)Request a PasswordAuthentication object for the given host, port, and scheme. final static PasswordAuthenticationrequestPasswordAuthentication(URI uri)Request a PasswordAuthentication object for the given uri. final static StringnormalizeVcsUrl(String vcsUrl)Normalize a string representing a VCS URL to a common string form. final static <T extends Any> TrunBlocking(CoroutineContext context, SuspendFunction1<CoroutineScope, T> block)A wrapper for kotlinx.coroutines.runBlocking which always adds a CoroutineThreadContext to the newly created coroutine context. -
-
Method Detail
-
getPrintStackTrace
Boolean getPrintStackTrace()
Global variable that gets toggled by a command line parameter parsed in the main entry points of the modules.
-
setPrintStackTrace
void setPrintStackTrace(Boolean printStackTrace)
Global variable that gets toggled by a command line parameter parsed in the main entry points of the modules.
-
filterVersionNames
final static List<String> filterVersionNames(String version, List<String> names, String project)
Filter a list of names to include only those that likely belong to the given version of an optional project.
-
requestPasswordAuthentication
final static PasswordAuthentication requestPasswordAuthentication(String host, Integer port, String scheme)
Request a PasswordAuthentication object for the given host, port, and scheme. Install the OrtAuthenticator and the OrtProxySelector beforehand to ensure they are active.
-
requestPasswordAuthentication
final static PasswordAuthentication requestPasswordAuthentication(URI uri)
Request a PasswordAuthentication object for the given uri. Install the OrtAuthenticator and the OrtProxySelector beforehand to ensure they are active.
-
normalizeVcsUrl
final static String normalizeVcsUrl(String vcsUrl)
Normalize a string representing a VCS URL to a common string form.
-
runBlocking
final static <T extends Any> T runBlocking(CoroutineContext context, SuspendFunction1<CoroutineScope, T> block)
A wrapper for kotlinx.coroutines.runBlocking which always adds a CoroutineThreadContext to the newly created coroutine context. This ensures that Log4j's MDC context is not lost when
runBlockingis used.This function should be used instead of kotlinx.coroutines.runBlocking in all code that can be used as a library to preserve any MDC context set by a consumer.
-
-
-
-