Class NgrokInstaller


  • public class NgrokInstaller
    extends java.lang.Object
    A helper for downloading and installing the ngrok for the current system.
    • Constructor Summary

      Constructors 
      Constructor Description
      NgrokInstaller()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String getNgrokBin()
      Get the ngrok executable for the current system.
      void installDefaultConfig​(java.nio.file.Path configPath, java.util.Map<java.lang.String,​java.lang.String> data)
      Install the default ngrok config.
      void installNgrok​(java.nio.file.Path ngrokPath)
      Download and install the latest ngrok for the current system, overwriting any existing contents at the given path.
      void validateConfig​(java.nio.file.Path configPath)
      Validate that the config file at the given path is valid for ngrok and java-ngrok.
      void validateConfig​(java.util.Map<java.lang.String,​java.lang.String> data)
      Validate that the given map of config items are valid for ngrok and java-ngrok.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NgrokInstaller

        public NgrokInstaller()
    • Method Detail

      • getNgrokBin

        public static java.lang.String getNgrokBin()
        Get the ngrok executable for the current system.
        Returns:
        The name of the ngrok executable.
      • installDefaultConfig

        public void installDefaultConfig​(java.nio.file.Path configPath,
                                         java.util.Map<java.lang.String,​java.lang.String> data)
        Install the default ngrok config. If a config is not already present for the given path, create one.
        Parameters:
        configPath - The path to where the ngrok config should be installed.
        data - A map of things to add to the default config.
      • installNgrok

        public void installNgrok​(java.nio.file.Path ngrokPath)
        Download and install the latest ngrok for the current system, overwriting any existing contents at the given path.
        Parameters:
        ngrokPath - The path to where the ngrok binary will be downloaded.
      • validateConfig

        public void validateConfig​(java.nio.file.Path configPath)
        Validate that the config file at the given path is valid for ngrok and java-ngrok.
        Parameters:
        configPath - The config path to validate.
      • validateConfig

        public void validateConfig​(java.util.Map<java.lang.String,​java.lang.String> data)
        Validate that the given map of config items are valid for ngrok and java-ngrok.
        Parameters:
        data - A map of things to be validated as config items.