Class Favicon

java.lang.Object
services.moleculer.service.MoleculerComponent
services.moleculer.service.Service
services.moleculer.web.middleware.HttpMiddleware
services.moleculer.web.middleware.Favicon
All Implemented Interfaces:
services.moleculer.service.MoleculerLifecycle, HttpConstants

public class Favicon extends HttpMiddleware implements HttpConstants
Server "/favicon.ico" HTTP requests. Sample:
route.use(new Favicon("custom.ico"));
  • Field Details

    • iconPath

      protected String iconPath
      Relative icon file path.
    • maxAge

      protected int maxAge
      Max-age header's value (0 = no max-age header).
    • iconURL

      protected String iconURL
      Relative URL of the Favicon.
    • useETags

      protected boolean useETags
      Use ETag headers
    • image

      protected byte[] image
  • Constructor Details

    • Favicon

      public Favicon()
    • Favicon

      public Favicon(String pathToIcon)
    • Favicon

      public Favicon(String pathToIcon, int maxAge)
  • Method Details

    • install

      public RequestProcessor install(RequestProcessor next, io.datatree.Tree config)
      Specified by:
      install in class HttpMiddleware
    • getIconPath

      public String getIconPath()
    • setIconPath

      public void setIconPath(String iconPath)
    • getMaxAge

      public int getMaxAge()
    • setMaxAge

      public void setMaxAge(int maxAge)
    • getIconURL

      public String getIconURL()
    • setIconURL

      public void setIconURL(String iconURL)
    • isUseETags

      public boolean isUseETags()
    • setUseETags

      public void setUseETags(boolean useETags)