use of com.checkmarx.sdk.dto.sca.ScaUploadUrlRequest in project checkmarx-spring-boot-java-sdk by checkmarx-ltd.
the class ScanClientHelper method getSourcesUploadUrl.
private String getSourcesUploadUrl() throws IOException {
List<ScanConfig> apiScanConfig = Collections.singletonList(getScanConfig());
ScaUploadUrlRequest request = ScaUploadUrlRequest.builder().config(apiScanConfig).build();
StringEntity entity = HttpClientHelper.convertToStringEntity(request);
JsonNode response = httpClient.postRequest(GET_UPLOAD_URL, ContentType.CONTENT_TYPE_APPLICATION_JSON, entity, JsonNode.class, HttpStatus.SC_OK, "get upload URL for sources");
if (response == null || response.get("url") == null) {
throw new ScannerRuntimeException("Unable to get the upload URL.");
}
return response.get("url").asText();
}
Aggregations