我正在使用Apache POI编写Excel文件。该文件将写入/ opt / lampp / htdocs / {projectName} / {taskFolder}。这是我的代码......
String xlsxOutput = taskFolder + File.separator + "results_pe.xlsx";
XSSFWorkbook wb = new XSSFWorkbook();
XSSFSheet sheet = wb.createSheet("Phrase Extraction");
XSSFRow row = sheet.createRow(0);
Cell cell = row.createCell(0);
cell.setCellValue("Task: " + taskName + "_" + taskCreationTime);
row = sheet.createRow(1);
cell = row.createCell(0);
cell.setCellValue("Phrase: " + phrase);
-----------------
-----------------
FileOutputStream fileOutputStream = new FileOutputStream(xlsxOutput);
wb.write(fileOutputStream);
fileOutputStream.close();
我在以下方面得到错误:
FileOutputStream fileOutputStream = new FileOutputStream(xlsxOutput);
我为该文件夹尝试了chmod -R 777。不行。我尝试了我的登录和组甚至root。仍然不起作用。我斗智斗勇。帮助将不胜感激。