use of org.eclipse.vorto.model.ModelType in project vorto by eclipse.
the class BulkUploadHelper method trytoCreateModelFromCorruptFile.
// TODO: try to guess the modelinfo based on the content of the file, instead of the filename
private ModelInfo trytoCreateModelFromCorruptFile(String fileName) {
try {
final String modelName = fileName.substring(0, fileName.lastIndexOf("."));
final ModelType type = ModelType.fromFileName(fileName);
return new ModelInfo(new ModelId(modelName, "unknown", "unknown"), type);
} catch (Throwable t) {
return null;
}
}