Package jline.io
Class SysUtils
java.lang.Object
jline.io.SysUtils
Functions for interfacing with JMT, JLQN, and the operating system
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
Retrieves the root folder where the application's JAR file is located.static String
Returns the path to the JLQN (Java Layered Queueing Network GUI) JAR file.static String
jlqnGetPath
(String jlqnPath) static String
Returns the path to the JMT (Java Modelling Tools) JAR file.static String
jmtGetPath
(String jmtPath) static String
Creates a temporary directory within the default workspace and returns its path.static String
lineTempName
(String solverName) Creates a temporary directory within a specified solver workspace and returns its path.static void
removeDirectory
(Path dirPath) Recursively removes a directory and all its contents.static String
Executes a system command and returns its output as a String.
-
Constructor Details
-
SysUtils
public SysUtils()
-
-
Method Details
-
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
-
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
-
system
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
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
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
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
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.
-