use of com.mercedesbenz.sechub.commons.model.SecHubRuntimeException in project sechub by mercedes-benz.
the class SchedulerSourcecodeUploadService method storeUploadFileAndSha256Checksum.
private void storeUploadFileAndSha256Checksum(String projectId, UUID jobUUID, MultipartFile file, String checkSum, String traceLogID) {
JobStorage jobStorage = storageService.getJobStorage(projectId, jobUUID);
try (InputStream inputStream = file.getInputStream()) {
jobStorage.store(FILENAME_SOURCECODE_ZIP, inputStream);
// we also store given checksum - so can be reused by security product
jobStorage.store(FILENAME_SOURCECODE_ZIP_CHECKSUM, new StringInputStream(checkSum));
} catch (IOException e) {
LOG.error("Was not able to store zipped sources! {}", traceLogID, e);
throw new SecHubRuntimeException("Was not able to upload sources");
}
}
use of com.mercedesbenz.sechub.commons.model.SecHubRuntimeException in project sechub by mercedes-benz.
the class SerecoReportProductExecutor method importProductResult.
private void importProductResult(UUIDTraceLogID traceLogId, Workspace workspace, ProductResult productResult) {
String importData = productResult.getResult();
String productId = productResult.getProductIdentifier().name();
LOG.debug("{} found product result for '{}'", traceLogId, productId);
UUID uuid = productResult.getUUID();
String docId = uuid.toString();
LOG.debug("{} start to import result '{}' from product '{}' , config:{}", traceLogId, docId, productId, productResult.getProductExecutorConfigUUID());
/* @formatter:off */
try {
workspace.doImport(builder().productId(productId).importData(importData).importId(docId).build());
} catch (IOException e) {
throw new SecHubRuntimeException("Import into workspace failed:" + docId, e);
}
/* @formatter:on */
}
use of com.mercedesbenz.sechub.commons.model.SecHubRuntimeException in project sechub by mercedes-benz.
the class SchedulerUploadService method storeUploadFileAndSha256Checksum.
private void storeUploadFileAndSha256Checksum(String projectId, UUID jobUUID, MultipartFile file, String checkSum, String traceLogID) {
JobStorage jobStorage = storageService.getJobStorage(projectId, jobUUID);
try (InputStream inputStream = file.getInputStream()) {
jobStorage.store(SOURCECODE_ZIP, inputStream);
// we also store given checksum - so can be reused by security product
jobStorage.store(SOURCECODE_ZIP_CHECKSUM, new StringInputStream(checkSum));
} catch (IOException e) {
LOG.error("Was not able to store zipped sources! {}", traceLogID, e);
throw new SecHubRuntimeException("Was not able to upload sources");
}
}
Aggregations