code: public static @NotNull String makeAbsolute(@NotNull String resourceType, @NotNull ResourceResolver resourceResolver) {
      if (StringUtils.isEmpty(resourceType) || StringUtils.startsWith(resourceType, "/")) {
        return resourceType;
      }
  
      // first try to resolve path via component manager - because on publish instance the original resource may not accessible
      ComponentManager componentManager = resourceResolver.adaptTo(ComponentManager.class);
      if (componentManager != null) {
        Component component = componentManager.getComponent(resourceType);
        if (component != null) {
          return component.getPath();
        }
        else {
          return resourceType;
        }
      }
  
      // otherwise use resource resolver directly
      Resource resource = resourceResolver.getResource(resourceType);
      if (resource != null) {
        return resource.getPath();
      }
      else {
        return resourceType;
      }
    }
docs: Converts the resource type to an absolute path. If it does not start with "/" the resource is resolved
  via search paths using resource resolver. If not matching resource is found it is returned unchanged.
  @param resourceType Resource type
  @param resourceResolver Resource resolver
  @return Absolute resource type