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 c73e2a8487c..74d8b4fb87d 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 @@ -97,12 +97,15 @@ public class ApplicationManagementAPIImpl implements ApplicationManagementAPI { @Path("/{uuid}") public Response getApplication(@PathParam("uuid") String uuid) { ApplicationManager applicationManager = APIUtil.getApplicationManager(); + ApplicationStorageManager applicationStorageManager = APIUtil.getApplicationStorageManager(); try { Application application = applicationManager.getApplication(uuid); if (application == null) { return Response.status(Response.Status.NOT_FOUND) .entity("Application with UUID " + uuid + " not found").build(); } + ImageArtifact icon = applicationStorageManager.getImageArtifact(uuid, "icon", 0); + application.setIcon(icon); return Response.status(Response.Status.OK).entity(application).build(); } catch (NotFoundException e) { return Response.status(Response.Status.NOT_FOUND).build(); diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/Application.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/Application.java index 246089b2a72..0f76dd36e5d 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/Application.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/Application.java @@ -21,6 +21,7 @@ package org.wso2.carbon.device.application.mgt.common; import org.wso2.carbon.device.application.mgt.common.jaxrs.Exclude; +import java.awt.*; import java.util.Date; import java.util.List; import java.util.Map; @@ -69,6 +70,8 @@ public class Application { private User user; + private ImageArtifact icon; + public int getId() { return id; } @@ -221,6 +224,10 @@ public class Application { return screenShotCount; } + public void setIcon(ImageArtifact icon) { + this.icon = icon; + } + @Override public String toString() { String app = "UUID : " + uuid + "\tName : " + name + "\tShort Description : "