/**
* 复制指定的模版
*
* @param fromexcel 要复制的模版路径
* @param newexcel 复制到指定的Excel路径
*/
public void copyExcel(String fromexcel, String newexcel) {
XSSFWorkbook wb = null;
FileInputStream fis = null;
FileOutputStream fos = null;
try {
fis = new FileInputStream(fromexcel);
fos = new FileOutputStream(newexcel);
wb = new XSSFWorkbook(fis);
wb.write(fos);
fis.close();
fos.close();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (fis != null)
fis.close();
if (fos != null)
fos.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
复制Excel模版到指定目录下
最新推荐文章于 2023-09-15 11:02:33 发布