Class SystemProperties


  • public class SystemProperties
    extends java.lang.Object
    Author:
    pugh
    • Field Detail

      • ASSERTIONS_ENABLED

        public static final boolean ASSERTIONS_ENABLED
      • RUNNING_IN_ECLIPSE

        public static final boolean RUNNING_IN_ECLIPSE
      • RUNNING_AS_IDE_PLUGIN

        public static final boolean RUNNING_AS_IDE_PLUGIN
    • Constructor Detail

      • SystemProperties

        public SystemProperties()
    • Method Detail

      • getLocalProperties

        public static java.util.Properties getLocalProperties()
      • getAllProperties

        public static java.util.Properties getAllProperties()
      • loadPropertiesFromURL

        public static void loadPropertiesFromURL​(java.net.URL url)
        This method is public to allow clients to set system properties via any URL
        Parameters:
        url - an url to load system properties from, may be nullerrorMsg
      • getBoolean

        public static boolean getBoolean​(java.lang.String name)
        Get boolean property, returning false if a security manager prevents us from accessing system properties

        (incomplete) list of known system properties

        • "report_TESTING_pattern_in_standard_detectors" - default is false
        Returns:
        true if the property exists and is set to true
      • getBoolean

        public static boolean getBoolean​(java.lang.String name,
                                         boolean defaultValue)
      • getInteger

        @Deprecated
        public static java.lang.Integer getInteger​(java.lang.String arg0,
                                                   int arg1)
        Deprecated.
        Use getInt(String,int) instead
        Parameters:
        arg0 - property name
        arg1 - default value
        Returns:
        the int value (or arg1 if the property does not exist)
      • getInt

        public static int getInt​(java.lang.String name,
                                 int defaultValue)
        Parameters:
        name - property name
        defaultValue - default value
        Returns:
        the int value (or defaultValue if the property does not exist)
      • getOSDependentProperty

        public static java.lang.String getOSDependentProperty​(java.lang.String name)
        Parameters:
        name - property name
        Returns:
        string value (or null if the property does not exist)
      • getProperty

        public static java.lang.String getProperty​(java.lang.String name)
        Parameters:
        name - property name
        Returns:
        string value (or null if the property does not exist)
      • setProperty

        public static void setProperty​(java.lang.String name,
                                       java.lang.String value)
      • getProperty

        public static java.lang.String getProperty​(java.lang.String name,
                                                   java.lang.String defaultValue)
        Parameters:
        name - property name
        defaultValue - default value
        Returns:
        string value (or defaultValue if the property does not exist)
      • rewriteURLAccordingToProperties

        public static java.lang.String rewriteURLAccordingToProperties​(java.lang.String u)