Skip to content
This repository has been archived by the owner on Sep 3, 2024. It is now read-only.

Commit

Permalink
change kinks api to conform common style
Browse files Browse the repository at this point in the history
  • Loading branch information
clicman committed Apr 7, 2019
1 parent a87c67a commit ebdd74e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@
*.iml
.classpath
.vscode/
.settings/
.settings/
.DS_Store
**/.factorypath
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@

import static java.lang.String.format;

@SuppressWarnings("deprecation")
public class ExcelDataProvider extends AbstractDataProvider {

private static final Logger LOG = LoggerFactory.getLogger(ExcelDataProvider.class);
private static final String DEFAULT_EXTENSION = "xlsx";
private static final String REF_TPL = "$ref:";
private final XSSFWorkbook workBook;
private final String dataFileName;
private XSSFFormulaEvaluator evaluator;
Expand Down Expand Up @@ -212,13 +212,13 @@ private String getName(XSSFRow row) {
}

private boolean isLink(XSSFRow row) {
return getCellValue(row.getCell(2)).contains("link:");
return getCellValue(row.getCell(2)).startsWith(REF_TPL);
}

private BasicDBObject getLink(XSSFRow row) {
String linkPath = getCellValue(row.getCell(2)).replace("link:", "");
String linkPath = getCellValue(row.getCell(2)).replace(REF_TPL, "");
BasicDBObject link = new BasicDBObject();
String[] fullPathDelimited = linkPath.split("[.]", 2);
String[] fullPathDelimited = linkPath.split("[:]", 2);
// Link to another sheetName (sheet)
link.append(COLLECTION_TPL, fullPathDelimited[0]);
link.append("path", fullPathDelimited[1]);
Expand Down

0 comments on commit ebdd74e

Please sign in to comment.