public final class ResourceType extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
APPS_PREFIX
Deprecated.
Search paths are confurable and should not be hard-coded.
|
static String |
LIBS_PREFIX
Deprecated.
Search paths are confurable and should not be hard-coded.
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
equals(String resourceType,
String anotherResourceType)
Deprecated.
Please use
equals(String, String, ResourceResolver) instead. |
static boolean |
equals(String resourceType,
String anotherResourceType,
org.apache.sling.api.resource.ResourceResolver resourceResolver)
Returns
true if the given resource type are equal. |
static boolean |
is(org.apache.sling.api.resource.Resource resource,
String resourceType)
Returns
true if the resource type or any of the resource's super type(s) equals the given resource
type. |
static String |
makeAbsolute(String resourceType,
org.apache.sling.api.resource.ResourceResolver resourceResolver)
Converts the resource type to an absolute path.
|
static String |
makeRelative(String resourceType)
Deprecated.
Please use
makeRelative(String, ResourceResolver) instead. |
static String |
makeRelative(String resourceType,
org.apache.sling.api.resource.ResourceResolver resourceResolver)
Makes the given resource type relative by stripping off any search path prefix.
|
@Deprecated public static final String APPS_PREFIX
@Deprecated public static final String LIBS_PREFIX
public static String makeAbsolute(String resourceType, org.apache.sling.api.resource.ResourceResolver resourceResolver)
resourceType - Resource typeresourceResolver - Resource resolverpublic static String makeRelative(String resourceType, org.apache.sling.api.resource.ResourceResolver resourceResolver)
resourceType - The resource type to make relative.resourceResolver - Resource resolver@Deprecated public static String makeRelative(String resourceType)
makeRelative(String, ResourceResolver) instead.resourceType - The resource type to make relative.public static boolean equals(String resourceType, String anotherResourceType, org.apache.sling.api.resource.ResourceResolver resourceResolver)
true if the given resource type are equal.
In case the value of any of the given resource types starts with /apps/ or /libs/ prefix this is removed before
doing the comparison.resourceType - A resource typeanotherResourceType - Another resource type to compare withresourceResolver - Resource resolvertrue if the resource type equals the given resource type.@Deprecated public static boolean equals(String resourceType, String anotherResourceType)
equals(String, String, ResourceResolver) instead.true if the given resource type are equal.
In case the value of any of the given resource types starts with /apps/ or /libs/ prefix this is removed before
doing the comparison.resourceType - A resource typeanotherResourceType - Another resource type to compare withtrue if the resource type equals the given resource type.public static boolean is(org.apache.sling.api.resource.Resource resource,
String resourceType)
true if the resource type or any of the resource's super type(s) equals the given resource
type.
This implementation is equal to ResourceResolver.isResourceType(Resource, String) - but in earlier sling
version the comparison check did not take potentieal mixtures of relative and absolute resource types into account.
This method respects this.resource - The resource to checkresourceType - The resource type to check this resource against.true if the resource type or any of the resource's super type(s) equals the given resource
type. false is also returned if resource orresourceType are
null.Copyright © 2014–2018 wcm.io. All rights reserved.