Search in sources :

Example 6 with Prop

use of org.eweb4j.config.bean.Prop in project eweb4j-framework by laiweiwei.

the class Props method writeProp.

public static synchronized void writeProp(String propId, Map<String, String> data) throws IOException {
    if (propId == null)
        return;
    ConfigBean cb = (ConfigBean) SingleBeanCache.get(ConfigBean.class.getName());
    List<Prop> files = cb.getProperties().getFile();
    for (Prop f : files) {
        if (propId.equals(f.getId())) {
            Map<String, String> map = props.get(propId);
            if (map == null) {
                map = new Hashtable<String, String>();
                props.put(propId, map);
            }
            map.putAll(data);
            String filePath = ConfigConstant.CONFIG_BASE_PATH + f.getPath();
            writeProperties(filePath, data);
            break;
        }
    }
}
Also used : Prop(org.eweb4j.config.bean.Prop) ConfigBean(org.eweb4j.config.bean.ConfigBean)

Aggregations

Prop (org.eweb4j.config.bean.Prop)6 ConfigBean (org.eweb4j.config.bean.ConfigBean)4 I18N (org.eweb4j.config.bean.I18N)3 Locale (org.eweb4j.config.bean.Locale)3 Properties (org.eweb4j.config.bean.Properties)2 BufferedInputStream (java.io.BufferedInputStream)1 FileInputStream (java.io.FileInputStream)1 FileNotFoundException (java.io.FileNotFoundException)1 InputStream (java.io.InputStream)1 Hashtable (java.util.Hashtable)1 Entry (java.util.Map.Entry)1 Properties (java.util.Properties)1 Pattern (java.util.regex.Pattern)1 ActionXmlFile (org.eweb4j.config.bean.ActionXmlFile)1 ConfigIOC (org.eweb4j.config.bean.ConfigIOC)1 ConfigMVC (org.eweb4j.config.bean.ConfigMVC)1 ConfigORM (org.eweb4j.config.bean.ConfigORM)1 DBInfoXmlFiles (org.eweb4j.config.bean.DBInfoXmlFiles)1 Ddl (org.eweb4j.config.bean.Ddl)1 IOCXmlFiles (org.eweb4j.config.bean.IOCXmlFiles)1