ch.systemsx.cisd.openbis.dss.generic.shared.utils
Class ExcelFileReader
java.lang.Object
ch.systemsx.cisd.openbis.dss.generic.shared.utils.ExcelFileReader
public class ExcelFileReader
- extends java.lang.Object
Reader of tabular data from excel files.
Constructor Summary |
ExcelFileReader(org.apache.poi.ss.usermodel.Workbook workbook,
boolean ignoreComments)
|
Method Summary |
static org.apache.poi.ss.usermodel.Workbook |
getExcelWorkbook(java.io.File file)
|
static boolean |
isExcelFile(java.io.File file)
Uses file extension to figure out if given file is supported Excel file. |
static void |
main(java.lang.String[] args)
|
java.util.List<java.lang.String[]> |
readLines()
|
java.util.List<java.lang.String[]> |
readLines(int sheetIndex)
|
java.util.List<java.lang.String[]> |
readLines(java.lang.String sheetName)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ExcelFileReader
public ExcelFileReader(org.apache.poi.ss.usermodel.Workbook workbook,
boolean ignoreComments)
readLines
public java.util.List<java.lang.String[]> readLines()
throws java.io.IOException
- Throws:
java.io.IOException
readLines
public java.util.List<java.lang.String[]> readLines(int sheetIndex)
throws java.io.IOException
- Throws:
java.io.IOException
readLines
public java.util.List<java.lang.String[]> readLines(java.lang.String sheetName)
throws java.io.IOException
- Throws:
java.io.IOException
isExcelFile
public static boolean isExcelFile(java.io.File file)
- Uses file extension to figure out if given file is supported Excel file.
- Returns:
true
if the file is an XSL or XLSX Excel file
getExcelWorkbook
public static org.apache.poi.ss.usermodel.Workbook getExcelWorkbook(java.io.File file)
throws java.io.IOException,
java.lang.IllegalArgumentException
- Returns:
Workbook
of an Excel file
- Throws:
java.io.IOException
- if an I/O problem occurs
java.lang.IllegalArgumentException
- if the file is a format that is not supported
main
public static void main(java.lang.String[] args)
throws java.lang.Exception
- Throws:
java.lang.Exception