public class ExecUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
PROCESS_ERROR_EXIT_CODE
Error code used when a spawn process cannot be found, created, or stopped smoothly.
|
static int |
SYSTEM_CONFIGURATION_EXIT_CODE
Error code used when the system configuration does not satisfy the requirements (java not found for example).
|
static int |
VERTX_DEPLOYMENT_EXIT_CODE
Error code used when a deployment failed.
|
static int |
VERTX_INITIALIZATION_EXIT_CODE
Error code used when vert.x cannot be initialized.
|
| Constructor and Description |
|---|
ExecUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addArgument(List<String> args,
String argument)
Adds an argument to the given list.
|
static void |
exit(int code)
Exits the JVM with the given exit code.
|
static void |
exitBecauseOfProcessIssue()
Exits the JVM and indicate an issue with a process creation or termination.
|
static void |
exitBecauseOfSystemConfigurationIssue()
Exits the JVM and indicate an issue with the system configuration.
|
static void |
exitBecauseOfVertxDeploymentIssue()
Exits the JVM and indicate an issue during the deployment of the main verticle.
|
static void |
exitBecauseOfVertxInitializationIssue()
Exits the JVM and indicate an issue during the Vert.x initialization.
|
static boolean |
isLinux() |
static boolean |
isWindows() |
static String |
quoteArgument(String argument)
Puts quotes around the given String if necessary.
|
public static final int VERTX_INITIALIZATION_EXIT_CODE
public static final int VERTX_DEPLOYMENT_EXIT_CODE
public static final int PROCESS_ERROR_EXIT_CODE
public static final int SYSTEM_CONFIGURATION_EXIT_CODE
public static String quoteArgument(String argument)
If the argument doesn't include spaces or quotes, return it as is. If it contains double quotes, use single quotes - else surround the argument by double quotes.
argument - the argument to be quotedIllegalArgumentException - If argument contains both types of quotespublic static void addArgument(List<String> args, String argument)
args - the list of argumentsargument - the argument to addpublic static boolean isWindows()
true if the current operating system belongs to the "windows" family.public static boolean isLinux()
true if the current operating system belongs to the "linux" family.public static void exit(int code)
code - the code, 0 for success. By convention a non zero value if return to denotes an
error.public static void exitBecauseOfVertxInitializationIssue()
public static void exitBecauseOfVertxDeploymentIssue()
public static void exitBecauseOfProcessIssue()
public static void exitBecauseOfSystemConfigurationIssue()
Copyright © 2020. All rights reserved.