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