POI读取Word文件之后,文件一直被占用,无法删除
使用poi读取word文件之后,文件就无法删除,一直正在使用
在操作完word文件之后也关闭了流,并在操作完成之后删除源文件,代码看着好像是没有问题
FileOutputStream out = null;
File tmpFile = null;
try {
String tmpFilePath = "tmp.docx";
tmpFile = new File(tmpFilePath);
XWPFDocument doc = new XWPFDocument(POIXMLDocument.openPackage(tmpFilePath));
// 。。。读取并操作doc,并保存到新的word中
String newFilePath= "newFile.docx";
out = new FileOutputStream(newFilePath);
File newFile=