Package jline.io

Class SysUtils

java.lang.Object
jline.io.SysUtils

public class SysUtils extends Object
Functions for interfacing with JMT, JLQN, and the operating system
  • Constructor Details

    • SysUtils

      public SysUtils()
  • Method Details

    • jlqnGetPath

      public static String jlqnGetPath()
      Returns the path to the JLQN (Java Layered Queueing Network GUI) JAR file. If the JLQN JAR file is not found, the function will download it to the jmt solver folder.
      Returns:
      The path to the JLQN JAR file.
    • jlqnGetPath

      public static String jlqnGetPath(String jlqnPath)
    • jmtGetPath

      public static String jmtGetPath()
      Returns the path to the JMT (Java Modelling Tools) JAR file. If the JMT JAR file is not found, the function will download it to the jmt solver folder.
      Returns:
      The path to the JMT JAR file.
    • jmtGetPath

      public static String jmtGetPath(String jmtPath)
    • system

      public static String system(String cmd)
      Executes a system command and returns its output as a String. This function mimics the behavior of executing a shell command.
      Parameters:
      cmd - The system command to be executed.
      Returns:
      The standard output if the command successfully executes, otherwise returns the standard error output.
    • getRootFolder

      public static String getRootFolder()
      Retrieves the root folder where the application's JAR file is located.
      Returns:
      The absolute path of the parent directory containing the JAR file. Returns null if an exception occurs.
    • lineTempName

      public static String lineTempName(String solverName) throws IOException
      Creates a temporary directory within a specified solver workspace and returns its path.

      This function first constructs the path of the solver workspace by appending the solverName to the root directory of the application. If the workspace directory does not exist, it is created. A temporary directory is then created inside this workspace.

      Parameters:
      solverName - The name of the solver for which the temporary directory is to be created.
      Returns:
      The absolute path of the newly created temporary directory.
      Throws:
      IOException - If an I/O error occurs or the directory cannot be created.
    • lineTempName

      public static String lineTempName() throws IOException
      Creates a temporary directory within the default workspace and returns its path.
      Returns:
      The absolute path of the newly created temporary directory.
      Throws:
      IOException - If an I/O error occurs or the directory cannot be created.
    • removeDirectory

      public static void removeDirectory(Path dirPath) throws IOException
      Recursively removes a directory and all its contents.
      Parameters:
      dirPath - The Path object pointing to the directory to be removed.
      Throws:
      IOException - If an I/O error occurs while deleting the directory or its contents.