Search in sources :

Example 1 with ModelType

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;
    }
}
Also used : ModelType(org.eclipse.vorto.model.ModelType) ModelId(org.eclipse.vorto.model.ModelId)

Aggregations

ModelId (org.eclipse.vorto.model.ModelId)1 ModelType (org.eclipse.vorto.model.ModelType)1