Browse Source

新增since

2.1.x
Jiaju Zhuang 5 years ago
parent
commit
7b9890ae51
  1. 7
      src/main/java/com/alibaba/excel/write/ExcelBuilderImpl.java
  2. 2
      src/test/java/com/alibaba/easyexcel/test/demo/write/WriteTest.java
  3. 12
      src/test/java/com/alibaba/easyexcel/test/temp/read/HeadReadTest.java
  4. 4
      update.md

7
src/main/java/com/alibaba/excel/write/ExcelBuilderImpl.java

@ -25,10 +25,13 @@ public class ExcelBuilderImpl implements ExcelBuilder {
private ExcelWriteFillExecutor excelWriteFillExecutor;
private ExcelWriteAddExecutor excelWriteAddExecutor;
static {
// Create temporary cache directory at initialization time to avoid POI concurrent write bugs
FileUtils.createPoiFilesDirectory();
}
public ExcelBuilderImpl(WriteWorkbook writeWorkbook) {
try {
// Create temporary cache directory at initialization time to avoid POI concurrent write bugs
FileUtils.createPoiFilesDirectory();
context = new WriteContextImpl(writeWorkbook);
} catch (RuntimeException e) {
finishOnException();

2
src/test/java/com/alibaba/easyexcel/test/demo/write/WriteTest.java

@ -73,6 +73,8 @@ public class WriteTest {
* 2. 根据自己或者排除自己需要的列
* <p>
* 3. 直接写即可
*
* @since 2.1.1
*/
@Test
public void excludeOrIncludeWrite() {

12
src/test/java/com/alibaba/easyexcel/test/temp/read/HeadReadTest.java

@ -8,6 +8,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.cache.Ehcache;
/**
* 临时测试
@ -25,4 +26,15 @@ public class HeadReadTest {
}
@Test
public void testCache() throws Exception {
File file = new File("D:\\test\\headt1.xls");
EasyExcel.read(file, HeadReadData.class, new HDListener()).readCache(new Ehcache(20)).sheet(0).doRead();
LOGGER.info("------------------");
EasyExcel.read(file, HeadReadData.class, new HDListener()).readCache(new Ehcache(20)).sheet(0).doRead();
LOGGER.info("------------------");
EasyExcel.read(file, HeadReadData.class, new HDListener()).readCache(new Ehcache(20)).sheet(0).doRead();
}
}

4
update.md

@ -1,3 +1,5 @@
# 2.1.2
# 2.1.1
* 发布正式版
* 修改map返回为LinkedHashMap
@ -61,7 +63,7 @@
* 修复监听器转换异常会重复提示的bug
# 2.0.1
* 降级poi为3.1.7 兼容jdk6
* 降级poi为3.17 兼容jdk6
# 2.0.0
* 修复当cell为空可能会抛出空指针的bug

Loading…
Cancel
Save