I am currently writing a spring boot program that should populate an XLSX template with data and am trying to read the template from inside the project. My directory structure is as follows:
I am now trying to access the file using the following code:
try {
InputStream fis = this.getClass().getResourceAsStream("xlstemplates/billingReview.xlsx");
XSSFWorkbook billingReviewTemplate = new XSSFWorkbook(fis);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
Unfortunately I have yet to find a way to read the xlsx file into an InputStream. It always comes back null. Anyone have any pointers on how I can reference that file that is included in the project?