From eb8c7d544617a17d630aae28c11ff8ef697938ba Mon Sep 17 00:00:00 2001 From: Jiaju Zhuang Date: Wed, 8 Feb 2023 19:33:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A8=A1=E6=9D=BF=E6=8F=90?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../excel/write/builder/ExcelWriterBuilder.java | 14 ++++++++++++-- .../excel/write/metadata/WriteWorkbook.java | 4 ++-- .../easyexcel/test/demo/write/WriteTest.java | 1 + 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/easyexcel-core/src/main/java/com/alibaba/excel/write/builder/ExcelWriterBuilder.java b/easyexcel-core/src/main/java/com/alibaba/excel/write/builder/ExcelWriterBuilder.java index 75d702f8..76af6f66 100644 --- a/easyexcel-core/src/main/java/com/alibaba/excel/write/builder/ExcelWriterBuilder.java +++ b/easyexcel-core/src/main/java/com/alibaba/excel/write/builder/ExcelWriterBuilder.java @@ -66,7 +66,6 @@ public class ExcelWriterBuilder extends AbstractExcelWriterParameterBuilder * If 'inputStream' and 'file' all not empty, file first */ @@ -66,7 +67,6 @@ public class WriteWorkbook extends WriteBasicParameter { * Whether the encryption *

* WARRING:Encryption is when the entire file is read into memory, so it is very memory intensive. - * */ private String password; /** diff --git a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/write/WriteTest.java b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/write/WriteTest.java index 351e0e0a..a99f7d9d 100644 --- a/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/write/WriteTest.java +++ b/easyexcel-test/src/test/java/com/alibaba/easyexcel/test/demo/write/WriteTest.java @@ -401,6 +401,7 @@ public class WriteTest { String templateFileName = TestFileUtil.getPath() + "demo" + File.separator + "demo.xlsx"; String fileName = TestFileUtil.getPath() + "templateWrite" + System.currentTimeMillis() + ".xlsx"; // 这里 需要指定写用哪个class去写,然后写到第一个sheet,名字为模板 然后文件流会自动关闭 + // 这里要注意 withTemplate 的模板文件会全量存储在内存里面,所以尽量不要用于追加文件,如果文件模板文件过大会OOM EasyExcel.write(fileName, DemoData.class).withTemplate(templateFileName).sheet().doWrite(data()); }