Class SuperGenerateExcelImpl

java.lang.Object
bld.generator.report.excel.impl.SuperGenerateExcelImpl
Direct Known Subclasses:
ScopeGenerateExcelImpl

public abstract class SuperGenerateExcelImpl extends Object
The Class SuperGenerateExcelImpl.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected List<DropDownCell>
    The list drop down.
    protected List<FunctionCell>
    The list function cell.
    protected Map<LayoutCell,org.apache.poi.ss.usermodel.CellStyle>
    The map cell header style.
    protected Map<LayoutCell,org.apache.poi.ss.usermodel.CellStyle>
    The map cell style.
    protected Map<String,InfoColumn>
    The map field column.
    protected Map<String,BaseSheet>
    The map sheet.
    protected Map<Integer,Integer>
    The map width column.
    protected org.apache.poi.ss.usermodel.CellStyle
    The merge calcolo cells.
    protected static final SimpleDateFormat
    The Constant SDF.
     
    protected ValueProps
    The value props.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Instantiates a new super generate excel impl.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    addComment(org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.Sheet sheet, org.apache.poi.ss.usermodel.Row row, org.apache.poi.ss.usermodel.Cell cellHeader, String commento)
    Adds the comment.
    protected void
    addDropDown(DropDownCell dropDownCell)
    Adds the drop down.
    protected String
    buildFunction(org.apache.poi.ss.usermodel.Sheet sheet, Integer indexRow, String function, RowStartEndType rowStartEndType)
    Builds the function.
    protected String
    buildFunction(org.apache.poi.ss.usermodel.Sheet sheet, Integer indexRow, String function, RowStartEndType rowStartEndType, boolean blockColumn, boolean blockRow)
    Builds the function.
    protected String
    buildFunction(org.apache.poi.ss.usermodel.Sheet sheet, Integer indexRow, String function, RowStartEndType rowStartEndType, ExcelFormulaAlias[] alias)
    Builds the function.
    protected org.apache.poi.ss.usermodel.CellStyle
    createCellStyle(org.apache.poi.ss.usermodel.Workbook workbook, ExcelCellLayout layout, SheetHeader sheetHeader, Integer indexRow)
    Creates the cell style.
    protected org.apache.poi.ss.usermodel.CellStyle
    createCellStyle(org.apache.poi.ss.usermodel.Workbook workbook, ExcelCellLayout layout, Integer indexRow)
    Creates the cell style.
    protected org.apache.poi.ss.usermodel.CellStyle
    createCellStyle(org.apache.poi.ss.usermodel.Workbook workbook, ExcelHeaderCellLayout layout)
    Creates the cell style.
    protected Integer
    createPivot(org.apache.poi.xssf.usermodel.XSSFSheet sheet, SheetData<?> sheetData, int firstRow, int firstColumn, int lastRow, int lastColumn, Integer indexRow)
    Creates the pivot.
    protected org.apache.poi.ss.usermodel.CellStyle
    dateCellStyle(org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.CellStyle cellStyle, String format)
    Date cell style.
    protected <T extends RowSheet>
    List<SheetHeader>
    generateHeaderSheetData(org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.Sheet sheet, SheetData<T> sheetData, Integer indexRow)
    Generate header sheet data.
    protected org.apache.poi.ss.usermodel.CellStyle
    getBorder(org.apache.poi.ss.usermodel.CellStyle cellStyle, ExcelBorder excelBorder)
    Gets the border.
    org.apache.poi.ss.usermodel.CellStyle
    getCellStyleHeader(org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.Sheet sheet, SheetComponent sheetComponent, org.apache.poi.ss.usermodel.Row rowHeader)
    Gets the cell style header.
    protected org.apache.poi.xssf.usermodel.XSSFColor
    getColor(byte... rgbColor)
    Gets the color.
    protected org.apache.poi.ss.usermodel.Font
    getFont(org.apache.poi.ss.usermodel.Workbook workbook, ExcelFont excelFont)
    Gets the font.
    protected List<SheetHeader>
    getListSheetHeader(Class<?> classRow, Object entity, org.apache.poi.ss.usermodel.Sheet sheet)
    Gets the list sheet header.
    protected <T extends RowSheet>
    int
    Gets the size super header.
    protected void
    manageDropDown(org.apache.poi.ss.usermodel.Sheet sheet, SheetHeader sheetHeader, int firstRow, int lastRow, int firstCol, int lastCol, Integer indexRow)
    Manage drop down.
    protected Object
    manageExcelImage(SheetHeader sheetHeader, Object value)
    Manage excel image.
    protected void
    mergeRow(org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.Sheet sheet, Integer indexRow, Map<Integer,MergeCell> mapMergeRow, int numColumn, org.apache.poi.ss.usermodel.FormulaEvaluator formulaEvaluator)
    Merge row.
    protected void
    mergeRowAndRemoveMap(org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.Sheet sheet, Integer indexRow, Map<Integer,MergeCell> mapMergeRow, int numColumn, org.apache.poi.ss.usermodel.FormulaEvaluator formulaEvaluator)
    Merge row and remove map.
    protected void
    runMergeCell(org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.Sheet sheet, MergeCell mergeCell, org.apache.poi.ss.usermodel.FormulaEvaluator formulaEvaluator)
    Run merge cell.
    protected void
    setCellFormula(org.apache.poi.ss.usermodel.Cell cell, org.apache.poi.ss.usermodel.CellStyle cellStyle, SheetHeader sheetHeader, Integer indexRow, org.apache.poi.ss.usermodel.Sheet sheet)
    Sets the cell formula.
    protected org.apache.poi.ss.usermodel.Cell
    setCellFormula(org.apache.poi.ss.usermodel.Sheet sheet, MergeCell mergeRow, Integer indexRow)
    Sets the cell formula.
    protected void
    setCellFormulaAndEvaluate(org.apache.poi.ss.usermodel.Sheet sheet, MergeCell mergeRow, Integer indexRow, org.apache.poi.ss.usermodel.FormulaEvaluator formulaEvaluator)
    Sets the cell formula excel.
    protected void
    setCellFormulaAndEvaluateCell(org.apache.poi.ss.usermodel.Cell cell, org.apache.poi.ss.usermodel.CellStyle cellStyle, SheetHeader sheetHeader, Integer indexRow, org.apache.poi.ss.usermodel.Sheet sheet, org.apache.poi.ss.usermodel.FormulaEvaluator formulaEvaluator)
    Sets the cell formula excel.
    protected void
    setCellStyleExcel(org.apache.poi.ss.usermodel.CellStyle cellStyle, org.apache.poi.ss.usermodel.Cell cell, LayoutCell layoutCell)
    Sets the cell style excel.
    protected void
    setCellSummary(ExcelSheetLayout excelSheetLayout, org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.Sheet sheet, SheetSummary sheetSummary, SheetHeader sheetHeader, org.apache.poi.ss.usermodel.Row row, Integer indexRow, org.apache.poi.ss.usermodel.FormulaEvaluator formulaEvaluator)
    Sets the cell summary.
    protected void
    setCellValueExcel(org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.Cell cell, org.apache.poi.ss.usermodel.CellStyle cellStyle, SheetHeader sheetHeader, Integer indexRow, org.apache.poi.ss.usermodel.Sheet sheet)
    Sets the cell value excel.
    protected void
    setCellValueExcel(org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.Sheet sheet, org.apache.poi.ss.usermodel.Cell cell, org.apache.poi.ss.usermodel.CellStyle cellStyle, SheetHeader sheetHeader, Integer indexRow, org.apache.poi.ss.usermodel.FormulaEvaluator formulaEvaluator)
    Sets the cell value excel.
    protected boolean
    setCellValueWillMerged(org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.CellStyle cellStyle, org.apache.poi.ss.usermodel.Cell cell, SheetHeader sheetHeader, Integer indexRow, org.apache.poi.ss.usermodel.Sheet sheet)
    Sets the cell value will merged.
    protected void
    setColumnWidth(org.apache.poi.ss.usermodel.Sheet sheet, Integer index, Integer width)
    Sets the column width.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • SDF

      protected static final SimpleDateFormat SDF
      The Constant SDF.
    • mergeCalcoloCells

      protected org.apache.poi.ss.usermodel.CellStyle mergeCalcoloCells
      The merge calcolo cells.
    • mapCellStyle

      protected Map<LayoutCell,org.apache.poi.ss.usermodel.CellStyle> mapCellStyle
      The map cell style.
    • mapCellHeaderStyle

      protected Map<LayoutCell,org.apache.poi.ss.usermodel.CellStyle> mapCellHeaderStyle
      The map cell header style.
    • mapFieldColumn

      protected Map<String,InfoColumn> mapFieldColumn
      The map field column.
    • mapWidthColumn

      protected Map<Integer,Integer> mapWidthColumn
      The map width column.
    • listFunctionCell

      protected List<FunctionCell> listFunctionCell
      The list function cell.
    • listDropDown

      protected List<DropDownCell> listDropDown
      The list drop down.
    • mapSheet

      protected Map<String,BaseSheet> mapSheet
      The map sheet.
    • sheetMapping

      protected SheetMappingSheet sheetMapping
    • valueProps

      @Autowired protected ValueProps valueProps
      The value props.
  • Constructor Details

    • SuperGenerateExcelImpl

      public SuperGenerateExcelImpl()
      Instantiates a new super generate excel impl.
  • Method Details

    • createCellStyle

      protected org.apache.poi.ss.usermodel.CellStyle createCellStyle(org.apache.poi.ss.usermodel.Workbook workbook, ExcelHeaderCellLayout layout)
      Creates the cell style.
      Parameters:
      workbook - the workbook
      layout - the layout
      Returns:
      the cell style
    • createCellStyle

      protected org.apache.poi.ss.usermodel.CellStyle createCellStyle(org.apache.poi.ss.usermodel.Workbook workbook, ExcelCellLayout layout, Integer indexRow) throws Exception
      Creates the cell style.
      Parameters:
      workbook - the workbook
      layout - the layout
      indexRow - the index row
      Returns:
      the cell style
      Throws:
      Exception - the exception
    • createCellStyle

      protected org.apache.poi.ss.usermodel.CellStyle createCellStyle(org.apache.poi.ss.usermodel.Workbook workbook, ExcelCellLayout layout, SheetHeader sheetHeader, Integer indexRow) throws Exception
      Creates the cell style.
      Parameters:
      workbook - the workbook
      layout - the layout
      sheetHeader - the sheet header
      indexRow - the index row
      Returns:
      the cell style
      Throws:
      Exception - the exception
    • getFont

      protected org.apache.poi.ss.usermodel.Font getFont(org.apache.poi.ss.usermodel.Workbook workbook, ExcelFont excelFont)
      Gets the font.
      Parameters:
      workbook - the workbook
      excelFont - the excel font
      Returns:
      the font
    • getColor

      protected org.apache.poi.xssf.usermodel.XSSFColor getColor(byte... rgbColor)
      Gets the color.
      Parameters:
      rgbColor - the rgb color
      Returns:
      the color
    • getBorder

      protected org.apache.poi.ss.usermodel.CellStyle getBorder(org.apache.poi.ss.usermodel.CellStyle cellStyle, ExcelBorder excelBorder)
      Gets the border.
      Parameters:
      cellStyle - the cell style
      excelBorder - the excel border
      Returns:
      the border
    • getListSheetHeader

      protected List<SheetHeader> getListSheetHeader(Class<?> classRow, Object entity, org.apache.poi.ss.usermodel.Sheet sheet) throws Exception
      Gets the list sheet header.
      Parameters:
      classRow - the class row
      entity - the entity
      sheet - the sheet
      Returns:
      the list sheet header
      Throws:
      Exception - the exception
    • setCellValueWillMerged

      protected boolean setCellValueWillMerged(org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.CellStyle cellStyle, org.apache.poi.ss.usermodel.Cell cell, SheetHeader sheetHeader, Integer indexRow, org.apache.poi.ss.usermodel.Sheet sheet) throws Exception
      Sets the cell value will merged.
      Parameters:
      workbook - the workbook
      cellStyle - the cell style
      cell - the cell
      sheetHeader - the sheet header
      indexRow - the index row
      sheet - the sheet
      Returns:
      true, if successful
      Throws:
      Exception - the exception
    • mergeRowAndRemoveMap

      protected void mergeRowAndRemoveMap(org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.Sheet sheet, Integer indexRow, Map<Integer,MergeCell> mapMergeRow, int numColumn, org.apache.poi.ss.usermodel.FormulaEvaluator formulaEvaluator) throws Exception
      Merge row and remove map.
      Parameters:
      workbook - the workbook
      sheet - the sheet
      indexRow - the index row
      mapMergeRow - the map merge row
      numColumn - the num column
      formulaEvaluator - the formula evaluator
      Throws:
      Exception - the exception
    • mergeRow

      protected void mergeRow(org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.Sheet sheet, Integer indexRow, Map<Integer,MergeCell> mapMergeRow, int numColumn, org.apache.poi.ss.usermodel.FormulaEvaluator formulaEvaluator) throws Exception
      Merge row.
      Parameters:
      workbook - the workbook
      sheet - the sheet
      indexRow - the index row
      mapMergeRow - the map merge row
      numColumn - the num column
      formulaEvaluator - the formula evaluator
      Throws:
      Exception - the exception
    • runMergeCell

      protected void runMergeCell(org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.Sheet sheet, MergeCell mergeCell, org.apache.poi.ss.usermodel.FormulaEvaluator formulaEvaluator) throws Exception
      Run merge cell.
      Parameters:
      workbook - the workbook
      sheet - the sheet
      mergeCell - the merge cell
      formulaEvaluator - the formula evaluator
      Throws:
      Exception - the exception
    • addComment

      protected void addComment(org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.Sheet sheet, org.apache.poi.ss.usermodel.Row row, org.apache.poi.ss.usermodel.Cell cellHeader, String commento)
      Adds the comment.
      Parameters:
      workbook - the workbook
      sheet - the sheet
      row - the row
      cellHeader - the cell header
      commento - the commento
    • setCellSummary

      protected void setCellSummary(ExcelSheetLayout excelSheetLayout, org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.Sheet sheet, SheetSummary sheetSummary, SheetHeader sheetHeader, org.apache.poi.ss.usermodel.Row row, Integer indexRow, org.apache.poi.ss.usermodel.FormulaEvaluator formulaEvaluator) throws Exception
      Sets the cell summary.
      Parameters:
      excelSheetLayout - the excel sheet layout
      workbook - the workbook
      sheet - the sheet
      sheetSummary - the sheet summary
      sheetHeader - the sheet header
      row - the row
      indexRow - the index row
      formulaEvaluator - the formula evaluator
      Throws:
      Exception - the exception
    • setCellValueExcel

      protected void setCellValueExcel(org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.Sheet sheet, org.apache.poi.ss.usermodel.Cell cell, org.apache.poi.ss.usermodel.CellStyle cellStyle, SheetHeader sheetHeader, Integer indexRow, org.apache.poi.ss.usermodel.FormulaEvaluator formulaEvaluator) throws Exception
      Sets the cell value excel.
      Parameters:
      workbook - the workbook
      sheet - the sheet
      cell - the cell
      cellStyle - the cell style
      sheetHeader - the sheet header
      indexRow - the index row
      formulaEvaluator - the formula evaluator
      Throws:
      Exception - the exception
    • setCellFormulaAndEvaluateCell

      protected void setCellFormulaAndEvaluateCell(org.apache.poi.ss.usermodel.Cell cell, org.apache.poi.ss.usermodel.CellStyle cellStyle, SheetHeader sheetHeader, Integer indexRow, org.apache.poi.ss.usermodel.Sheet sheet, org.apache.poi.ss.usermodel.FormulaEvaluator formulaEvaluator) throws Exception
      Sets the cell formula excel.
      Parameters:
      cell - the cell
      cellStyle - the cell style
      sheetHeader - the sheet header
      indexRow - the index row
      sheet - the sheet
      formulaEvaluator - the formula evaluator
      Throws:
      Exception - the exception
    • setCellFormula

      protected void setCellFormula(org.apache.poi.ss.usermodel.Cell cell, org.apache.poi.ss.usermodel.CellStyle cellStyle, SheetHeader sheetHeader, Integer indexRow, org.apache.poi.ss.usermodel.Sheet sheet) throws Exception
      Sets the cell formula.
      Parameters:
      cell - the cell
      cellStyle - the cell style
      sheetHeader - the sheet header
      indexRow - the index row
      sheet - the sheet
      Throws:
      Exception - the exception
    • buildFunction

      protected String buildFunction(org.apache.poi.ss.usermodel.Sheet sheet, Integer indexRow, String function, RowStartEndType rowStartEndType, ExcelFormulaAlias[] alias) throws Exception
      Builds the function.
      Parameters:
      sheet - the sheet
      indexRow - the index row
      function - the function
      rowStartEndType - the row start end type
      alias - the alias
      Returns:
      the string
      Throws:
      Exception - the exception
    • buildFunction

      protected String buildFunction(org.apache.poi.ss.usermodel.Sheet sheet, Integer indexRow, String function, RowStartEndType rowStartEndType, boolean blockColumn, boolean blockRow) throws Exception
      Builds the function.
      Parameters:
      sheet - the sheet
      indexRow - the index row
      function - the function
      rowStartEndType - the row start end type
      blockColumn - the dollar
      blockRow - the block row
      Returns:
      the string
      Throws:
      Exception - the exception
    • buildFunction

      protected String buildFunction(org.apache.poi.ss.usermodel.Sheet sheet, Integer indexRow, String function, RowStartEndType rowStartEndType) throws Exception
      Builds the function.
      Parameters:
      sheet - the sheet
      indexRow - the index row
      function - the function
      rowStartEndType - the row start end type
      Returns:
      the string
      Throws:
      Exception - the exception
    • setCellFormulaAndEvaluate

      protected void setCellFormulaAndEvaluate(org.apache.poi.ss.usermodel.Sheet sheet, MergeCell mergeRow, Integer indexRow, org.apache.poi.ss.usermodel.FormulaEvaluator formulaEvaluator) throws Exception
      Sets the cell formula excel.
      Parameters:
      sheet - the sheet
      mergeRow - the merge row
      indexRow - the index row
      formulaEvaluator - the formula evaluator
      Throws:
      Exception - the exception
    • setCellFormula

      protected org.apache.poi.ss.usermodel.Cell setCellFormula(org.apache.poi.ss.usermodel.Sheet sheet, MergeCell mergeRow, Integer indexRow) throws Exception
      Sets the cell formula.
      Parameters:
      sheet - the sheet
      mergeRow - the merge row
      indexRow - the index row
      Returns:
      the cell
      Throws:
      Exception - the exception
    • setCellValueExcel

      protected void setCellValueExcel(org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.Cell cell, org.apache.poi.ss.usermodel.CellStyle cellStyle, SheetHeader sheetHeader, Integer indexRow, org.apache.poi.ss.usermodel.Sheet sheet) throws Exception
      Sets the cell value excel.
      Parameters:
      workbook - the workbook
      cell - the cell
      cellStyle - the cell style
      sheetHeader - the sheet header
      indexRow - the index row
      sheet - the sheet
      Throws:
      Exception - the exception
    • dateCellStyle

      protected org.apache.poi.ss.usermodel.CellStyle dateCellStyle(org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.CellStyle cellStyle, String format) throws Exception
      Date cell style.
      Parameters:
      workbook - the workbook
      cellStyle - the cell style
      format - the format
      Returns:
      the cell style
      Throws:
      Exception - the exception
    • setCellStyleExcel

      protected void setCellStyleExcel(org.apache.poi.ss.usermodel.CellStyle cellStyle, org.apache.poi.ss.usermodel.Cell cell, LayoutCell layoutCell)
      Sets the cell style excel.
      Parameters:
      cellStyle - the cell style
      cell - the cell
      layoutCell - the layout cell
    • getCellStyleHeader

      public org.apache.poi.ss.usermodel.CellStyle getCellStyleHeader(org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.Sheet sheet, SheetComponent sheetComponent, org.apache.poi.ss.usermodel.Row rowHeader) throws Exception
      Gets the cell style header.
      Parameters:
      workbook - the workbook
      sheet - the sheet
      sheetComponent - the sheet component
      rowHeader - the row header
      Returns:
      the cell style header
      Throws:
      Exception - the exception
    • generateHeaderSheetData

      protected <T extends RowSheet> List<SheetHeader> generateHeaderSheetData(org.apache.poi.ss.usermodel.Workbook workbook, org.apache.poi.ss.usermodel.Sheet sheet, SheetData<T> sheetData, Integer indexRow) throws Exception
      Generate header sheet data.
      Type Parameters:
      T - the generic type
      Parameters:
      workbook - the workbook
      sheet - the sheet
      sheetData - the sheet data
      indexRow - the index row
      Returns:
      the list
      Throws:
      Exception - the exception
    • getSizeSuperHeader

      protected <T extends RowSheet> int getSizeSuperHeader(SheetData<T> sheetData)
      Gets the size super header.
      Type Parameters:
      T - the generic type
      Parameters:
      sheetData - the sheet data
      Returns:
      the size super header
    • setColumnWidth

      protected void setColumnWidth(org.apache.poi.ss.usermodel.Sheet sheet, Integer index, Integer width) throws Exception
      Sets the column width.
      Parameters:
      sheet - the sheet
      index - the index column
      width - the width
      Throws:
      Exception - the exception
    • createPivot

      protected Integer createPivot(org.apache.poi.xssf.usermodel.XSSFSheet sheet, SheetData<?> sheetData, int firstRow, int firstColumn, int lastRow, int lastColumn, Integer indexRow)
      Creates the pivot.
      Parameters:
      sheet - the sheet
      sheetData - the sheet data
      firstRow - the first row
      firstColumn - the first column
      lastRow - the last row
      lastColumn - the last column
      indexRow - the index row
      Returns:
      the integer
    • manageDropDown

      protected void manageDropDown(org.apache.poi.ss.usermodel.Sheet sheet, SheetHeader sheetHeader, int firstRow, int lastRow, int firstCol, int lastCol, Integer indexRow)
      Manage drop down.
      Parameters:
      sheet - the sheet
      sheetHeader - the sheet header
      firstRow - the first row
      lastRow - the last row
      firstCol - the first col
      lastCol - the last col
    • addDropDown

      protected void addDropDown(DropDownCell dropDownCell) throws Exception
      Adds the drop down.
      Parameters:
      dropDownCell - the drop down cell
      Throws:
      Exception - the exception
    • manageExcelImage

      protected Object manageExcelImage(SheetHeader sheetHeader, Object value) throws Exception, FileNotFoundException, IOException
      Manage excel image.
      Parameters:
      sheetHeader - the sheet header
      value - the value
      Returns:
      the object
      Throws:
      Exception - the exception
      FileNotFoundException - the file not found exception
      IOException - Signals that an I/O exception has occurred.