com.braintreegateway.TransactionLevelFeeReport Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of org.apache.servicemix.bundles.braintree-java
Show all versions of org.apache.servicemix.bundles.braintree-java
This OSGi bundle wraps ${pkgArtifactId} ${pkgVersion} jar file.
package com.braintreegateway;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.csv.CSVFormat;
import org.apache.commons.csv.CSVRecord;
public class TransactionLevelFeeReport {
private List csvRecords = new ArrayList();
private Boolean valid;
public TransactionLevelFeeReport(String urlValue) throws IOException, ParseException {
if (urlValue == null || "".equals(urlValue)) {
this.valid = false;
return;
}
this.valid = true;
URL url = new URL(urlValue);
InputStreamReader is = new InputStreamReader(url.openStream());
for (CSVRecord record : CSVFormat.EXCEL.withFirstRecordAsHeader().parse(is)) {
csvRecords.add(record);
}
}
public List getCSVRecords() {
return csvRecords;
}
public Boolean isValid() {
return this.valid;
}
}