code: public static Workbook getWorkbook(String filename, InputStream stream) 
          throws IOException
      {
          Workbook ret = null;
          String lowerFilename = filename.toLowerCase();
          if(lowerFilename.endsWith("."+CommonFiles.XLS_EXT))
          {
              ret = XlsWorkbook.getWorkbook(stream);
          }
          else if(lowerFilename.endsWith("."+CommonFiles.XLSX_EXT))
          {
              XlsxWorkbook.initJaxbContexts();
              ret = XlsxWorkbook.getWorkbook(stream);
          }
          return ret;
      }
docs: Returns an existing workbook object.
  @param filename The filename of the workbook
  @param stream The input stream for the workbook
  @return The existing workbook object
  @throws IOException if the file cannot be read