Package edu.umd.cs.findbugs
Class SystemProperties
- java.lang.Object
-
- edu.umd.cs.findbugs.SystemProperties
-
public class SystemProperties extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static booleanASSERTIONS_ENABLED(package private) static java.lang.StringOS_NAMEprivate static java.util.Propertiespropertiesstatic booleanRUNNING_AS_IDE_PLUGINstatic booleanRUNNING_IN_ECLIPSEprivate static java.lang.StringURL_REWRITE_FORMATprivate static java.util.regex.PatternURL_REWRITE_PATTERNprivate static java.lang.StringURL_REWRITE_PATTERN_STRING
-
Constructor Summary
Constructors Constructor Description SystemProperties()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static java.util.PropertiesgetAllProperties()static booleangetBoolean(java.lang.String name)Get boolean property, returning false if a security manager prevents us from accessing system propertiesstatic booleangetBoolean(java.lang.String name, boolean defaultValue)static intgetInt(java.lang.String name, int defaultValue)static java.lang.IntegergetInteger(java.lang.String arg0, int arg1)Deprecated.UsegetInt(String,int)insteadstatic java.util.PropertiesgetLocalProperties()static java.lang.StringgetOSDependentProperty(java.lang.String name)static java.lang.StringgetProperty(java.lang.String name)static java.lang.StringgetProperty(java.lang.String name, java.lang.String defaultValue)private static voidloadPropertiesFromConfigFile()static voidloadPropertiesFromURL(java.net.URL url)This method is public to allow clients to set system properties via anyURLstatic voidremoveProperty(java.lang.String name)static java.lang.StringrewriteURLAccordingToProperties(java.lang.String u)static voidsetProperty(java.lang.String name, java.lang.String value)private static booleantoBoolean(java.lang.String name)
-
-
-
Field Detail
-
properties
private static java.util.Properties properties
-
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
-
OS_NAME
static final java.lang.String OS_NAME
-
URL_REWRITE_PATTERN_STRING
private static final java.lang.String URL_REWRITE_PATTERN_STRING
-
URL_REWRITE_FORMAT
private static final java.lang.String URL_REWRITE_FORMAT
-
URL_REWRITE_PATTERN
private static final java.util.regex.Pattern URL_REWRITE_PATTERN
-
-
Method Detail
-
loadPropertiesFromConfigFile
private static void loadPropertiesFromConfigFile()
-
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 anyURL- 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)
-
toBoolean
private static boolean toBoolean(java.lang.String name)
-
getInteger
@Deprecated public static java.lang.Integer getInteger(java.lang.String arg0, int arg1)Deprecated.UsegetInt(String,int)instead- Parameters:
arg0- property namearg1- 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 namedefaultValue- 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)
-
removeProperty
public static void removeProperty(java.lang.String name)
-
getProperty
public static java.lang.String getProperty(java.lang.String name, java.lang.String defaultValue)- Parameters:
name- property namedefaultValue- default value- Returns:
- string value (or defaultValue if the property does not exist)
-
rewriteURLAccordingToProperties
public static java.lang.String rewriteURLAccordingToProperties(java.lang.String u)
-
-