|
|
@ -857,7 +857,8 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
ApplicationArtifact applicationArtifact, int tenantId) throws ResourceManagementException {
|
|
|
|
ApplicationArtifact applicationArtifact, int tenantId) throws ResourceManagementException {
|
|
|
|
ApplicationStorageManager applicationStorageManager = APIUtil.getApplicationStorageManager();
|
|
|
|
ApplicationStorageManager applicationStorageManager = APIUtil.getApplicationStorageManager();
|
|
|
|
|
|
|
|
|
|
|
|
applicationReleaseDTO.setIconName(applicationArtifact.getIconName());
|
|
|
|
applicationReleaseDTO.setIconName(ApplicationManagementUtil.sanitizeName
|
|
|
|
|
|
|
|
(applicationArtifact.getIconName(), Constants.ICON_NAME));
|
|
|
|
applicationReleaseDTO.setBannerName(applicationArtifact.getBannerName());
|
|
|
|
applicationReleaseDTO.setBannerName(applicationArtifact.getBannerName());
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, InputStream> screenshots = applicationArtifact.getScreenshots();
|
|
|
|
Map<String, InputStream> screenshots = applicationArtifact.getScreenshots();
|
|
|
@ -866,11 +867,14 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
int counter = 1;
|
|
|
|
int counter = 1;
|
|
|
|
for (String scName : screenshotNames) {
|
|
|
|
for (String scName : screenshotNames) {
|
|
|
|
if (counter == 1) {
|
|
|
|
if (counter == 1) {
|
|
|
|
applicationReleaseDTO.setScreenshotName1(scName);
|
|
|
|
applicationReleaseDTO.setScreenshotName1(ApplicationManagementUtil.sanitizeName
|
|
|
|
|
|
|
|
(scName, Constants.SCREENSHOT_NAME + counter));
|
|
|
|
} else if (counter == 2) {
|
|
|
|
} else if (counter == 2) {
|
|
|
|
applicationReleaseDTO.setScreenshotName2(scName);
|
|
|
|
applicationReleaseDTO.setScreenshotName2(ApplicationManagementUtil.sanitizeName
|
|
|
|
|
|
|
|
(scName, Constants.SCREENSHOT_NAME + counter));
|
|
|
|
} else if (counter == 3) {
|
|
|
|
} else if (counter == 3) {
|
|
|
|
applicationReleaseDTO.setScreenshotName3(scName);
|
|
|
|
applicationReleaseDTO.setScreenshotName3(ApplicationManagementUtil.sanitizeName
|
|
|
|
|
|
|
|
(scName, Constants.SCREENSHOT_NAME + counter));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -898,7 +902,8 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
applicationStorageManager
|
|
|
|
applicationStorageManager
|
|
|
|
.deleteAppReleaseArtifact(applicationReleaseDTO.getAppHashValue(), Constants.ICON_ARTIFACT,
|
|
|
|
.deleteAppReleaseArtifact(applicationReleaseDTO.getAppHashValue(), Constants.ICON_ARTIFACT,
|
|
|
|
applicationReleaseDTO.getIconName(), tenantId);
|
|
|
|
applicationReleaseDTO.getIconName(), tenantId);
|
|
|
|
applicationReleaseDTO.setIconName(applicationArtifact.getIconName());
|
|
|
|
applicationReleaseDTO.setIconName(ApplicationManagementUtil.sanitizeName
|
|
|
|
|
|
|
|
(applicationArtifact.getIconName(), Constants.ICON_NAME));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!StringUtils.isEmpty(applicationArtifact.getBannerName())){
|
|
|
|
if (!StringUtils.isEmpty(applicationArtifact.getBannerName())){
|
|
|
|
applicationStorageManager
|
|
|
|
applicationStorageManager
|
|
|
@ -921,17 +926,20 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
applicationStorageManager
|
|
|
|
applicationStorageManager
|
|
|
|
.deleteAppReleaseArtifact(applicationReleaseDTO.getAppHashValue(), folderPath,
|
|
|
|
.deleteAppReleaseArtifact(applicationReleaseDTO.getAppHashValue(), folderPath,
|
|
|
|
applicationReleaseDTO.getScreenshotName1(), tenantId);
|
|
|
|
applicationReleaseDTO.getScreenshotName1(), tenantId);
|
|
|
|
applicationReleaseDTO.setScreenshotName1(scName);
|
|
|
|
applicationReleaseDTO.setScreenshotName1(ApplicationManagementUtil.sanitizeName
|
|
|
|
|
|
|
|
(scName, Constants.SCREENSHOT_NAME + counter));
|
|
|
|
} else if (counter == 2) {
|
|
|
|
} else if (counter == 2) {
|
|
|
|
applicationStorageManager
|
|
|
|
applicationStorageManager
|
|
|
|
.deleteAppReleaseArtifact(applicationReleaseDTO.getAppHashValue(), folderPath,
|
|
|
|
.deleteAppReleaseArtifact(applicationReleaseDTO.getAppHashValue(), folderPath,
|
|
|
|
applicationReleaseDTO.getScreenshotName2(), tenantId);
|
|
|
|
applicationReleaseDTO.getScreenshotName2(), tenantId);
|
|
|
|
applicationReleaseDTO.setScreenshotName2(scName);
|
|
|
|
applicationReleaseDTO.setScreenshotName2(ApplicationManagementUtil.sanitizeName
|
|
|
|
|
|
|
|
(scName, Constants.SCREENSHOT_NAME + counter));
|
|
|
|
} else if (counter == 3) {
|
|
|
|
} else if (counter == 3) {
|
|
|
|
applicationStorageManager
|
|
|
|
applicationStorageManager
|
|
|
|
.deleteAppReleaseArtifact(applicationReleaseDTO.getAppHashValue(), folderPath,
|
|
|
|
.deleteAppReleaseArtifact(applicationReleaseDTO.getAppHashValue(), folderPath,
|
|
|
|
applicationReleaseDTO.getScreenshotName3(), tenantId);
|
|
|
|
applicationReleaseDTO.getScreenshotName3(), tenantId);
|
|
|
|
applicationReleaseDTO.setScreenshotName3(scName);
|
|
|
|
applicationReleaseDTO.setScreenshotName3(ApplicationManagementUtil.sanitizeName
|
|
|
|
|
|
|
|
(scName, Constants.SCREENSHOT_NAME + counter));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
counter++;
|
|
|
|
counter++;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2428,7 +2436,8 @@ public class ApplicationManagerImpl implements ApplicationManager {
|
|
|
|
log.error(msg);
|
|
|
|
log.error(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
throw new BadRequestException(msg);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
applicationDTO.setName(applicationUpdateWrapper.getName());
|
|
|
|
applicationDTO.setName(ApplicationManagementUtil.sanitizeName(applicationUpdateWrapper.getName(),
|
|
|
|
|
|
|
|
Constants.ApplicationProperties.NAME));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!StringUtils.isEmpty(applicationUpdateWrapper.getSubMethod()) && !applicationDTO.getSubType()
|
|
|
|
if (!StringUtils.isEmpty(applicationUpdateWrapper.getSubMethod()) && !applicationDTO.getSubType()
|
|
|
|
.equals(applicationUpdateWrapper.getSubMethod())) {
|
|
|
|
.equals(applicationUpdateWrapper.getSubMethod())) {
|
|
|
|