use of eu.fthevenet.binjr.data.exceptions.FetchingDataFromAdapterException in project selenium_java by sergueik.
the class CsvFileAdapter method getBindingTree.
@Override
public TreeItem<TimeSeriesBinding<Double>> getBindingTree() throws DataAdapterException {
TreeItem<TimeSeriesBinding<Double>> tree = new TreeItem<>(new TimeSeriesBinding<>("", "/", null, getSourceName(), UnitPrefixes.METRIC, ChartType.STACKED, "-", "/" + getSourceName(), this));
try (InputStream in = Files.newInputStream(csvPath)) {
this.headers = getDecoder().getDataColumnHeaders(in);
for (String header : headers) {
TimeSeriesBinding<Double> b = new TimeSeriesBinding<>(header, header, null, header, UnitPrefixes.METRIC, ChartType.STACKED, "-", "/" + getSourceName() + "/" + header, this);
tree.getChildren().add(new TreeItem<>(b));
}
} catch (IOException e) {
throw new FetchingDataFromAdapterException(e);
}
return tree;
}
Aggregations