Class ExternalBrowserPagesImpl

  • All Implemented Interfaces:
    IExternalBrowserPages

    public class ExternalBrowserPagesImpl
    extends java.lang.Object
    implements IExternalBrowserPages
    Class to handle external web pages with embedded Jetty.
    Author:
    Christopher Mindus
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean doAuthenticate​(java.lang.String target)
      Checks if a request URL is a WebSocket request or an Application URI that should not use authentication.
      java.lang.Object getFileOrResource​(java.lang.String location, java.lang.String target)
      Gets a File or Resource redirection from a web server target request, used for e.g.
      void initialize​(IntegratedWebServer iws)
      Called when initialized.
      boolean isTargetValid​(java.lang.String target)
      Checks for valid target to handle.
      void print​(java.io.PrintWriter pw, java.lang.String root, java.lang.String target, HttpServletRequest request, HttpServletResponse response)
      Print the page output.
      static java.lang.String setTooltipPreview​(java.lang.String html)
      Sets the current tooltip preview.
      • Methods inherited from class java.lang.Object

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

      • ExternalBrowserPagesImpl

        public ExternalBrowserPagesImpl​(InternalWebServer webServer)
        Constructor.
    • Method Detail

      • setTooltipPreview

        public static java.lang.String setTooltipPreview​(java.lang.String html)
        Sets the current tooltip preview.
        Parameters:
        html - The HTML string to set as preview.
        Returns:
        The resource to use in a browser.
      • doAuthenticate

        public boolean doAuthenticate​(java.lang.String target)
        Checks if a request URL is a WebSocket request or an Application URI that should not use authentication.
        Specified by:
        doAuthenticate in interface IExternalBrowserPages
        Parameters:
        target - The target URI.
        Returns:
        true if authentication should be performed, false otherwise.
      • getFileOrResource

        public java.lang.Object getFileOrResource​(java.lang.String location,
                                                  java.lang.String target)
        Gets a File or Resource redirection from a web server target request, used for e.g. Asset resource files when used on the server and the file is inside a Jar.
        Specified by:
        getFileOrResource in interface IExternalBrowserPages
        Parameters:
        location - The location string between '/$' and '$/'
        target - The target string from the Web Server after last '$/' (i.e. after location), does NOT begin with '/'.
        Returns:
        The File for the resource, null for none.
      • isTargetValid

        public boolean isTargetValid​(java.lang.String target)
        Checks for valid target to handle.
        Specified by:
        isTargetValid in interface IExternalBrowserPages
      • print

        public void print​(java.io.PrintWriter pw,
                          java.lang.String root,
                          java.lang.String target,
                          HttpServletRequest request,
                          HttpServletResponse response)
                   throws java.io.IOException
        Print the page output.
        Specified by:
        print in interface IExternalBrowserPages
        Parameters:
        pw - The print writer.
        root - The web server root.
        target - Target page.
        request - The request.
        response - The response.
        Throws:
        java.io.IOException - For I/O errors.