Class SystemUtils

java.lang.Object
org.matwoess.jsourceprofiler.fxui.util.SystemUtils

public class SystemUtils extends Object
This class contains utility methods for interacting with the operating system.
  • Constructor Details

    • SystemUtils

      public SystemUtils()
  • Method Details

    • chooseDirectory

      public static void chooseDirectory(ObjectProperty<Path> dirProperty)
      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

      public static void openWithDesktopApplication(Path path)
      Opens the specified path with its default desktop application.
      Parameters:
      path - the path to open
    • executeToolWithParameters

      public static int executeToolWithParameters(AppState appState)
      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

      public static String[] getTerminalCommand(AppState appState)
      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

      public static String getJavaRunCommand(String[] toolArguments)
      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