|
|
@ -732,7 +732,8 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
|
|
|
|
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
|
|
|
|
ApplicationStorageManager applicationStorageManager = APIUtil.getApplicationStorageManager();
|
|
|
|
ApplicationStorageManager applicationStorageManager = APIUtil.getApplicationStorageManager();
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
String md5OfApp = applicationStorageManager.getMD5(Files.newInputStream(Paths.get(applicationArtifact.getInstallerPath())));
|
|
|
|
String md5OfApp = applicationStorageManager.
|
|
|
|
|
|
|
|
getMD5(Files.newInputStream(Paths.get(applicationArtifact.getInstallerPath())));
|
|
|
|
validateReleaseBinaryFileHash(md5OfApp);
|
|
|
|
validateReleaseBinaryFileHash(md5OfApp);
|
|
|
|
releaseDTO.setUuid(UUID.randomUUID().toString());
|
|
|
|
releaseDTO.setUuid(UUID.randomUUID().toString());
|
|
|
|
releaseDTO.setAppHashValue(md5OfApp);
|
|
|
|
releaseDTO.setAppHashValue(md5OfApp);
|
|
|
@ -748,6 +749,7 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
String msg = "Error occurred while md5sum value retrieving process: application UUID "
|
|
|
|
String msg = "Error occurred while md5sum value retrieving process: application UUID "
|
|
|
|
+ releaseDTO.getUuid();
|
|
|
|
+ releaseDTO.getUuid();
|
|
|
|
log.error(msg, e);
|
|
|
|
log.error(msg, e);
|
|
|
|
|
|
|
|
throw new ApplicationManagementException(msg, e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return addImageArtifacts(releaseDTO, applicationArtifact, tenantId);
|
|
|
|
return addImageArtifacts(releaseDTO, applicationArtifact, tenantId);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -896,7 +898,8 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
log.error(msg);
|
|
|
|
log.error(msg);
|
|
|
|
throw new ApplicationManagementException(msg);
|
|
|
|
throw new ApplicationManagementException(msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
String md5OfApp = applicationStorageManager.getMD5(Files.newInputStream(Paths.get(applicationArtifact.getInstallerPath())));
|
|
|
|
String md5OfApp = applicationStorageManager.
|
|
|
|
|
|
|
|
getMD5(Files.newInputStream(Paths.get(applicationArtifact.getInstallerPath())));
|
|
|
|
if (md5OfApp == null) {
|
|
|
|
if (md5OfApp == null) {
|
|
|
|
String msg = "Error occurred while md5sum value retrieving process: application UUID "
|
|
|
|
String msg = "Error occurred while md5sum value retrieving process: application UUID "
|
|
|
|
+ applicationReleaseDTO.getUuid();
|
|
|
|
+ applicationReleaseDTO.getUuid();
|
|
|
@ -910,7 +913,6 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
applicationReleaseDTO.setAppHashValue(md5OfApp);
|
|
|
|
applicationReleaseDTO.setAppHashValue(md5OfApp);
|
|
|
|
|
|
|
|
|
|
|
|
applicationStorageManager
|
|
|
|
applicationStorageManager
|
|
|
|
.uploadReleaseArtifact(applicationReleaseDTO, deviceType,
|
|
|
|
.uploadReleaseArtifact(applicationReleaseDTO, deviceType,
|
|
|
|
Files.newInputStream(Paths.get(applicationArtifact.getInstallerPath())), tenantId);
|
|
|
|
Files.newInputStream(Paths.get(applicationArtifact.getInstallerPath())), tenantId);
|
|
|
|