java.lang.Object
net.i2p.router.web.FormHandler
net.i2p.router.web.helpers.ConfigClientsHandler

public class ConfigClientsHandlerextends FormHandler
Handles configuration changes for I2P client applications and web apps. Saves changes to clients.config and webapps.config files, manages client installation, updates, and startup configuration.
  • Constructor Details

    • ConfigClientsHandler

      public ConfigClientsHandler()
      Construct a new ConfigClientsHandler.
  • Method Details

    • processForm

      protected void processForm()
      Description copied from class: FormHandler
      Implement this to perform the final processing (in turn, adding formNotice and formError messages, etc)

      Will only be called if _action is non-null and the nonce is valid.

      Specified by:
      processForm in class FormHandler
    • saveClientChanges

      private void saveClientChanges()
      Saves the client changes from the form.
    • saveClientChanges2

      private void saveClientChanges2() throws IOException
      Writes the client changes to the config.
      Throws:
      IOException - if the writing fails
    • stopClient

      private void stopClient(int i)
      Stop a running client by index.
      Parameters:
      i - index into the client app list of the client to stop
    • startClient

      private void startClient(int i)
      Starts the client at the index.
      Parameters:
      i - the index of the client
    • deleteClient

      private void deleteClient(int i)
      Deletes the client at the index.
      Parameters:
      i - the index of the client
    • saveWebAppChanges

      private void saveWebAppChanges()
      Saves the webapp changes from the form.
    • savePluginChanges

      private void savePluginChanges()
      Saves the plugin changes from the form.
    • startWebApp

      private void startWebApp(String app)
      Big hack for the moment, not using properties for directory and port Go through all the Jetty servers, find the one serving port 7657, requested and add the .war to that one.
      Parameters:
      app - the web app name, also the base name of the .war file in webapps
    • installPlugin

      private void installPlugin()
      Installs the plugin from the form.
    • installPluginFromFile

      private void installPluginFromFile()
      Install a plugin from a local file upload.
    • updatePlugin

      private void updatePlugin(String app)
      Updates the plugin from the update site.
      Parameters:
      app - the name of the plugin
    • updateAllPlugins

      private void updateAllPlugins()
      Update all installed plugins.
    • installPlugin

      private void installPlugin(String app, String url)
      Install a plugin from a URL.
      Parameters:
      app - null for a new install
      url - http: or file:
    • checkPlugin

      private void checkPlugin(String app)
      Checks the plugin for an update.
      Parameters:
      app - the name of the plugin
    • verifyProxy

      private boolean verifyProxy()
      Plugin checks, updates, and installs are always proxied. See if the proxy tunnel is available, unless we're configured to use something else (probably not). Outputs form error if returning false.
      Returns:
      true if available
    • startPlugin

      private void startPlugin(String app)
      Starts the plugin.
      Parameters:
      app - the name of the plugin
    • saveInterfaceChanges

      private void saveInterfaceChanges()
      Handle interface form.