Class ChromeUtils

java.lang.Object
uno.anahata.asi.yam.tools.chrome.ChromeUtils

public class ChromeUtils extends Object
Utility class for Chrome-specific path detection and environment resolution.

This class leverages SystemUtils from Apache Commons Lang 3 for reliable OS detection.

Author:
anahata
  • Constructor Details

    • ChromeUtils

      public ChromeUtils()
  • Method Details

    • getDefaultChromeUserDataDir

      public static String getDefaultChromeUserDataDir()
      Resolves the absolute path to the standard Chrome user data directory for the current operating system.

      Supports Windows (AppData), macOS (Application Support), and Linux (various .config locations).

      Returns:
      The absolute path to the directory.
    • getChromeDriverExecutableName

      public static String getChromeDriverExecutableName()
      Gets the expected name of the ChromeDriver executable for the current OS.
      Returns:
      The executable name (e.g., "chromedriver.exe" or "chromedriver").
    • findChromeDriver

      public static String findChromeDriver()
      Attempts to find a valid chromedriver executable on the local machine.

      Prioritizes ~/bin (user-local installs) and then searches the system PATH.

      Returns:
      The absolute path to the driver, or null if not found.