Skip to content

Commit

Permalink
code optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
Crab2died committed May 2, 2018
1 parent d20df95 commit a23fcbc
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
public class SheetTemplateHandler {

// 构建SheetTemplate
public static SheetTemplate sheetTemplateBuilder(String templatePath) throws Excel4JException {
public static SheetTemplate sheetTemplateBuilder(String templatePath)
throws Excel4JException {
SheetTemplate sheetTemplate = new SheetTemplate();
try {
// 读取模板文件
Expand All @@ -31,11 +32,16 @@ public static SheetTemplate sheetTemplateBuilder(String templatePath) throws Exc
return sheetTemplate;
}

public static SheetTemplate sheetTemplateBuilder(InputStream is) throws Exception {
public static SheetTemplate sheetTemplateBuilder(InputStream is)
throws Excel4JException {
SheetTemplate sheetTemplate = new SheetTemplate();

// 读取模板文件
sheetTemplate.workbook = WorkbookFactory.create(is);
try {
sheetTemplate.workbook = WorkbookFactory.create(is);
} catch (IOException | InvalidFormatException e) {
throw new Excel4JException(e);
}
return sheetTemplate;
}

Expand Down

0 comments on commit a23fcbc

Please sign in to comment.