Skip to content

Commit

Permalink
refactor: make template private
Browse files Browse the repository at this point in the history
  • Loading branch information
javier-godoy authored and paodb committed Sep 16, 2024
1 parent ad66b62 commit de80894
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ abstract class BaseStreamResourceWriter<T> implements StreamResourceWriter {
private static final Logger LOGGER = LoggerFactory.getLogger(BaseStreamResourceWriter.class);

protected GridExporter<T> exporter;
protected String template;
private String template;

public BaseStreamResourceWriter(GridExporter<T> exporter) {
super();
Expand All @@ -63,6 +63,10 @@ public BaseStreamResourceWriter(
template = customTemplate == null ? defaultTemplate : customTemplate;
}

protected String getTemplate() {
return template;
}

/**
* If a column was configured to be exported or not, that will be honored. If not, it will
* exported based on the visibility
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ private XWPFTable findTable(XWPFDocument doc) {
}

private XWPFDocument getBaseTemplateDoc() throws EncryptedDocumentException, IOException {
InputStream inp = this.getClass().getResourceAsStream(template);
InputStream inp = this.getClass().getResourceAsStream(getTemplate());
return new XWPFDocument(inp);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ private void applyExcelFormat(Cell cell, String excelFormat, Map<String, CellSty

private Workbook getBaseTemplateWorkbook() {
try {
InputStream inp = this.getClass().getResourceAsStream(template);
InputStream inp = this.getClass().getResourceAsStream(getTemplate());
Workbook result = WorkbookFactory.create(inp);
return result;
} catch (Exception e) {
Expand Down

0 comments on commit de80894

Please sign in to comment.