Class SystemUtils
java.lang.Object
org.matwoess.jsourceprofiler.fxui.util.SystemUtils
This class contains utility methods for interacting with the operating system.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidchooseDirectory(ObjectProperty<Path> dirProperty) Opens a file chooser dialog and sets the chosen path on the given directory path property.static intexecuteToolWithParameters(AppState appState) Calls the tool with the given parameters in the system terminal.static StringgetJavaRunCommand(String[] toolArguments) Builds the java command string to execute the tool with the given arguments.static String[]getTerminalCommand(AppState appState) Builds an array of strings representing the command to be executed in the system terminal.static voidOpens the specified path with its default desktop application.
-
Constructor Details
-
SystemUtils
public SystemUtils()
-
-
Method Details
-
chooseDirectory
Opens a file chooser dialog and sets the chosen path on the given directory path property.- Parameters:
dirProperty- the directory path property to set
-
openWithDesktopApplication
Opens the specified path with its default desktop application.- Parameters:
path- the path to open
-
executeToolWithParameters
Calls the tool with the given parameters in the system terminal.- Parameters:
appState- the app state containing the parameters- Returns:
- the exit code of execution
-
getTerminalCommand
Builds an array of strings representing the command to be executed in the system terminal.- Parameters:
appState- the app state containing the parameters- Returns:
- the command that can be executed in a system terminal using
ProcessBuilder
-
getJavaRunCommand
Builds the java command string to execute the tool with the given arguments.- Parameters:
toolArguments- the arguments to be passed to the tool- Returns:
- the string representation of the java command
-