use of com.qlangtech.tis.manage.common.ConfigFileValidateResult in project tis by qlangtech.
the class UploadJarAction method parseSnapshot.
/**
* 创建snapshot
*
* @param context
* @param formm
* @return
* @throws IOException
*/
protected Snapshot parseSnapshot(Context context, UploadJarForm formm, SnapshotCreater snapshotCreater) throws IOException {
ConfigContentGetter[] getter = getContentGetter(formm);
ConfigFileValidateResult validateValidateResult = null;
boolean fileValid = true;
// 校验文件格式是否正确
ISchemaPluginContext schemaPlugin = SchemaAction.createSchemaPlugin(this.getCollectionName());
for (ConfigContentGetter get : getter) {
validateValidateResult = get.getterStrategy.validate(schemaPlugin, get.content);
if (!validateValidateResult.isValid()) {
this.addErrorMessage(context, validateValidateResult.getValidateResult());
fileValid = false;
}
}
if (!fileValid) {
return null;
}
// createSnapshot(getter);
Snapshot snapshot = snapshotCreater.create(getter);
snapshot.setPreSnId(-1);
return snapshot;
}
Aggregations