* это мой блок try, в котором я уже имел xlsx файл. Делаем в него операцию записи =========================== ================================================== ==================
FileInputStream fis = null;
Workbook workbook = null;
FileOutputStream fos = null;
try {
fis = new FileInputStream(ExcelConstants.TEMPLATE_EXCEL.getName());
workbook = new XSSFWorkbook(fis); //taking time to take file
Sheet templateSheet = workbook.getSheet(ExcelConstants.TEMPLATE_SHEET_NAME.getName());
if (qeiDetails != null) {
String sheetName =ExcelConstants.SHEET_NAME_PREFIX.getName()+qeiDetails.getQeiId();
try {
super.cloneSheet(templateSheet, sheetName);
} catch (Exception e) {
log.error("Error in downloadExcelByQei() :" + e.getStackTrace());
}
}
============================
String filePath = ExcelConstants.EXCEL_TEMP_DIR.getName();
fos = new FileOutputStream(filePath + fileName, false);
workbook.write(fos);
workbook.close();
file = new File(filePath + fileName);
boolean fileCreated = file.createNewFile();
log.info("Inside downloadExcelByQei:fileCreated:: " + fileCreated);
*emphasized text* } catch (Exception e) {
log.error("Error in downloadExcelByQei() :" + e.getMessage());
}
return file;
-----------------------------------------------------------------------------------------
-suggest me how can i reduce time to load file in workbook as it is taking time to download.***