Class StaticServerInfo


  • @Immutable
    public class StaticServerInfo
    extends Object
    This singleton instance represents default server information for locations where no request context is available (e.g. in scheduled tasks)
    Author:
    Philip Helger
    • Method Detail

      • getScheme

        @Nonnull
        public String getScheme()
        Returns:
        The scheme. E.g. "http" or "https".
      • getServerName

        @Nonnull
        public String getServerName()
        Returns:
        The server name without scheme. E.g. "www.helger.com"
      • getServerPort

        @CheckForSigned
        public int getServerPort()
        Returns:
        The server port we're running on. May be -1, if constructed from a URL and the passed scheme is neither "http" nor "https".
      • getContextPath

        @Nonnull
        public String getContextPath()
        Returns:
        "/context" or "" (empty string)
      • getFullServerPath

        @Nonnull
        public String getFullServerPath()
        Returns:
        scheme://server:port or scheme://server if the default port was used
      • getFullContextPath

        @Nonnull
        public String getFullContextPath()
        This is a shortcut for getFullServerPath () + getContextPath ().
        Returns:
        scheme://server:port/context or scheme://server:port for the ROOT context.
      • isSet

        public static boolean isSet()