Skip to content

Commit 205eb01

Browse files
removed version 1.0 for scanWithSettings API
1 parent c15e065 commit 205eb01

File tree

1 file changed

+12
-28
lines changed

1 file changed

+12
-28
lines changed

src/main/java/com/checkmarx/sdk/service/CxService.java

Lines changed: 12 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1884,34 +1884,18 @@ public Integer uploadProjectSource(CxScanParams params,Integer projectId, File f
18841884
HttpHeaders headers = authClient.createAuthHeaders();
18851885
headers.setContentType(MediaType.MULTIPART_FORM_DATA);
18861886
LinkedMultiValueMap<String, Object> map = new LinkedMultiValueMap<>();
1887-
if(cxProperties.getVersion()>9.4){
1888-
headers.add("version", "1.2");
1889-
FileSystemResource value = new FileSystemResource(file);
1890-
map.add("projectId", projectId);
1891-
map.add("customFields", params.getCustomFields());
1892-
map.add("overrideProjectSetting", cxProperties.getOverrideProjectSetting());
1893-
map.add("isIncremental", params.isIncremental());
1894-
map.add("isPublic", params.isPublic());
1895-
map.add("forceScan", params.isForceScan());
1896-
map.add("comment", comment);
1897-
map.add("presetId", getPresetId(params.getScanPreset()));
1898-
map.add("engineConfigurationId",getScanConfiguration(params.getScanConfiguration()));
1899-
map.add("zippedSource", value);
1900-
}else {
1901-
headers.add("version", "1.0");
1902-
FileSystemResource value = new FileSystemResource(file);
1903-
map.add("projectId", projectId);
1904-
map.add("overrideProjectSetting", cxProperties.getOverrideProjectSetting());
1905-
map.add("isIncremental", params.isIncremental());
1906-
map.add("isPublic", params.isPublic());
1907-
map.add("forceScan", params.isForceScan());
1908-
map.add("comment", comment);
1909-
map.add("presetId", getPresetId(params.getScanPreset()));
1910-
map.add("engineConfigurationId",getScanConfiguration(params.getScanConfiguration()));
1911-
map.add("zippedSource", value);
1912-
1913-
log.debug("Using scanWithSettings version 1.0 CustomFields not available");
1914-
}
1887+
headers.add("version", "1.2");
1888+
FileSystemResource value = new FileSystemResource(file);
1889+
map.add("projectId", projectId);
1890+
map.add("customFields", params.getCustomFields());
1891+
map.add("overrideProjectSetting", cxProperties.getOverrideProjectSetting());
1892+
map.add("isIncremental", params.isIncremental());
1893+
map.add("isPublic", params.isPublic());
1894+
map.add("forceScan", params.isForceScan());
1895+
map.add("comment", comment);
1896+
map.add("presetId", getPresetId(params.getScanPreset()));
1897+
map.add("engineConfigurationId",getScanConfiguration(params.getScanConfiguration()));
1898+
map.add("zippedSource", value);
19151899
HttpEntity<LinkedMultiValueMap<String, Object>> requestEntity = new HttpEntity<>(map, headers);
19161900
try {
19171901
log.info("Updating Source details for project Id {}", projectId);

0 commit comments

Comments
 (0)