Class URLProtocolHandler

java.lang.Object
gaiasky.util.urlprotocol.URLProtocolHandler

public class URLProtocolHandler extends Object
  • Field Details

  • Method Details

    • isDatasetUrl

      public static boolean isDatasetUrl(String arg)
      Returns true if the given CLI argument is a URLProtocolHandler URL.
      Parameters:
      arg - The CLI argument.
      Returns:
      True if the argument is a gaiasky:// URL.
    • setPendingUrl

      public static void setPendingUrl(String url)
      Stores a URL received before the UI is ready (e.g. through the macOS open-URL event). It will be processed by the startup path once the welcome GUI is built.
      Parameters:
      url - The dataset URL.
    • consumePendingUrl

      public static String consumePendingUrl()
      Returns and clears the pending URL, if any.
      Returns:
      The pending dataset URL, or null if none is set.
    • handle

      public static void handle(String url, com.badlogic.gdx.scenes.scene2d.ui.Skin skin, com.badlogic.gdx.scenes.scene2d.Stage stage)
      Handles the given URL with the default behavior (no hot-load). See handle(String, Skin, Stage, boolean).
      Parameters:
      url - The URL, as received in the CLI.
      skin - The UI skin.
      stage - The UI stage.
    • handle

      public static void handle(String url, com.badlogic.gdx.scenes.scene2d.ui.Skin skin, com.badlogic.gdx.scenes.scene2d.Stage stage, boolean hotLoad)
      Handles the given URL, if it has not been handled yet. This must be called from the GL thread, once a UI stage is available and the dataset metadata has been fetched.

      If hotLoad is false (startup path), an already-installed dataset is only enabled — it will be loaded by the regular startup sequence. If hotLoad is true (Gaia Sky already running), the dataset is loaded immediately after installation/enabling through the hot-load API.

      The deduplication guard only applies to the startup path (hotLoad is false), where the same CLI URL may be processed more than once (e.g. when the welcome GUI is rebuilt). URLs forwarded from a second instance (hotLoad is true) are always processed, so that re-sending the same URL works as expected.

      Parameters:
      url - The URL, as received in the CLI.
      skin - The UI skin.
      stage - The UI stage.
      hotLoad - True to hot-load the dataset once installed/enabled.