Skip to content
Permalink
Browse files
BATCHEE-83 using 1 as default header size
  • Loading branch information
rsandtner committed Dec 7, 2015
1 parent 3a72a4c commit 332e5ae04616b81ca588d1cbe394b773cd4ccb36
Showing 2 changed files with 7 additions and 3 deletions.
@@ -88,7 +88,7 @@ public class JSefaCsvReader extends JSefaReader {
private Boolean ignoreHeader;

@Inject
@BatchProperty()
@BatchProperty
@Documentation("number of header lines")
private Integer headerSize;

@@ -102,8 +102,11 @@ protected Deserializer initDeserializer() throws Exception {
specialRecordDelimiter, simpleTypeProvider, typeMappingRegistry);

if (config.getLineFilter() == null &&
Boolean.TRUE.equals(ignoreHeader) &&
headerSize != null && headerSize > 0) {
Boolean.TRUE.equals(ignoreHeader)) {

if (headerSize == null || headerSize == 0) {
headerSize = 1; // the default size if nothing was specified
}

config.setLineFilter(new HeaderAndFooterFilter(headerSize, false, false));
}
@@ -65,6 +65,7 @@ public void testReadWithHeader() {
properties.setProperty("input", path);

StringBuilder csvBuilder = new StringBuilder(200);
csvBuilder.append("firstName;lastName;street;zip;city");
for (int i = 0; i < 10; i++) {
csvBuilder.append(IOs.LINE_SEPARATOR)
.append(CsvUtil.toCsv(new PersonWithAddress("firstName_" + i,

0 comments on commit 332e5ae

Please sign in to comment.