mirror of
https://gitee.com/dromara/hutool.git
synced 2025-05-03 20:27:58 +08:00
add contenttype
This commit is contained in:
parent
80e0bbbbc1
commit
7c38e496f4
@ -3,7 +3,7 @@
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
|
||||
# 5.6.7 (2021-06-07)
|
||||
# 5.6.7 (2021-06-08)
|
||||
|
||||
### 🐣新特性
|
||||
* 【core 】 CharSequenceUtil增加join重载(issue#I3TFJ5@Gitee)
|
||||
@ -13,6 +13,7 @@
|
||||
* 【core 】 CsvConfig的setXXX返回this(issue#I3UIQF@Gitee)
|
||||
* 【all 】 增加jmh基准测试
|
||||
* 【core 】 增加StreamUtil和CollectorUtil
|
||||
* 【poi 】 增加content-type(pr#1639@Github)
|
||||
|
||||
### 🐞Bug修复
|
||||
* 【core 】 修复FileUtil.normalize去掉末尾空格问题(issue#1603@Github)
|
||||
|
@ -21,21 +21,21 @@ import java.io.InputStream;
|
||||
* Excel工具类,不建议直接使用index直接操作sheet,在wps/excel中sheet显示顺序与index无关,还有隐藏sheet
|
||||
*
|
||||
* @author Looly
|
||||
*
|
||||
*/
|
||||
public class ExcelUtil {
|
||||
|
||||
/**
|
||||
* xlx的ContentType
|
||||
*/
|
||||
public static final String XLS_CONTENT_TYPE = "application/vnd.ms-excel;charset=utf-8";
|
||||
public static final String XLS_CONTENT_TYPE = "application/vnd.ms-excel";
|
||||
|
||||
/**
|
||||
* xlsx的ContentType
|
||||
*/
|
||||
public static final String XLSX_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8";
|
||||
public static final String XLSX_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
|
||||
|
||||
// ------------------------------------------------------------------------------------ Read by Sax start
|
||||
|
||||
/**
|
||||
* 通过Sax方式读取Excel,同时支持03和07格式
|
||||
*
|
||||
@ -230,6 +230,7 @@ public class ExcelUtil {
|
||||
// ------------------------------------------------------------------------------------ Read by Sax end
|
||||
|
||||
// ------------------------------------------------------------------------------------------------ getReader
|
||||
|
||||
/**
|
||||
* 获取Excel读取器,通过调用{@link ExcelReader}的read或readXXX方法读取Excel内容<br>
|
||||
* 默认调用第一个sheet
|
||||
@ -397,6 +398,7 @@ public class ExcelUtil {
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------ getWriter
|
||||
|
||||
/**
|
||||
* 获得{@link ExcelWriter},默认写出到第一个sheet<br>
|
||||
* 不传入写出的Excel文件路径,只能调用ExcelWriter#flush(OutputStream)方法写出到流<br>
|
||||
@ -504,6 +506,7 @@ public class ExcelUtil {
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------ getBigWriter
|
||||
|
||||
/**
|
||||
* 获得{@link BigExcelWriter},默认写出到第一个sheet<br>
|
||||
* 不传入写出的Excel文件路径,只能调用ExcelWriter#flush(OutputStream)方法写出到流<br>
|
||||
|
@ -390,6 +390,7 @@ public class ExcelWriter extends ExcelBase<ExcelWriter> {
|
||||
* </pre>
|
||||
*
|
||||
* @return Content-Type值
|
||||
* @since 5.6.7
|
||||
*/
|
||||
public String getContentType() {
|
||||
return isXlsx() ? ExcelUtil.XLSX_CONTENT_TYPE : ExcelUtil.XLS_CONTENT_TYPE;
|
||||
@ -408,6 +409,7 @@ public class ExcelWriter extends ExcelBase<ExcelWriter> {
|
||||
|
||||
/**
|
||||
* 定位到最后一行的后边,用于追加数据
|
||||
*
|
||||
* @return this
|
||||
* @since 5.5.0
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user