FileNotFoundException权限被拒绝错误

时间:2014-11-10 15:11:25

标签: java permissions filenotfoundexception denied

我正在使用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。仍然不起作用。我斗智斗勇。帮助将不胜感激。

0 个答案:

没有答案