brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From drigod...@apache.org
Subject [2/5] brooklyn-server git commit: fix bug where entity's search path isn't used when retrieving icon url's
Date Wed, 03 May 2017 10:01:13 GMT
fix bug where entity's search path isn't used when retrieving icon url's


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/00d87890
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/00d87890
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/00d87890

Branch: refs/heads/master
Commit: 00d8789040bc4d67b2e787de81b3b8209e888c3a
Parents: 8a6fc6e
Author: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Authored: Fri Apr 28 15:55:42 2017 +0100
Committer: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Committed: Tue May 2 11:43:47 2017 +0100

----------------------------------------------------------------------
 .../org/apache/brooklyn/rest/resources/EntityResource.java     | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/00d87890/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/EntityResource.java
----------------------------------------------------------------------
diff --git a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/EntityResource.java
b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/EntityResource.java
index 1ebaad7..efc8838 100644
--- a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/EntityResource.java
+++ b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/EntityResource.java
@@ -21,6 +21,7 @@ package org.apache.brooklyn.rest.resources;
 import static javax.ws.rs.core.Response.created;
 import static javax.ws.rs.core.Response.status;
 import static javax.ws.rs.core.Response.Status.ACCEPTED;
+import static org.apache.brooklyn.rest.util.WebResourceUtils.serviceAbsoluteUriBuilder;
 
 import java.net.URI;
 import java.util.LinkedList;
@@ -45,6 +46,7 @@ import org.apache.brooklyn.core.mgmt.EntityManagementUtils;
 import org.apache.brooklyn.core.mgmt.EntityManagementUtils.CreationResult;
 import org.apache.brooklyn.core.mgmt.entitlement.EntitlementPredicates;
 import org.apache.brooklyn.core.mgmt.entitlement.Entitlements;
+import org.apache.brooklyn.core.typereg.RegisteredTypes;
 import org.apache.brooklyn.rest.api.EntityApi;
 import org.apache.brooklyn.rest.domain.EntitySummary;
 import org.apache.brooklyn.rest.domain.LocationSummary;
@@ -66,11 +68,11 @@ import com.google.common.collect.FluentIterable;
 import com.google.common.collect.Iterables;
 import com.google.common.collect.Lists;
 import com.google.common.io.Files;
-import static org.apache.brooklyn.rest.util.WebResourceUtils.serviceAbsoluteUriBuilder;
 
 @HaHotStateRequired
 public class EntityResource extends AbstractBrooklynRestResource implements EntityApi {
 
+    @SuppressWarnings("unused")
     private static final Logger log = LoggerFactory.getLogger(EntityResource.class);
 
     @Context
@@ -162,7 +164,7 @@ public class EntityResource extends AbstractBrooklynRestResource implements
Enti
             // paths (ie non-protocol) and
             // NB, for security, file URL's are NOT served
             MediaType mime = WebResourceUtils.getImageMediaTypeFromExtension(Files.getFileExtension(url));
-            Object content = ResourceUtils.create(brooklyn().getCatalogClassLoader()).getResourceFromUrl(url);
+            Object content = ResourceUtils.create(entity).getResourceFromUrl(url);
             return Response.ok(content, mime).build();
         }
 


Mime
View raw message