java.lang.Object
org.klomp.snark.web.I2PSnarkConfigure

class I2PSnarkConfigureextends Object
Renders the three forms of the /configure page - main settings, torrent creation filters, and tracker management - and applies submitted settings back to SnarkManager. Extracted wholesale from I2PSnarkServlet; bodies are verbatim moves qualified for servlet access via srv.
  • Constructor Details

    • I2PSnarkConfigure

      I2PSnarkConfigure(I2PSnarkServlet srv)
      Bind to the servlet whose protected helpers and settings this renderer calls.
      Parameters:
      srv - the owning servlet, reached for its manager, context path and translation
  • Method Details

    • writeConfigForm

      void writeConfigForm(PrintWriter out, HttpServletRequest req) throws IOException
      Writes the HTML configuration form with all I2PSnark settings.
      Parameters:
      out - the PrintWriter to write the HTML output
      req - the HTTP request containing query parameters
      Throws:
      IOException - if an I/O error occurs during writing
    • writeTorrentCreateFilterForm

      void writeTorrentCreateFilterForm(PrintWriter out, HttpServletRequest req) throws IOException
      Writes the HTML form for managing torrent creation file filters.
      Parameters:
      out - the PrintWriter to which the HTML output will be written
      req - the HttpServletRequest containing the current request parameters
      Throws:
      IOException - if an I/O error occurs while writing to the output stream
    • writeTrackerForm

      void writeTrackerForm(PrintWriter out, HttpServletRequest req) throws IOException
      Writes the HTML form for managing trackers with optimized string building. Minimizes append() calls by batching HTML fragments, and caches collections for efficient lookups.
      Parameters:
      out - the PrintWriter to which the HTML output will be written
      req - the HttpServletRequest containing the current request parameters
      Throws:
      IOException - if an I/O error occurs while writing to the output stream
    • applySettings

      public void applySettings(HttpServletRequest req)
      Parses the configuration form POST parameters and applies them via SnarkManager.
      Parameters:
      req - the configure-page POST request