Class PropertyBundle


  • public class PropertyBundle
    extends java.lang.Object
    Author:
    pugh
    • Constructor Detail

      • PropertyBundle

        public PropertyBundle()
      • PropertyBundle

        public PropertyBundle​(java.util.Properties properties)
    • Method Detail

      • getProperties

        public java.util.Properties getProperties()
      • loadPropertiesFromString

        public void loadPropertiesFromString​(java.lang.String contents)
      • loadPropertiesFromURL

        public void loadPropertiesFromURL​(java.net.URL url)
      • loadProperties

        public void loadProperties​(java.util.Properties properties)
      • getBoolean

        public boolean getBoolean​(java.lang.String name)
        Get boolean property, returning false if a security manager prevents us from accessing system properties
        Returns:
        true if the property exists and is set to true
      • getBoolean

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

        public 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 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 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 void setProperty​(java.lang.String name,
                                java.lang.String value)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getProperty

        public 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 java.lang.String rewriteURLAccordingToProperties​(java.lang.String u)