com.github.kunalk16.excel.file.validation.ExcelFileFileValidator 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.file.validation;
import com.github.kunalk16.excel.utils.logger.ExcelReaderLogger;
import java.io.File;
public class ExcelFileFileValidator extends AbstractExcelFileValidator {
ExcelFileFileValidator(ExcelFileValidator nextExcelFileValidator) {
super(nextExcelFileValidator);
}
@Override
protected boolean validateFile(String filePath) {
File file = new File(filePath);
if (!file.exists()) {
ExcelReaderLogger.getInstance().severe("File does not exist!");
return false;
}
if (!file.isFile()) {
ExcelReaderLogger.getInstance().severe("Not a file!");
return false;
}
if (!file.canRead()) {
ExcelReaderLogger.getInstance().severe("Cannot read file!");
return false;
}
return true;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy