Class ChromiumBinaries

java.lang.Object
com.teamdev.jxbrowser.engine.ChromiumBinaries

public final class ChromiumBinaries extends Object
A class responsible for delivering Chromium binaries before starting the Engine.

By default, Chromium binaries come in a form of an archive inside a JAR file. The library automatically finds and extracts them when creating an Engine.

Use this class if you want to extract the binaries in advance, or if you want to override how JxBrowser locates and obtains the binaries.

Since:
7.35
  • Method Details

    • deliverToDefaultDirectory

      public static void deliverToDefaultDirectory()
      Delivers Chromium binaries to the default directory if necessary.

      By default, Engine unpacks and copies the binaries when it is created. This may take up to several seconds, depending on the hardware. Use this method to do it in advance.

      Does nothing if the binaries are already delivered.

      Throws:
      ChromiumBinariesDeliveryException - when the delivery of the Chromium binaries failed
      See Also:
    • deliverToDefaultDirectory

      public static void deliverToDefaultDirectory(BinariesDelivery delivery)
      Delivers Chromium binaries to the default directory, but delegates actual delivery to the given delivery.

      Use this method to override how JxBrowser locates and obtains the binaries.

      Does nothing if the binaries are already delivered.

      Parameters:
      delivery - the delivery mechanism of the binaries
      Throws:
      ChromiumBinariesDeliveryException - when the delivery of the Chromium binaries failed
      See Also:
    • deliverTo

      public static void deliverTo(Path chromiumDir)
      Delivers Chromium binaries to the given chromiumDir if necessary.

      By default, Engine unpacks and copies the binaries when it is created. This may take up to several seconds, depending on the hardware. Use this method to do it in advance.

      Creates the given directory if it doesn't exist.

      Does nothing if the binaries are already delivered.

      Parameters:
      chromiumDir - the directory to copy the Chromium binaries to
      Throws:
      ChromiumBinariesDeliveryException - when the delivery of the Chromium binaries failed
      See Also:
    • deliverTo

      public static void deliverTo(Path chromiumDir, BinariesDelivery delivery)
      Delivers Chromium binaries to the given chromiumDir, but delegates actual delivery to the given delivery.

      Use this method to override how JxBrowser locates and obtains the binaries.

      Creates the given directory if it doesn't exist.

      Does nothing if the binaries are already delivered.

      Parameters:
      chromiumDir - the path to the directory where the binaries must be copied
      delivery - the delivery mechanism of the binaries
      Throws:
      ChromiumBinariesDeliveryException - when the verification of the Chromium binary files has failed or the binaries couldn't be extracted from the resources
      See Also: