This commit is contained in:
Looly
2020-08-29 11:57:31 +08:00
parent 68ad664fec
commit dd1f89b555
3 changed files with 12 additions and 7 deletions

View File

@@ -289,7 +289,7 @@ public class ExcelUtil {
*/
public static ExcelReader getReader(InputStream bookStream, int sheetIndex) {
try {
return new ExcelReader(bookStream, sheetIndex, true);
return new ExcelReader(bookStream, sheetIndex);
} catch (NoClassDefFoundError e) {
throw new DependencyException(ObjectUtil.defaultIfNull(e.getCause(), e), PoiChecker.NO_POI_ERROR_MSG);
}
@@ -303,10 +303,12 @@ public class ExcelUtil {
* @param closeAfterRead 读取结束是否关闭流
* @return {@link ExcelReader}
* @since 4.0.3
* @deprecated 使用完毕无论是否closeAfterReadpoi会关闭流此参数无意义。
*/
@Deprecated
public static ExcelReader getReader(InputStream bookStream, int sheetIndex, boolean closeAfterRead) {
try {
return new ExcelReader(bookStream, sheetIndex, closeAfterRead);
return new ExcelReader(bookStream, sheetIndex);
} catch (NoClassDefFoundError e) {
throw new DependencyException(ObjectUtil.defaultIfNull(e.getCause(), e), PoiChecker.NO_POI_ERROR_MSG);
}
@@ -322,7 +324,7 @@ public class ExcelUtil {
*/
public static ExcelReader getReader(InputStream bookStream, String sheetName) {
try {
return new ExcelReader(bookStream, sheetName, true);
return new ExcelReader(bookStream, sheetName);
} catch (NoClassDefFoundError e) {
throw new DependencyException(ObjectUtil.defaultIfNull(e.getCause(), e), PoiChecker.NO_POI_ERROR_MSG);
}
@@ -335,10 +337,12 @@ public class ExcelUtil {
* @param sheetName sheet名第一个默认是sheet1
* @param closeAfterRead 读取结束是否关闭流
* @return {@link ExcelReader}
* @deprecated 使用完毕无论是否closeAfterReadpoi会关闭流此参数无意义。
*/
@Deprecated
public static ExcelReader getReader(InputStream bookStream, String sheetName, boolean closeAfterRead) {
try {
return new ExcelReader(bookStream, sheetName, closeAfterRead);
return new ExcelReader(bookStream, sheetName);
} catch (NoClassDefFoundError e) {
throw new DependencyException(ObjectUtil.defaultIfNull(e.getCause(), e), PoiChecker.NO_POI_ERROR_MSG);
}