Workbook workbook = new HSSFWorkbook();
//
//Other stuff here
FileOutputStream outputStream = new FileOutputStream(location);
workbook.write(outputStream);
outputStream.close();
第一次这段代码工作正常,但我需要在用户请求时覆盖同名文件 但是当我的程序再次进入此循环时,会出现以下错误:
The requested operation cannot be performed on a file with a user-mapped section open
当我尝试手动打开文件时,它会弹出一个显示文件被锁定的文件。