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(@NotNull String resourceType,
@NotNull String anotherResourceType)
Deprecated.
Please use
equals(String, String, ResourceResolver) instead. |
static boolean |
equals(@NotNull String resourceType,
@NotNull String anotherResourceType,
@NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver)
Returns
true if the given resource type are equal. |
static boolean |
is(@Nullable org.apache.sling.api.resource.Resource resource,
@Nullable String resourceType)
Returns
true if the resource type or any of the resource's super type(s) equals the given resource
type. |
static @NotNull String |
makeAbsolute(@NotNull String resourceType,
@NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver)
Converts the resource type to an absolute path.
|
static @NotNull String |
makeRelative(@NotNull String resourceType)
Deprecated.
Please use
makeRelative(String, ResourceResolver) instead. |
static @NotNull String |
makeRelative(@NotNull String resourceType,
@NotNull 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
@NotNull public static @NotNull String makeAbsolute(@NotNull @NotNull String resourceType, @NotNull @NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver)
resourceType - Resource typeresourceResolver - Resource resolver@NotNull public static @NotNull String makeRelative(@NotNull @NotNull String resourceType, @NotNull @NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver)
resourceType - The resource type to make relative.resourceResolver - Resource resolver@Deprecated @NotNull public static @NotNull String makeRelative(@NotNull @NotNull String resourceType)
makeRelative(String, ResourceResolver) instead.resourceType - The resource type to make relative.public static boolean equals(@NotNull
@NotNull String resourceType,
@NotNull
@NotNull String anotherResourceType,
@NotNull
@NotNull 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(@NotNull @NotNull String resourceType, @NotNull @NotNull 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(@Nullable
@Nullable org.apache.sling.api.resource.Resource resource,
@Nullable
@Nullable 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–2019 wcm.io. All rights reserved.