请问如何读取properties文件中的全部内容

解决方案 »

  1.   

    public static List getString() {
    List list = new ArrayList();
    HashMap[] map = new HashMap[1000];
    RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
    int i = 0;
    Enumeration<String> props = RESOURCE_BUNDLE.getKeys();
    while (props.hasMoreElements()) {
    map[i] = new HashMap();
    String key = props.nextElement();
    String value = RESOURCE_BUNDLE.getString(key);
    map[i].put("key", key);
    map[i].put("value", value);
    list.add(i, map[i]);
    i++;
    }
    return list;
    }