List of usage examples for org.apache.poi.ss.usermodel Workbook getFirstVisibleTab
int getFirstVisibleTab();
From source file:com.faizod.aem.component.core.servlets.datasources.impl.ExcelDatasourceParser.java
License:Apache License
@Override public boolean validate(InputStream inputStream) { if (inputStream == null) { return false; }/*from w ww . j a va 2s . c om*/ boolean valid = true; try { Workbook workbook = WorkbookFactory.create(inputStream); int firstVisibleTab = workbook.getFirstVisibleTab(); valid = firstVisibleTab >= 0; } catch (IOException e) { valid = false; } catch (InvalidFormatException e) { valid = false; } catch (EncryptedDocumentException e) { valid = false; } return valid; }