Class SystemInfo


  • public class SystemInfo
    extends java.lang.Object
    Utility class for checking Java system properties.
    • Constructor Summary

      Constructors 
      Constructor Description
      SystemInfo()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean isEnabled​(java.lang.String systemProperty)
      Checks whether a System.getProperty(String) is enabled.
      static boolean isIIS()  
      static boolean isServerType​(java.lang.String serverType)  
      • Methods inherited from class java.lang.Object

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

      • MAX_VERSION_NUMBER_SECTIONS

        public static final int MAX_VERSION_NUMBER_SECTIONS
        See Also:
        Constant Field Values
    • Constructor Detail

      • SystemInfo

        public SystemInfo()
    • Method Detail

      • isIIS

        public static boolean isIIS()
        Returns:
        whether the application is run from IIS Older public method kept in case of compatiblity issues
      • isServerType

        public static boolean isServerType​(java.lang.String serverType)
        Returns:
        whether the application is run from param serverType (i.e. IIS or Websphere)
      • isEnabled

        public static boolean isEnabled​(java.lang.String systemProperty)
        Checks whether a System.getProperty(String) is enabled. If a property is explicitly set to "1" or "true" or simply defined without any parameters, it is considered enabled. For example for "someProperty":
        • Enabled: -DsomeProperty -DsomeProperty=1 -DsomeProperty=true -DsomeProperty=abc
        • Disabled: -DsomeProperty=0 -DsomeProperty=false
        Parameters:
        systemProperty - Key name of the system property
        Returns:
        whether property is enabled