From 5e3bead760aa19bdc441b7c9affb4928c263446f Mon Sep 17 00:00:00 2001 From: Megala Date: Thu, 20 Oct 2016 10:20:27 +0530 Subject: [PATCH] Making the windows rest api to be aligned with android --- .../api/services/impl/ConfigurationMgtServiceImpl.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/impl/ConfigurationMgtServiceImpl.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/impl/ConfigurationMgtServiceImpl.java index 1802df8dc7..2d299349e2 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/impl/ConfigurationMgtServiceImpl.java +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/impl/ConfigurationMgtServiceImpl.java @@ -35,6 +35,7 @@ import org.wso2.carbon.device.mgt.mobile.windows.api.services.ConfigurationMgtSe import javax.jws.WebService; import javax.ws.rs.*; +import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.util.ArrayList; import java.util.List; @@ -135,8 +136,8 @@ public class ConfigurationMgtServiceImpl implements ConfigurationMgtService { @GET @Path("/license") - public Response getLicense( - @HeaderParam("If-Modified-Since") String ifModifiedSince) { + @Produces(MediaType.TEXT_PLAIN) + public Response getLicense(@HeaderParam("If-Modified-Since") String ifModifiedSince) { License license; try { license = @@ -149,7 +150,7 @@ public class ConfigurationMgtServiceImpl implements ConfigurationMgtService { throw new UnexpectedServerErrorException( new ErrorResponse.ErrorResponseBuilder().setCode(500l).setMessage(msg).build()); } - return Response.status(Response.Status.OK).entity(license).build(); + return Response.status(Response.Status.OK).entity((license == null) ? null : license.getText()).build(); } }