2018-09-12 java 读取ini文件
2018-09-12 本文已影响28人
Mylovesunshine
/**
* 读取ini文件
*
* @param path
*/
public static void readIniFile(String path) {
try {
Wini ini = new Wini(new File(path));
String taskName = ini.get("DCRWGL", "DCRWMC", String.class);
DCRWGLEntity dcrwglEntity = new DCRWGLEntity();
dcrwglEntity.setDCRWMC(taskName);
Log.i("task", taskName);
CacheManager.put(Const.DCRW, dcrwglEntity);
} catch (Exception e) {
e.printStackTrace();
}
}
//ini
implementation group: 'org.ini4j', name: 'ini4j', version: '0.5.4'
package com.zjugis.proofservice.mobile.proofsystem.persistence.entity;
/**
- 返回的ini文件
- autuor:yinxh
- date:2018/7/31.
*/
public class DCRWGLEntity {
private String DCRWMC;
private String DCRY;
private String DCDW;
private String DCRQ;
private String DCTBSL;
public String getDCRWMC() {
return DCRWMC;
}
public void setDCRWMC(String DCRWMC) {
this.DCRWMC = DCRWMC;
}
public String getDCRY() {
return DCRY;
}
public void setDCRY(String DCRY) {
this.DCRY = DCRY;
}
public String getDCDW() {
return DCDW;
}
public void setDCDW(String DCDW) {
this.DCDW = DCDW;
}
public String getDCRQ() {
return DCRQ;
}
public void setDCRQ(String DCRQ) {
this.DCRQ = DCRQ;
}
public String getDCTBSL() {
return DCTBSL;
}
public void setDCTBSL(String DCTBSL) {
this.DCTBSL = DCTBSL;
}
}