將文件中的內容轉化爲數組
TXT文件的內容
88782127,88782542,88781234
String[] extArray=null;
//讀取txt文件並解析成數組
String extFilePath = "\\doc\\ext.txt"; //文件路徑
String extPath = Struts2Utils.getSession().getServletContext().getRealPath(extFilePath);
File file = new File(extPath);
String extStr=FileUtils.txt2String(file);
if(!"".equals(extStr)){
extArray = extStr.split(",");
}