Class SysUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic Stringstatic StringResolves the Java launcher used to spawn a JVM tool (JMT, LDES).static Stringstatic StringjlqnGetPath(String jlqnPath) static StringLocatesJMT.jar.static StringjmtGetPath(String jmtPath) static Stringstatic StringlineTempName(String solverName) static StringlineTempName(String solverName, boolean mountable) AslineTempName(String), but whenmountableis true the workspace is rooted under$HOME/.lineinstead of the system temp dir.static Stringstatic voidremoveDirectory(Path dirPath) splitCommand(String cmd) Splits a command line into an argument vector, keeping a double-quoted span together.static Stringstatic String
-
Method Details
-
getRootFolder
-
jlqnGetPath
-
jlqnGetPath
-
javaLauncher
Resolves the Java launcher used to spawn a JVM tool (JMT, LDES).Resolution order:
$LINE_JAVA;$JAVA_HOME/bin/java; the JVM running this code (java.home); then the bare namejava, left to PATH. Thejava.homestep matters where PATH carries no java at all, which is the common case on Windows: a process already inside a JVM always has one launcher it can name.- Returns:
- an absolute launcher path, or "java" when only PATH can answer
-
jmtGetPath
LocatesJMT.jar.Resolution order:
$LINE_JMT_JAR; the directory of the running jar and its ancestors; then the working directory and its ancestors. A candidate counts only whenJMT.jaris actually in it. The walk used to accept the first ancestor merely NAMEDcommon, so an emptypython/commonshadowed the realcommon/for every invocation whose cwd was underpython/and the CLI went off to download 50MB instead. See_kb/12-interfaces-and-docs.md.- Returns:
- the path of JMT.jar, existing where one was found
-
jmtGetPath
-
lineViewerGetPath
-
system
-
splitCommand
Splits a command line into an argument vector, keeping a double-quoted span together.Splitting on whitespace alone tore apart every path with a space in it, which on Windows is where both the JVM (
C:\Program Files\...\java.exe) and the model normally live.- Parameters:
cmd- the command line- Returns:
- its arguments, with the quotes removed
-
system
-
lineTempName
- Throws:
IOException
-
lineTempName
- Throws:
IOException
-
lineTempName
AslineTempName(String), but whenmountableis true the workspace is rooted under$HOME/.lineinstead of the system temp dir. Snap-confined Docker cannot bind-mount the system temp dir (typically/tmp), so solvers that dispatch through Docker request a HOME-based, mount-accessible location (mirrors the MATLABlineTempName).- Throws:
IOException
-
removeDirectory
- Throws:
IOException
-