I am trying to access an excel file from my res/raw folder, and I know that you can only really do this using an InputStream; however, the XSSFWorkbook commands in Apache POI only take FileInputStreams and not InputStreams: is there any way to do this? I've tried using the following code but go this error: java.lang.NullPointerException: Attempt to invoke virtual method 'java.net.URI java.net.URL.toURI()' on a null object reference
Here is the code I've tried using:
URL ins = this.getClass().getResource("ncaa.xlsx");
FileInputStream file = new FileInputStream(new File(ins.toURI()));
XSSFWorkbook workbook = new XSSFWorkbook(file);
ncaa.xlsx-insisnull. So before you think about anything else, you should get that part working.