Commit f1216c97204967ffc9f297623c4678b64108b8c9
1 parent
633ab7d3
Url validation for Ota Package and tests
Showing
6 changed files
with
77 additions
and
34 deletions
... | ... | @@ -34,10 +34,10 @@ import org.thingsboard.server.common.data.OtaPackage; |
34 | 34 | import org.thingsboard.server.common.data.OtaPackageInfo; |
35 | 35 | import org.thingsboard.server.common.data.audit.ActionType; |
36 | 36 | import org.thingsboard.server.common.data.exception.ThingsboardException; |
37 | -import org.thingsboard.server.common.data.ota.ChecksumAlgorithm; | |
38 | -import org.thingsboard.server.common.data.ota.OtaPackageType; | |
39 | 37 | import org.thingsboard.server.common.data.id.DeviceProfileId; |
40 | 38 | import org.thingsboard.server.common.data.id.OtaPackageId; |
39 | +import org.thingsboard.server.common.data.ota.ChecksumAlgorithm; | |
40 | +import org.thingsboard.server.common.data.ota.OtaPackageType; | |
41 | 41 | import org.thingsboard.server.common.data.page.PageData; |
42 | 42 | import org.thingsboard.server.common.data.page.PageLink; |
43 | 43 | import org.thingsboard.server.queue.util.TbCoreComponent; |
... | ... | @@ -109,12 +109,12 @@ public class OtaPackageController extends BaseController { |
109 | 109 | @PreAuthorize("hasAnyAuthority('TENANT_ADMIN')") |
110 | 110 | @RequestMapping(value = "/otaPackage", method = RequestMethod.POST) |
111 | 111 | @ResponseBody |
112 | - public OtaPackageInfo saveOtaPackageInfo(@RequestBody OtaPackageInfo otaPackageInfo) throws ThingsboardException { | |
112 | + public OtaPackageInfo saveOtaPackageInfo(@RequestBody OtaPackageInfo otaPackageInfo, @RequestParam boolean isUrl) throws ThingsboardException { | |
113 | 113 | boolean created = otaPackageInfo.getId() == null; |
114 | 114 | try { |
115 | 115 | otaPackageInfo.setTenantId(getTenantId()); |
116 | 116 | checkEntity(otaPackageInfo.getId(), otaPackageInfo, Resource.OTA_PACKAGE); |
117 | - OtaPackageInfo savedOtaPackageInfo = otaPackageService.saveOtaPackageInfo(otaPackageInfo); | |
117 | + OtaPackageInfo savedOtaPackageInfo = otaPackageService.saveOtaPackageInfo(otaPackageInfo, isUrl); | |
118 | 118 | logEntityAction(savedOtaPackageInfo.getId(), savedOtaPackageInfo, |
119 | 119 | null, created ? ActionType.ADDED : ActionType.UPDATED, null); |
120 | 120 | return savedOtaPackageInfo; | ... | ... |
... | ... | @@ -98,7 +98,7 @@ public abstract class BaseOtaPackageControllerTest extends AbstractControllerTes |
98 | 98 | firmwareInfo.setTitle(TITLE); |
99 | 99 | firmwareInfo.setVersion(VERSION); |
100 | 100 | |
101 | - OtaPackageInfo savedFirmwareInfo = save(firmwareInfo); | |
101 | + OtaPackageInfo savedFirmwareInfo = save(firmwareInfo, false); | |
102 | 102 | |
103 | 103 | Assert.assertNotNull(savedFirmwareInfo); |
104 | 104 | Assert.assertNotNull(savedFirmwareInfo.getId()); |
... | ... | @@ -109,7 +109,7 @@ public abstract class BaseOtaPackageControllerTest extends AbstractControllerTes |
109 | 109 | |
110 | 110 | savedFirmwareInfo.setAdditionalInfo(JacksonUtil.newObjectNode()); |
111 | 111 | |
112 | - save(savedFirmwareInfo); | |
112 | + save(savedFirmwareInfo, false); | |
113 | 113 | |
114 | 114 | OtaPackageInfo foundFirmwareInfo = doGet("/api/otaPackage/info/" + savedFirmwareInfo.getId().getId().toString(), OtaPackageInfo.class); |
115 | 115 | Assert.assertEquals(foundFirmwareInfo.getTitle(), savedFirmwareInfo.getTitle()); |
... | ... | @@ -123,7 +123,7 @@ public abstract class BaseOtaPackageControllerTest extends AbstractControllerTes |
123 | 123 | firmwareInfo.setTitle(TITLE); |
124 | 124 | firmwareInfo.setVersion(VERSION); |
125 | 125 | |
126 | - OtaPackageInfo savedFirmwareInfo = save(firmwareInfo); | |
126 | + OtaPackageInfo savedFirmwareInfo = save(firmwareInfo, false); | |
127 | 127 | |
128 | 128 | Assert.assertNotNull(savedFirmwareInfo); |
129 | 129 | Assert.assertNotNull(savedFirmwareInfo.getId()); |
... | ... | @@ -134,7 +134,7 @@ public abstract class BaseOtaPackageControllerTest extends AbstractControllerTes |
134 | 134 | |
135 | 135 | savedFirmwareInfo.setAdditionalInfo(JacksonUtil.newObjectNode()); |
136 | 136 | |
137 | - save(savedFirmwareInfo); | |
137 | + save(savedFirmwareInfo, false); | |
138 | 138 | |
139 | 139 | OtaPackageInfo foundFirmwareInfo = doGet("/api/otaPackage/info/" + savedFirmwareInfo.getId().getId().toString(), OtaPackageInfo.class); |
140 | 140 | Assert.assertEquals(foundFirmwareInfo.getTitle(), savedFirmwareInfo.getTitle()); |
... | ... | @@ -157,10 +157,10 @@ public abstract class BaseOtaPackageControllerTest extends AbstractControllerTes |
157 | 157 | firmwareInfo.setTitle(TITLE); |
158 | 158 | firmwareInfo.setVersion(VERSION); |
159 | 159 | |
160 | - OtaPackageInfo savedFirmwareInfo = save(firmwareInfo); | |
160 | + OtaPackageInfo savedFirmwareInfo = save(firmwareInfo, false); | |
161 | 161 | |
162 | 162 | loginDifferentTenant(); |
163 | - doPost("/api/otaPackage", savedFirmwareInfo, OtaPackageInfo.class, status().isForbidden()); | |
163 | + doPost("/api/otaPackage?isUrl=false", savedFirmwareInfo, OtaPackageInfo.class, status().isForbidden()); | |
164 | 164 | deleteDifferentTenant(); |
165 | 165 | } |
166 | 166 | |
... | ... | @@ -172,7 +172,7 @@ public abstract class BaseOtaPackageControllerTest extends AbstractControllerTes |
172 | 172 | firmwareInfo.setTitle(TITLE); |
173 | 173 | firmwareInfo.setVersion(VERSION); |
174 | 174 | |
175 | - OtaPackageInfo savedFirmwareInfo = save(firmwareInfo); | |
175 | + OtaPackageInfo savedFirmwareInfo = save(firmwareInfo, false); | |
176 | 176 | |
177 | 177 | OtaPackageInfo foundFirmware = doGet("/api/otaPackage/info/" + savedFirmwareInfo.getId().getId().toString(), OtaPackageInfo.class); |
178 | 178 | Assert.assertNotNull(foundFirmware); |
... | ... | @@ -187,7 +187,7 @@ public abstract class BaseOtaPackageControllerTest extends AbstractControllerTes |
187 | 187 | firmwareInfo.setTitle(TITLE); |
188 | 188 | firmwareInfo.setVersion(VERSION); |
189 | 189 | |
190 | - OtaPackageInfo savedFirmwareInfo = save(firmwareInfo); | |
190 | + OtaPackageInfo savedFirmwareInfo = save(firmwareInfo, false); | |
191 | 191 | |
192 | 192 | MockMultipartFile testData = new MockMultipartFile("file", FILE_NAME, CONTENT_TYPE, DATA.array()); |
193 | 193 | |
... | ... | @@ -207,7 +207,7 @@ public abstract class BaseOtaPackageControllerTest extends AbstractControllerTes |
207 | 207 | firmwareInfo.setTitle(TITLE); |
208 | 208 | firmwareInfo.setVersion(VERSION); |
209 | 209 | |
210 | - OtaPackageInfo savedFirmwareInfo = save(firmwareInfo); | |
210 | + OtaPackageInfo savedFirmwareInfo = save(firmwareInfo, false); | |
211 | 211 | |
212 | 212 | doDelete("/api/otaPackage/" + savedFirmwareInfo.getId().getId().toString()) |
213 | 213 | .andExpect(status().isOk()); |
... | ... | @@ -226,7 +226,7 @@ public abstract class BaseOtaPackageControllerTest extends AbstractControllerTes |
226 | 226 | firmwareInfo.setTitle(TITLE); |
227 | 227 | firmwareInfo.setVersion(VERSION + i); |
228 | 228 | |
229 | - OtaPackageInfo savedFirmwareInfo = save(firmwareInfo); | |
229 | + OtaPackageInfo savedFirmwareInfo = save(firmwareInfo, false); | |
230 | 230 | |
231 | 231 | if (i > 100) { |
232 | 232 | MockMultipartFile testData = new MockMultipartFile("file", FILE_NAME, CONTENT_TYPE, DATA.array()); |
... | ... | @@ -269,7 +269,7 @@ public abstract class BaseOtaPackageControllerTest extends AbstractControllerTes |
269 | 269 | firmwareInfo.setTitle(TITLE); |
270 | 270 | firmwareInfo.setVersion(VERSION + i); |
271 | 271 | |
272 | - OtaPackageInfo savedFirmwareInfo = save(firmwareInfo); | |
272 | + OtaPackageInfo savedFirmwareInfo = save(firmwareInfo, false); | |
273 | 273 | |
274 | 274 | if (i > 100) { |
275 | 275 | MockMultipartFile testData = new MockMultipartFile("file", FILE_NAME, CONTENT_TYPE, DATA.array()); |
... | ... | @@ -316,9 +316,8 @@ public abstract class BaseOtaPackageControllerTest extends AbstractControllerTes |
316 | 316 | Assert.assertEquals(allOtaPackages, allLoadedOtaPackages); |
317 | 317 | } |
318 | 318 | |
319 | - | |
320 | - private OtaPackageInfo save(OtaPackageInfo firmwareInfo) throws Exception { | |
321 | - return doPost("/api/otaPackage", firmwareInfo, OtaPackageInfo.class); | |
319 | + private OtaPackageInfo save(OtaPackageInfo firmwareInfo, boolean isUrl) throws Exception { | |
320 | + return doPost("/api/otaPackage?isUrl=" + isUrl, firmwareInfo, OtaPackageInfo.class); | |
322 | 321 | } |
323 | 322 | |
324 | 323 | protected OtaPackageInfo savaData(String urlTemplate, MockMultipartFile content, String... params) throws Exception { | ... | ... |
... | ... | @@ -18,11 +18,11 @@ package org.thingsboard.server.dao.ota; |
18 | 18 | import com.google.common.util.concurrent.ListenableFuture; |
19 | 19 | import org.thingsboard.server.common.data.OtaPackage; |
20 | 20 | import org.thingsboard.server.common.data.OtaPackageInfo; |
21 | -import org.thingsboard.server.common.data.ota.ChecksumAlgorithm; | |
22 | -import org.thingsboard.server.common.data.ota.OtaPackageType; | |
23 | 21 | import org.thingsboard.server.common.data.id.DeviceProfileId; |
24 | 22 | import org.thingsboard.server.common.data.id.OtaPackageId; |
25 | 23 | import org.thingsboard.server.common.data.id.TenantId; |
24 | +import org.thingsboard.server.common.data.ota.ChecksumAlgorithm; | |
25 | +import org.thingsboard.server.common.data.ota.OtaPackageType; | |
26 | 26 | import org.thingsboard.server.common.data.page.PageData; |
27 | 27 | import org.thingsboard.server.common.data.page.PageLink; |
28 | 28 | |
... | ... | @@ -30,7 +30,7 @@ import java.nio.ByteBuffer; |
30 | 30 | |
31 | 31 | public interface OtaPackageService { |
32 | 32 | |
33 | - OtaPackageInfo saveOtaPackageInfo(OtaPackageInfo otaPackageInfo); | |
33 | + OtaPackageInfo saveOtaPackageInfo(OtaPackageInfo otaPackageInfo, boolean isUrl); | |
34 | 34 | |
35 | 35 | OtaPackage saveOtaPackage(OtaPackage otaPackage); |
36 | 36 | ... | ... |
... | ... | @@ -77,8 +77,11 @@ public class BaseOtaPackageService implements OtaPackageService { |
77 | 77 | private TbTenantProfileCache tenantProfileCache; |
78 | 78 | |
79 | 79 | @Override |
80 | - public OtaPackageInfo saveOtaPackageInfo(OtaPackageInfo otaPackageInfo) { | |
80 | + public OtaPackageInfo saveOtaPackageInfo(OtaPackageInfo otaPackageInfo, boolean isUrl) { | |
81 | 81 | log.trace("Executing saveOtaPackageInfo [{}]", otaPackageInfo); |
82 | + if(isUrl && (StringUtils.isEmpty(otaPackageInfo.getUrl()) || otaPackageInfo.getUrl().trim().length() == 0)) { | |
83 | + throw new DataValidationException("Ota package URL should be specified!"); | |
84 | + } | |
82 | 85 | otaPackageInfoValidator.validate(otaPackageInfo, OtaPackageInfo::getTenantId); |
83 | 86 | try { |
84 | 87 | OtaPackageId otaPackageId = otaPackageInfo.getId(); |
... | ... | @@ -277,7 +280,9 @@ public class BaseOtaPackageService implements OtaPackageService { |
277 | 280 | throw new DataValidationException("Wrong otaPackage file!"); |
278 | 281 | } |
279 | 282 | } else { |
280 | - //TODO: validate url | |
283 | + if(otaPackage.getData() != null) { | |
284 | + throw new DataValidationException("File can't be saved if URL present!"); | |
285 | + } | |
281 | 286 | } |
282 | 287 | } |
283 | 288 | |
... | ... | @@ -336,6 +341,9 @@ public class BaseOtaPackageService implements OtaPackageService { |
336 | 341 | if (otaPackageOld.getDataSize() != null && !otaPackageOld.getDataSize().equals(otaPackage.getDataSize())) { |
337 | 342 | throw new DataValidationException("Updating otaPackage data size is prohibited!"); |
338 | 343 | } |
344 | + if(otaPackageOld.getUrl() != null && !otaPackageOld.getUrl().equals(otaPackage.getUrl())) { | |
345 | + throw new DataValidationException("Updating otaPackage URL is prohibited!"); | |
346 | + } | |
339 | 347 | } |
340 | 348 | |
341 | 349 | private void validateImpl(OtaPackageInfo otaPackageInfo) { | ... | ... |
... | ... | @@ -163,7 +163,7 @@ public abstract class BaseOtaPackageServiceTest extends AbstractServiceTest { |
163 | 163 | firmware.setVersion(VERSION); |
164 | 164 | firmware.setUrl(URL); |
165 | 165 | firmware.setDataSize(0L); |
166 | - OtaPackageInfo savedFirmware = otaPackageService.saveOtaPackageInfo(firmware); | |
166 | + OtaPackageInfo savedFirmware = otaPackageService.saveOtaPackageInfo(firmware, true); | |
167 | 167 | |
168 | 168 | Assert.assertNotNull(savedFirmware); |
169 | 169 | Assert.assertNotNull(savedFirmware.getId()); |
... | ... | @@ -174,7 +174,7 @@ public abstract class BaseOtaPackageServiceTest extends AbstractServiceTest { |
174 | 174 | Assert.assertEquals(firmware.getContentType(), savedFirmware.getContentType()); |
175 | 175 | |
176 | 176 | savedFirmware.setAdditionalInfo(JacksonUtil.newObjectNode()); |
177 | - otaPackageService.saveOtaPackageInfo(savedFirmware); | |
177 | + otaPackageService.saveOtaPackageInfo(savedFirmware, true); | |
178 | 178 | |
179 | 179 | OtaPackage foundFirmware = otaPackageService.findOtaPackageById(tenantId, savedFirmware.getId()); |
180 | 180 | Assert.assertEquals(foundFirmware.getTitle(), savedFirmware.getTitle()); |
... | ... | @@ -190,7 +190,7 @@ public abstract class BaseOtaPackageServiceTest extends AbstractServiceTest { |
190 | 190 | firmwareInfo.setType(FIRMWARE); |
191 | 191 | firmwareInfo.setTitle(TITLE); |
192 | 192 | firmwareInfo.setVersion(VERSION); |
193 | - OtaPackageInfo savedFirmwareInfo = otaPackageService.saveOtaPackageInfo(firmwareInfo); | |
193 | + OtaPackageInfo savedFirmwareInfo = otaPackageService.saveOtaPackageInfo(firmwareInfo, false); | |
194 | 194 | |
195 | 195 | Assert.assertNotNull(savedFirmwareInfo); |
196 | 196 | Assert.assertNotNull(savedFirmwareInfo.getId()); |
... | ... | @@ -216,7 +216,7 @@ public abstract class BaseOtaPackageServiceTest extends AbstractServiceTest { |
216 | 216 | |
217 | 217 | savedFirmwareInfo = otaPackageService.findOtaPackageInfoById(tenantId, savedFirmwareInfo.getId()); |
218 | 218 | savedFirmwareInfo.setAdditionalInfo(JacksonUtil.newObjectNode()); |
219 | - otaPackageService.saveOtaPackageInfo(savedFirmwareInfo); | |
219 | + otaPackageService.saveOtaPackageInfo(savedFirmwareInfo, false); | |
220 | 220 | |
221 | 221 | OtaPackage foundFirmware = otaPackageService.findOtaPackageById(tenantId, firmware.getId()); |
222 | 222 | firmware.setAdditionalInfo(JacksonUtil.newObjectNode()); |
... | ... | @@ -399,7 +399,7 @@ public abstract class BaseOtaPackageServiceTest extends AbstractServiceTest { |
399 | 399 | firmwareInfo.setType(FIRMWARE); |
400 | 400 | firmwareInfo.setTitle(TITLE); |
401 | 401 | firmwareInfo.setVersion(VERSION); |
402 | - otaPackageService.saveOtaPackageInfo(firmwareInfo); | |
402 | + otaPackageService.saveOtaPackageInfo(firmwareInfo, false); | |
403 | 403 | |
404 | 404 | OtaPackageInfo newFirmwareInfo = new OtaPackageInfo(); |
405 | 405 | newFirmwareInfo.setTenantId(tenantId); |
... | ... | @@ -410,7 +410,7 @@ public abstract class BaseOtaPackageServiceTest extends AbstractServiceTest { |
410 | 410 | |
411 | 411 | thrown.expect(DataValidationException.class); |
412 | 412 | thrown.expectMessage("OtaPackage with such title and version already exists!"); |
413 | - otaPackageService.saveOtaPackageInfo(newFirmwareInfo); | |
413 | + otaPackageService.saveOtaPackageInfo(newFirmwareInfo, false); | |
414 | 414 | } |
415 | 415 | |
416 | 416 | @Test |
... | ... | @@ -506,7 +506,7 @@ public abstract class BaseOtaPackageServiceTest extends AbstractServiceTest { |
506 | 506 | firmware.setType(FIRMWARE); |
507 | 507 | firmware.setTitle(TITLE); |
508 | 508 | firmware.setVersion(VERSION); |
509 | - OtaPackageInfo savedFirmware = otaPackageService.saveOtaPackageInfo(firmware); | |
509 | + OtaPackageInfo savedFirmware = otaPackageService.saveOtaPackageInfo(firmware, false); | |
510 | 510 | |
511 | 511 | OtaPackageInfo foundFirmware = otaPackageService.findOtaPackageInfoById(tenantId, savedFirmware.getId()); |
512 | 512 | Assert.assertNotNull(foundFirmware); |
... | ... | @@ -543,7 +543,7 @@ public abstract class BaseOtaPackageServiceTest extends AbstractServiceTest { |
543 | 543 | firmwareWithUrl.setUrl(URL); |
544 | 544 | firmwareWithUrl.setDataSize(0L); |
545 | 545 | |
546 | - OtaPackageInfo savedFwWithUrl = otaPackageService.saveOtaPackageInfo(firmwareWithUrl); | |
546 | + OtaPackageInfo savedFwWithUrl = otaPackageService.saveOtaPackageInfo(firmwareWithUrl, true); | |
547 | 547 | savedFwWithUrl.setHasData(true); |
548 | 548 | |
549 | 549 | firmwares.add(savedFwWithUrl); |
... | ... | @@ -588,7 +588,7 @@ public abstract class BaseOtaPackageServiceTest extends AbstractServiceTest { |
588 | 588 | firmwareWithUrl.setUrl(URL); |
589 | 589 | firmwareWithUrl.setDataSize(0L); |
590 | 590 | |
591 | - OtaPackageInfo savedFwWithUrl = otaPackageService.saveOtaPackageInfo(firmwareWithUrl); | |
591 | + OtaPackageInfo savedFwWithUrl = otaPackageService.saveOtaPackageInfo(firmwareWithUrl, true); | |
592 | 592 | savedFwWithUrl.setHasData(true); |
593 | 593 | |
594 | 594 | firmwares.add(savedFwWithUrl); |
... | ... | @@ -627,6 +627,40 @@ public abstract class BaseOtaPackageServiceTest extends AbstractServiceTest { |
627 | 627 | Assert.assertTrue(pageData.getData().isEmpty()); |
628 | 628 | } |
629 | 629 | |
630 | + @Test | |
631 | + public void testSaveOtaPackageInfoWithBlankAndEmptyUrl() { | |
632 | + OtaPackageInfo firmwareInfo = new OtaPackageInfo(); | |
633 | + firmwareInfo.setDeviceProfileId(deviceProfileId); | |
634 | + firmwareInfo.setType(FIRMWARE); | |
635 | + firmwareInfo.setTitle(TITLE); | |
636 | + firmwareInfo.setVersion(VERSION); | |
637 | + firmwareInfo.setUrl(" "); | |
638 | + thrown.expect(DataValidationException.class); | |
639 | + thrown.expectMessage("Ota package URL should be specified!"); | |
640 | + otaPackageService.saveOtaPackageInfo(firmwareInfo, true); | |
641 | + firmwareInfo.setUrl(""); | |
642 | + otaPackageService.saveOtaPackageInfo(firmwareInfo, true); | |
643 | + } | |
644 | + | |
645 | + @Test | |
646 | + public void testSaveOtaPackageUrlCantBeUpdated() { | |
647 | + OtaPackageInfo firmwareInfo = new OtaPackageInfo(); | |
648 | + firmwareInfo.setDeviceProfileId(deviceProfileId); | |
649 | + firmwareInfo.setType(FIRMWARE); | |
650 | + firmwareInfo.setTitle(TITLE); | |
651 | + firmwareInfo.setVersion(VERSION); | |
652 | + firmwareInfo.setUrl(URL); | |
653 | + firmwareInfo.setTenantId(tenantId); | |
654 | + | |
655 | + OtaPackageInfo savedFirmwareInfo = otaPackageService.saveOtaPackageInfo(firmwareInfo, true); | |
656 | + | |
657 | + thrown.expect(DataValidationException.class); | |
658 | + thrown.expectMessage("Updating otaPackage URL is prohibited!"); | |
659 | + | |
660 | + savedFirmwareInfo.setUrl("https://newurl.com"); | |
661 | + otaPackageService.saveOtaPackageInfo(savedFirmwareInfo, true); | |
662 | + } | |
663 | + | |
630 | 664 | private OtaPackage createFirmware(TenantId tenantId, String version) { |
631 | 665 | OtaPackage firmware = new OtaPackage(); |
632 | 666 | firmware.setTenantId(tenantId); | ... | ... |
... | ... | @@ -2967,8 +2967,10 @@ public class RestClient implements ClientHttpRequestInterceptor, Closeable { |
2967 | 2967 | ).getBody(); |
2968 | 2968 | } |
2969 | 2969 | |
2970 | - public OtaPackageInfo saveOtaPackageInfo(OtaPackageInfo otaPackageInfo) { | |
2971 | - return restTemplate.postForEntity(baseURL + "/api/otaPackage", otaPackageInfo, OtaPackageInfo.class).getBody(); | |
2970 | + public OtaPackageInfo saveOtaPackageInfo(OtaPackageInfo otaPackageInfo, boolean isUrl) { | |
2971 | + Map<String, String> params = new HashMap<>(); | |
2972 | + params.put("isUrl", Boolean.toString(isUrl)); | |
2973 | + return restTemplate.postForEntity(baseURL + "/api/otaPackage?isUrl={isUrl}", otaPackageInfo, OtaPackageInfo.class, params).getBody(); | |
2972 | 2974 | } |
2973 | 2975 | |
2974 | 2976 | public OtaPackageInfo saveOtaPackageData(OtaPackageId otaPackageId, String checkSum, ChecksumAlgorithm checksumAlgorithm, MultipartFile file) throws Exception { | ... | ... |