Class Redirect

java.lang.Object
megalodonte.base.Redirect

public final class Redirect extends Object
Opens a URL in the system's default browser. Each call spawns a new thread to avoid blocking the JavaFX Application Thread.
  • Constructor Details

    • Redirect

      public Redirect()
  • Method Details

    • to

      public static void to(String url)
      Opens the given URL in the default browser. Logs the error to stderr on failure.
      Parameters:
      url - the URL to open
    • to

      public static void to(String url, Consumer<Exception> exceptionCallback)
      Opens the given URL in the default browser, notifying the callback on failure.
      Parameters:
      url - the URL to open
      exceptionCallback - called with the exception if the browse fails