Package jline.io

Class SysUtils

java.lang.Object
jline.io.SysUtils

public final class SysUtils extends Object
  • Method Details

    • getRootFolder

      public static String getRootFolder()
    • jlqnGetPath

      public static String jlqnGetPath()
    • jlqnGetPath

      public static String jlqnGetPath(String jlqnPath)
    • javaLauncher

      public static String 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 name java, left to PATH. The java.home step 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

      public static String jmtGetPath()
      Locates JMT.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 when JMT.jar is actually in it. The walk used to accept the first ancestor merely NAMED common, so an empty python/common shadowed the real common/ for every invocation whose cwd was under python/ 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

      public static String jmtGetPath(String jmtPath)
    • lineViewerGetPath

      public static String lineViewerGetPath()
    • system

      public static String system(String cmd)
    • splitCommand

      public static List<String> splitCommand(String cmd)
      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

      public static String system(String cmd, long timeoutSeconds)
    • lineTempName

      public static String lineTempName() throws IOException
      Throws:
      IOException
    • lineTempName

      public static String lineTempName(String solverName) throws IOException
      Throws:
      IOException
    • lineTempName

      public static String lineTempName(String solverName, boolean mountable) throws IOException
      As lineTempName(String), but when mountable is true the workspace is rooted under $HOME/.line instead 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 MATLAB lineTempName).
      Throws:
      IOException
    • removeDirectory

      public static void removeDirectory(Path dirPath) throws IOException
      Throws:
      IOException