setting static variable from properties file java
<p>I need to use set some global variables which would be used by a few classes.</p>

<p>i'm having trouble assigning static variables from a properties files.</p>

<p>How i want to call the variables is something like this: String url = WebdriverConfiguration.getBaseUrl();</p>

<pre><code>public class WebDriverConfiguration
{
    private static Properties testProperties;
    private static String instaceUrl;

    testProperties = loadProperties();


    public static final String DEFAULT_BASEURL = testProperties.getProperty("confluence.base.url","");
    private static final int DEFAULT_HTTP_PORT = 8080;
    private static final String DEFAULT_CONTEXT_PATH = "/";
    public static final String TEST_SPACE_KEY = "SMOKE";
    public static final String TEST_PAGE = "XXX";

    private static final String BASE_URL = System.getProperty("baseurl", DEFAULT_BASEURL);


    public static String getBaseUrl()
    {
      return BASE_URL;

    }



    private Properties loadProperties() throws IOException
{
    InputStream testPropertiesInput = getClass().getClassLoader().getResourceAsStream("webtester.properties");
    Properties testProperties = new Properties();

    if (null != testPropertiesInput)
    {
        try
        {
            testProperties.load(testPropertiesInput);
        }
        finally
        {
            IOUtils.closeQuietly(testPropertiesInput);
        }
    }
    return testProperties;
}


   }
</code></pre>
