Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
package com.powerpanel.kso;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import org.apache.log4j.Logger;
public class AppConfig
{
private static final Logger LOGGER = Logger.getLogger(AppConfig.class);
private static Properties _properties;
private static Object _lock = new Object();
public static Properties loadProperties()
{
InputStream is = AppConfig.class.getClassLoader().getResourceAsStream("application.properties");
synchronized (_lock)
{
if (_properties == null)
{
_properties = new Properties();
try
{
_properties.load(is);
LOGGER.info("Properties loaded");
}
catch (IOException e)
{
LOGGER.info("Failed to load properties", e);
System.exit(1);
}
}
return _properties;
}
}
}