private Workbook getWorkbook(final String fileName) throws IOException {
		if (workbooks.get(fileName) == null) {
			FileInputStream fiStream = new FileInputStream(new File(fileName));
			fis.add(fiStream);
			Workbook workbook = null;
			try {
				workbook = new HSSFWorkbook(fiStream);
			} catch (OfficeXmlFileException e) {
				fiStream.close();
				fiStream = new FileInputStream(new File(fileName));
				fis.add(fiStream);
				workbook = new XSSFWorkbook(fiStream);
			}
			workbooks.put(fileName, workbook);

		}

		return workbooks.get(fileName);
	}
private Workbook getWorkbook ( final String fileName ) throws IOException { if ( workbooks . get ( fileName ) == null ) { FileInputStream fiStream = new FileInputStream ( new File ( fileName ) ) ; fis . add ( fiStream ) ; Workbook workbook = null ; try { workbook = new HSSFWorkbook ( fiStream ) ; } catch ( OfficeXmlFileException e ) { fiStream . close ( ) ; fiStream = new FileInputStream ( new File ( fileName ) ) ; fis . add ( fiStream ) ; workbook = new XSSFWorkbook ( fiStream ) ; } workbooks . put ( fileName , workbook ) ; } return workbooks . get ( fileName ) ; }
Tries to load the workbook from the current cache. If it doesn't find it
it will load it from the disk. If it doesn't find it on the disk a
{@link IOException} will be thrown

@param fileName
the name of file
@return the workbook corresponding to this file
@throws IOException
if something goes wrong while reading the file