Clover Coverage Report - Atlassian Mail
Coverage timestamp: Mon Sep 29 2008 21:26:36 CDT
9   41   2   9
0   31   0.22   1
1     2  
1    
 
 
  PropertiesLoader       Line # 13 9 2 90% 0.9
 
  (1)
 
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    * A simple util class to load properties related to atlassian-mail
12    */
 
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   
 
20  1 toggle 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    //JRA-11452: Copy System properties to potentially override settings from atlassian-mail.properties.
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    }