import java.io.File;import java.io.FileInputStream;import java.io.FileNotFoundException;import java.io.FileOutputStream;import java.io.IOException;import java.io.InputStream;import java.io.OutputStream;import java.util.HashMap;import java.util.Map;import java.util.Map.Entry;import java.util.Properties;import java.util.Set;/** * 读取非设备销售条目的比例的配置文件 * @author xWX146107 * */public class PropertiesUtil { private static final String path ; private PropertiesUtil(){} static{ System.out.println(PropertiesUtil.class.getClassLoader().getResource("").getPath()); path = PropertiesUtil.class.getClassLoader().getResource("").getPath()+ "/quoteConstant.properties"; } /** * 读取配置文件的key的值 * @param key * @return */ public static String readData(String key){ InputStream is = null; Properties properties = new Properties(); try { is = new FileInputStream(new File(path)); properties.load(is); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); }finally{ if(is!=null){ try { is.close(); } catch (IOException e) { e.printStackTrace(); } } } return properties.getProperty(key); } /** * 读取配置文件的key的值 * @param key * @return */ public static MapreadAllData(){ InputStream is = null; Properties properties = new Properties(); Map map = new HashMap (); try { is = new FileInputStream(new File(path)); properties.load(is); Set