Package com.iizix.pwa
Class PWACustomHTML
java.lang.Object
com.iizix.pwa.PWACustomHTML
Class holding custom HTML for an app and potentially a language.
- Author:
- Christopher Mindus
Constructor Summary
ConstructorsConstructorDescriptionPWACustomHTML(File cacheDir, File iiziAppHTML, String appID, PWAProps props, IKStringInfoProvider provider, String httpsServer) Constructs a new instance of the PWA customizer for HTML.Method Summary
Modifier and TypeMethodDescriptiongetGenerateHTML(String languageCode) Gets or generates a customized HTML file from the template "iiziApp.html".
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
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,nullor 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
nullfor 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 innullbeing returned.