private List<CmiData> collectData(VFSContainer scoFolder) {
List<CmiData> datas = new ArrayList<CmiData>();
List<VFSItem> contents = scoFolder.getItems(new XMLFilter());
for(VFSItem file:contents) {
ScoDocument document = new ScoDocument(null);
try {
if(file instanceof LocalFileImpl) {
document.loadDocument(((LocalFileImpl)file).getBasefile());
}
else {
logger.warn("Cannot use this type of VSFItem to load a SCO Datamodel: " + file.getClass().getName(), null);
continue;
}
String fileName = file.getName();
String itemId = fileName.substring(0, fileName.length() - 4);
String[][] scoModel = document.getScoModel();
for(String[] line:scoModel) {
datas.add(new CmiData(itemId, line[0], line[1]));
}
} catch (Exception e) {
logger.error("Cannot load a SCO Datamodel", e);