Class SysUtilsKt
-
- All Implemented Interfaces:
public final class SysUtilsKt
-
-
Field Summary
Fields Modifier and Type Field Description private final static StringrootFolder
-
Method Summary
Modifier and Type Method Description final StringgetRootFolder()final static StringjlqnGetPath()Returns the path to the JLQN JAR file, downloading if necessary. final static StringjlqnGetPath(String jlqnPath)final static StringjmtGetPath()Returns the path to the JMT JAR file, downloading if necessary. final static StringjmtGetPath(String jmtPath)final static Stringsystem(String cmd, Long timeoutSeconds)Executes a system command and returns the output or error. final static Stringsystem(String cmd)Executes a system command and returns the output or error. final static StringlineTempName(String solverName)Creates a temporary directory within a workspace for a solver. final static UnitremoveDirectory(Path dirPath)Recursively deletes a directory and its contents. -
-
Method Detail
-
getRootFolder
final String getRootFolder()
-
jlqnGetPath
final static String jlqnGetPath()
Returns the path to the JLQN JAR file, downloading if necessary.
-
jlqnGetPath
final static String jlqnGetPath(String jlqnPath)
-
jmtGetPath
final static String jmtGetPath()
Returns the path to the JMT JAR file, downloading if necessary.
-
jmtGetPath
final static String jmtGetPath(String jmtPath)
-
system
@JvmOverloads() final static String system(String cmd, Long timeoutSeconds)
Executes a system command and returns the output or error.
This function reads stdout and stderr concurrently to avoid deadlock. If both streams are read sequentially, the process can block when its stderr buffer fills up while we're still reading stdout, causing a hang.
- Parameters:
cmd- The command to executetimeoutSeconds- Maximum time to wait for the command to complete (0 = no timeout)- Returns:
The output of the command, or an error message if the command failed or timed out
-
system
@JvmOverloads() final static String system(String cmd)
Executes a system command and returns the output or error.
This function reads stdout and stderr concurrently to avoid deadlock. If both streams are read sequentially, the process can block when its stderr buffer fills up while we're still reading stdout, causing a hang.
- Parameters:
cmd- The command to execute- Returns:
The output of the command, or an error message if the command failed or timed out
-
lineTempName
final static String lineTempName(String solverName)
Creates a temporary directory within a workspace for a solver.
-
removeDirectory
final static Unit removeDirectory(Path dirPath)
Recursively deletes a directory and its contents.
-
-
-
-