public class RepositoryIdUtils extends Object
Resource.getId() and Resource.getId().| Modifier and Type | Field and Description |
|---|---|
static String |
REPOSITORY_ID_PREFIX
The prefix that is used to identify a repositoryId.
|
| Modifier and Type | Method and Description |
|---|---|
static Documents |
addRepositoryId(Documents documents,
String repositoryId) |
static <T extends Resource> |
addRepositoryId(List<T> resources,
String repositoryId) |
static String |
addRepositoryId(String id,
String repositoryId) |
static <T extends Resource> |
addRepositoryId(T resource,
String repositoryId) |
static List<String> |
extractRepositoryId(List<String> prefixedIds) |
static String |
extractRepositoryId(Resource resource) |
static String |
extractRepositoryId(String prefixedId) |
static String |
replaceRepositoryId(String prefixedId,
String newRepositoryId) |
static boolean |
repositoryIdEquals(String repositoryId1,
String repositoryId2)
Compares repositoryIds considering legacy id
null which defaults to
RepositoryManager.SYSTEM_REPOSITORY_ID. |
static boolean |
resourceIdEquals(String id1,
String id2)
Compares
Resource Ids considering legacy Ids without repositoryId prefix.The prefix pointing to the repositoryId RepositoryManager.SYSTEM_REPOSITORY_ID is optional. |
static List<String> |
stripRepositoryId(List<String> prefixedIds) |
static String |
stripRepositoryId(String prefixedId) |
static <T extends Resource> |
stripRepositoryId(T resource) |
public static final String REPOSITORY_ID_PREFIX
public static <T extends Resource> T stripRepositoryId(T resource)
public static <T extends Resource> T addRepositoryId(T resource, String repositoryId)
public static <T extends Resource> List<T> addRepositoryId(List<T> resources, String repositoryId)
public static String replaceRepositoryId(String prefixedId, String newRepositoryId)
public static boolean resourceIdEquals(String id1, String id2)
Resource Ids considering legacy Ids without repositoryId prefix.RepositoryManager.SYSTEM_REPOSITORY_ID is optional.
Do not confuse with repositoryIdEquals(String, String)
For example:
'{urn:repository:default}{jcr-uuid}ABC' == '{jcr-uuid}ABC'.
However:
'{urn:repository:newRepository}{jcr-uuid}ABC' != '{jcr-uuid}ABC'
public static boolean repositoryIdEquals(String repositoryId1, String repositoryId2)
null which defaults to
RepositoryManager.SYSTEM_REPOSITORY_ID.
Do not confuse with resourceIdEquals(String, String).
For example:
'default == null'
However:
'newRepository != null'
Copyright © 2016 Eclipse Stardust. All Rights Reserved.