com.github.kunalk16.excel.model.factory.ExcelDataFiles Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lightExcelReader Show documentation
Show all versions of lightExcelReader Show documentation
A lightweight Java framework to read .xlsx excel files.
package com.github.kunalk16.excel.model.factory;
import com.github.kunalk16.excel.utils.string.StringUtils;
public enum ExcelDataFiles {
WORKBOOK_FILE("xl/workbook.xml"),
SHARED_STRINGS_FILE("xl/sharedStrings.xml"),
SHEET_FILE("xl/worksheets/sheet");
private static final String XML_EXTENSION = ".xml";
private final String fileName;
ExcelDataFiles(String fileName) {
this.fileName = fileName;
}
public String getFileName() {
return this.fileName;
}
public static ExcelDataFiles matchByName(String fileName) {
if (StringUtils.equals(WORKBOOK_FILE.fileName, fileName)) {
return WORKBOOK_FILE;
} else if (StringUtils.equals(SHARED_STRINGS_FILE.fileName, fileName)) {
return SHARED_STRINGS_FILE;
} else if (StringUtils.isNotEmpty(fileName)) {
if (StringUtils.startsWith(fileName, SHEET_FILE.fileName) && StringUtils.endsWith(fileName, XML_EXTENSION)) {
return SHEET_FILE;
}
}
return null;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy