From f80603a3650bcab239b985a7073d768613d070ca Mon Sep 17 00:00:00 2001 From: madhawap Date: Fri, 3 Jun 2016 22:19:40 +0530 Subject: [PATCH] Fixes to if-modified-since in activity provider --- .../mgt/jaxrs/service/impl/ActivityProviderServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/ActivityProviderServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/ActivityProviderServiceImpl.java index 7f0253a016..7b24aac133 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/ActivityProviderServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/ActivityProviderServiceImpl.java @@ -79,7 +79,6 @@ public class ActivityProviderServiceImpl implements ActivityInfoProviderService @QueryParam("limit") int limit, @HeaderParam("If-Modified-Since") String ifModifiedSince) { - long sinceTimestamp = 0; boolean isSinceModifiedIsSet = false; if (ifModifiedSince != null && !ifModifiedSince.isEmpty()) { @@ -103,7 +102,8 @@ public class ActivityProviderServiceImpl implements ActivityInfoProviderService activities = dmService.getActivitiesUpdatedAfter(timestamp); if (activities == null || activities.size() == 0) { if (isSinceModifiedIsSet) { - return Response.status(Response.Status.NOT_MODIFIED).entity(activities).build(); + return Response.status(Response.Status.NOT_MODIFIED).entity("No activities " + + "after the timestamp provided in 'If-Modified-Since' header").build(); } throw new NotFoundException( new ErrorResponse.ErrorResponseBuilder().setCode(404l).setMessage("No activities " +