public static void loadProperties(String filename) {
    	InputStream in = null;
        ClassLoader threadContextClassLoader = Thread.currentThread().getContextClassLoader();
        properties = new Properties();
        if (threadContextClassLoader != null) {
        	in = threadContextClassLoader.getResourceAsStream(filename);
        }
        if (in == null) {
        	in = ConfigHelper.class.getResourceAsStream(filename);
            if (in == null) {
                log.warn("No properties file found in the classpath by filename " + filename);
            }
        } else {
            try {
                properties.load(in);
                log.info("Properties read " + properties);
            } catch (Exception e) {
                log.error("Error reading from " + filename, e);
            } finally {
                try {
                    in.close();
                } catch (IOException e) {
                    log.warn("IOException while closing InputStream: " + e.getMessage());
                }
            }
        }
    }
public static void loadProperties ( String filename ) { InputStream in = null ; ClassLoader threadContextClassLoader = Thread . currentThread ( ) . getContextClassLoader ( ) ; properties = new Properties ( ) ; if ( threadContextClassLoader != null ) { in = threadContextClassLoader . getResourceAsStream ( filename ) ; } if ( in == null ) { in = ConfigHelper . class . getResourceAsStream ( filename ) ; if ( in == null ) { log . warn ( "No properties file found in the classpath by filename " + filename ) ; } } else { try { properties . load ( in ) ; log . info ( "Properties read " + properties ) ; } catch ( Exception e ) { log . error ( "Error reading from " + filename , e ) ; } finally { try { in . close ( ) ; } catch ( IOException e ) { log . warn ( "IOException while closing InputStream: " + e . getMessage ( ) ) ; } } } }
根据指定的文件名称，从类路径中加载属性文件，构造Properties对象
@param filename 属性文件名称