PropertiesUtil

 

import java.io.InputStream;

import java.util.Properties;

public class PropertiesUtil {

private static Properties props = null;

        

         private synchronized static void loadProperties(){

                   props = new Properties();

                   try{

                            InputStream input = PropertiesUtil.class.getResourceAsStream("/com/sms/url.properties");

                            props.load(input);

                   }catch (Exception e) {

                            e.printStackTrace();

                   }

         }

        

         public static String getProperty(String propName){

                   loadProperties();

                   return props.getProperty(propName);

         }

        

}

posted on 2019-02-19 14:15  我是司  阅读(295)  评论(0编辑  收藏  举报

导航