| 1 |
|
package com.atlassian.mail.config; |
| 2 |
|
|
| 3 |
|
import com.atlassian.core.util.ClassLoaderUtils; |
| 4 |
|
import org.apache.log4j.Category; |
| 5 |
|
|
| 6 |
|
import java.io.IOException; |
| 7 |
|
import java.io.InputStream; |
| 8 |
|
import java.util.Properties; |
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
|
|
|
| 90% |
Uncovered Elements: 1 (10) |
Complexity: 2 |
Complexity Density: 0.22 |
|
| 13 |
|
public class PropertiesLoader |
| 14 |
|
{ |
| 15 |
|
private static final Category log = Category.getInstance(PropertiesLoader.class); |
| 16 |
|
|
| 17 |
|
public static final String MAIL_PROPERTIES_FILE = "atlassian-mail.properties"; |
| 18 |
|
public static Properties ATLASSIAN_MAIL_PROPERTIES; |
| 19 |
|
|
|
|
|
| 88.9% |
Uncovered Elements: 1 (9) |
Complexity: 2 |
Complexity Density: 0.22 |
|
| 20 |
1
|
static... |
| 21 |
|
{ |
| 22 |
1
|
InputStream is = ClassLoaderUtils.getResourceAsStream(MAIL_PROPERTIES_FILE, PropertiesLoader.class); |
| 23 |
1
|
ATLASSIAN_MAIL_PROPERTIES = new Properties(); |
| 24 |
1
|
try |
| 25 |
|
{ |
| 26 |
1
|
ATLASSIAN_MAIL_PROPERTIES.load(is); |
| 27 |
1
|
log.debug(ATLASSIAN_MAIL_PROPERTIES); |
| 28 |
|
|
| 29 |
1
|
Properties systemProperties = System.getProperties(); |
| 30 |
1
|
synchronized(systemProperties) |
| 31 |
|
{ |
| 32 |
1
|
ATLASSIAN_MAIL_PROPERTIES.putAll(systemProperties); |
| 33 |
|
} |
| 34 |
|
|
| 35 |
|
} |
| 36 |
|
catch (IOException e) |
| 37 |
|
{ |
| 38 |
0
|
log.error("Unable to load atlassian mail properties from file: " + MAIL_PROPERTIES_FILE, e); |
| 39 |
|
} |
| 40 |
|
} |
| 41 |
|
} |