Package com.iizix.pwa

Class PWACustomHTML

java.lang.Object
com.iizix.pwa.PWACustomHTML

public class PWACustomHTML extends Object
Class holding custom HTML for an app and potentially a language.
Author:
Christopher Mindus
  • Constructor Details

    • PWACustomHTML

      public PWACustomHTML(File cacheDir, File iiziAppHTML, String appID, PWAProps props, IKStringInfoProvider provider, String httpsServer) throws IOException
      Constructs a new instance of the PWA customizer for HTML.
      Parameters:
      cacheDir - Cache directory where to place the customized HTML.
      iiziAppHTML - The un-customized version of "iiziApp.html".
      appID - The application ID.
      props - The PWA properties for the application.
      provider - The KString information provider that is not language sensitive.
      httpsServer - The HTTPS server.
      Throws:
      IOException - If the "iiziApp.html" failed to load.
  • Method Details

    • getGenerateHTML

      public File getGenerateHTML(String languageCode) throws IOException
      Gets or generates a customized HTML file from the template "iiziApp.html".

      This method will block the caller thread (and others requesting the same language) until it has completed.

      Parameters:
      languageCode - The language code requested, null or empty string for default language. If the language code is not found, the default one will be used.
      Returns:
      The generated (or cached) HTML file, or null for an error with this language from a previous call.
      Throws:
      IOException - For I/O errors: only first time an IOException is thrown, subsequent calls with the same language code will result in null being returned.