byte[] hssSheetBytes = null;
if (xlsx) {
System.out.println("hey we are here");
ByteArrayOutputStream bout = new ByteArrayOutputStream();
byte[] workbookBytes = bout.toByteArray();
File tempXlsxFile = File.createTempFile("XLSX", ".xlsx");
File tempXlsFile = File.createTempFile("XLS", ".xls");
FileOutputStream fos = new FileOutputStream(tempXlsxFile);
fos.write(workbookBytes);
OfficeManager officeManager = new DefaultOfficeManagerConfiguration().buildOfficeManager();
officeManager.start();
OfficeDocumentConverter converter = new OfficeDocumentConverter(officeManager);
converter.convert(tempXlsxFile, tempXlsFile);
officeManager.stop();
// Desktop.getDesktop().open(tempXlsxFile);
// Desktop.getDesktop().open(tempXlsFile);
System.out.println("hey we are still here yay!");
fos.close();
byte[] convertedXlsFileBytes = FileUtils.readFileToByteArray(tempXlsFile);
hssSheetBytes = new byte[convertedXlsFileBytes.length];
System.arraycopy(convertedXlsFileBytes, 0, hssSheetBytes, 0, convertedXlsFileBytes.length);