根据文件类型写入文件;参数方法一目了然
public String writerFile(String fileType, String text) throws IOException,
IllegalAccessException {
String path = jsonPath(fileType);
FileOutputStream fos = null;
Writer out = null;
try {
File f = new File(path);
if (!f.exists()) {
f.createNewFile();
}
fos = new FileOutputStream(f, false);
out = new OutputStreamWriter(fos, "UTF-8");
out.write(text);
} catch (IOException e) {
e.printStackTrace();
return SysEvnVariable.FAILURE;
} finally {
out.flush();
out.close();
fos.close();
}
return SysEvnVariable.SUCCESS;
}