Package jline.io

Class SysUtilsKt

  • All Implemented Interfaces:

    
    public final class SysUtilsKt
    
                        
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private final static String rootFolder
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final String getRootFolder()
      final static String jlqnGetPath() Returns the path to the JLQN JAR file, downloading if necessary.
      final static String jlqnGetPath(String jlqnPath)
      final static String jmtGetPath() Returns the path to the JMT JAR file, downloading if necessary.
      final static String jmtGetPath(String jmtPath)
      final static String system(String cmd, Long timeoutSeconds) Executes a system command and returns the output or error.
      final static String system(String cmd) Executes a system command and returns the output or error.
      final static String lineTempName(String solverName) Creates a temporary directory within a workspace for a solver.
      final static Unit removeDirectory(Path dirPath) Recursively deletes a directory and its contents.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • jlqnGetPath

         final static String jlqnGetPath()

        Returns the path to the JLQN JAR file, downloading if necessary.

      • jmtGetPath

         final static String jmtGetPath()

        Returns the path to the JMT JAR file, downloading if necessary.

      • 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 execute
        timeoutSeconds - 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.