From 3e6c3d7f3c72eb91768df9601bf4da55cce262dc Mon Sep 17 00:00:00 2001 From: megala21 Date: Tue, 3 Oct 2017 14:28:47 +0530 Subject: [PATCH] Refactoring --- .../services/impl/ApplicationManagementAPIImpl.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.api/src/main/java/org/wso2/carbon/device/application/mgt/api/services/impl/ApplicationManagementAPIImpl.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.api/src/main/java/org/wso2/carbon/device/application/mgt/api/services/impl/ApplicationManagementAPIImpl.java index b4032bcc96..e68b9dd697 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.api/src/main/java/org/wso2/carbon/device/application/mgt/api/services/impl/ApplicationManagementAPIImpl.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.api/src/main/java/org/wso2/carbon/device/application/mgt/api/services/impl/ApplicationManagementAPIImpl.java @@ -87,7 +87,7 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI { for (Application application : applications.getApplications()) { ImageArtifact imageArtifact = applicationStorageManager.getImageArtifact(application.getUuid(), - "icon", 0); + Constants.IMAGE_ARTIFACTS[0], 0); application.setIcon(imageArtifact); } return Response.status(Response.Status.OK).entity(applications).build(); @@ -114,11 +114,13 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI { } if (isWithImages != null && isWithImages) { - ImageArtifact icon = applicationStorageManager.getImageArtifact(uuid, "icon", 0); - ImageArtifact banner = applicationStorageManager.getImageArtifact(uuid, "banner", 0); + ImageArtifact icon = applicationStorageManager.getImageArtifact(uuid, Constants.IMAGE_ARTIFACTS[0], 0); + ImageArtifact banner = applicationStorageManager.getImageArtifact(uuid, Constants.IMAGE_ARTIFACTS[1], + 0); int screenShotCount = application.getScreenShotCount(); for (int count = 1; count < screenShotCount; count++) { - ImageArtifact screenShot = applicationStorageManager.getImageArtifact(uuid, "screenshot", count); + ImageArtifact screenShot = applicationStorageManager.getImageArtifact(uuid, Constants + .IMAGE_ARTIFACTS[2], count); application.addScreenShot(screenShot); } application.setIcon(icon);