return new BufferedReader(isr);
}
private Map<Integer, String> addHeaders(Worksheet worksheet, RepFactory fac,
String line, BufferedReader br) throws IOException {
HTable headers = worksheet.getHeaders();
Map<Integer, String> headersMap = new HashMap<Integer, String>();
CSVReader reader = new CSVReader(new StringReader(line), delimiter,
quoteCharacter, escapeCharacter);
String[] rowValues = null;
rowValues = reader.readNext();
if (rowValues == null || rowValues.length == 0) {
reader.close();
return addEmptyHeaders(worksheet, fac, br);
}
for (int i = 0; i < rowValues.length; i++) {
HNode hNode = null;
if (headerRowIndex == 0) {
if (isVisible("Column_" + (i + 1)))
hNode = headers.addHNode("Column_" + (i + 1), HNodeType.Regular, worksheet, fac);
} else {
if (isVisible(rowValues[i]))
hNode = headers.addHNode(rowValues[i], HNodeType.Regular, worksheet, fac);
}
if (hNode != null)
headersMap.put(i, hNode.getId());
}
reader.close();