скачать результатов текущего двм пакета.

This commit is contained in:
2023-12-16 11:35:37 +03:00
parent ad19ee2665
commit e69769713b
9 changed files with 147 additions and 25 deletions

View File

@@ -552,6 +552,10 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
Print("Получить данные по пакетам Sapfor");
UpdateActiveSapforPackages();
break;
case DownloadDVMPackage:
Print("Загрузить пакет DVM");
DownloadDVMPackage();
break;
default:
throw new RepositoryRefuseException("Неподдерживаемый код: " + code);
}
@@ -832,4 +836,15 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
}
response.object = res_;
}
private void DownloadDVMPackage() throws Exception{
int dvmPackage_id = (int) request.object;
if (!db.dvmPackages.containsKey(dvmPackage_id))
throw new RepositoryRefuseException("Не найдено пакета тестирования DVM с ключом "+dvmPackage_id);
response = new ServerExchangeUnit_2021(ServerCode.OK);
DVMPackage dvmPackage = db.dvmPackages.get(dvmPackage_id);
File workspace = dvmPackage.getLocalWorkspace();
File results_zip = new File (workspace, "results.zip");
File package_json = dvmPackage.getJsonFile();
response.object = new Pair(Utils.packFile(results_zip), Utils.packFile(package_json));
}
}