Package org.eclipse.emf.cdo.util
Class CDOURIUtil
- java.lang.Object
-
- org.eclipse.emf.cdo.util.CDOURIUtil
-
public final class CDOURIUtil extends java.lang.ObjectVarious static methods that may help with CDO-specificURIs.CDO URIs are in one of two different formats, either canonical or connection-aware. The canonical format is:
cdo:// RepositoryUUID / ResourcePath [? Param=Value (& Param=Value)*]
The non-terminals being:- RepositoryUUID: the
UUIDof the repository. By default it's generated when a repository is first started. If the default format is not adequate the UUID value can be overridden in the repository setup with theoverrideUUIDproperty. - ResourcePath: the full path of the
resourcewithin the repository, segments separated by slashes, no leading slash. - Param: one of the following
- prefetch: a boolean value. The value true attempts to load all objects contained by the resource in a single server-round trip and cache the results.
resourcesproperly require theresource setto be configured externally so that the connection to the correct repository can be established, for example:
Note that resources preserve their original URI in the scope of the managingsession.openView(resourceSet);view, that is not necessarily in canonical format.For a description of the connection-aware URI format refer to
CDOURIData.- Since:
- 2.0
- Author:
- Simon McDuff
- RepositoryUUID: the
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringPROTOCOL_NAMEstatic java.lang.StringSEGMENT_SEPARATORstatic charSEGMENT_SEPARATOR_CHAR
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static java.util.List<java.lang.String>analyzePath(java.lang.String path)static java.util.List<java.lang.String>analyzePath(org.eclipse.emf.common.util.URI uri)static voidappendQueryParameter(java.lang.StringBuilder query, java.lang.String parameter, java.lang.String value)static org.eclipse.emf.common.util.URIappendResourcePath(org.eclipse.emf.common.util.URI uri, java.lang.String path)static CDOIDconvertExternalCDOID(org.eclipse.emf.common.util.URI baseURI, CDOID newCDOID)Converting temporary CDOID to External CDOID
e.g.:
baseURI = cdo://2a57dfcf-8f97-4d39-8e17-9d99ae5c4b3c/resB#5/2
newCDOID = OID2
return = cdo://2a57dfcf-8f97-4d39-8e17-9d99ae5c4b3c/resB#1/2static org.eclipse.emf.common.util.URIcreateResourceURI(java.lang.String repositoryUUID, java.lang.String path)Deprecated.This method is subject to removal in a future release.static org.eclipse.emf.common.util.URIcreateResourceURI(CDOSession session, java.lang.String path)Deprecated.This method is subject to removal in a future release.static org.eclipse.emf.common.util.URIcreateResourceURI(CDOView view, java.lang.String path)static java.lang.StringextractRepositoryUUID(org.eclipse.emf.common.util.URI uri)Deprecated.static java.lang.String[]extractResourceFolderAndName(org.eclipse.emf.common.util.URI uri)static java.lang.StringextractResourcePath(org.eclipse.emf.common.util.URI uri)static java.lang.StringformatQuery(java.util.Map<java.lang.String,java.lang.String> parameters)static java.util.Map<java.lang.String,java.lang.String>getParameters(java.lang.String query)static java.lang.StringsanitizePath(java.lang.String path)static org.eclipse.emf.common.util.URItrimResourceInfos(org.eclipse.emf.common.util.URI uri)static voidvalidateURI(org.eclipse.emf.common.util.URI uri)Deprecated.
-
-
-
Field Detail
-
PROTOCOL_NAME
public static final java.lang.String PROTOCOL_NAME
- Since:
- 4.0
- See Also:
- Constant Field Values
-
SEGMENT_SEPARATOR_CHAR
public static final char SEGMENT_SEPARATOR_CHAR
- See Also:
- Constant Field Values
-
SEGMENT_SEPARATOR
public static final java.lang.String SEGMENT_SEPARATOR
-
-
Method Detail
-
extractResourceFolderAndName
public static java.lang.String[] extractResourceFolderAndName(org.eclipse.emf.common.util.URI uri) throws InvalidURIException- Throws:
InvalidURIException
-
extractResourcePath
public static java.lang.String extractResourcePath(org.eclipse.emf.common.util.URI uri) throws InvalidURIException- Throws:
InvalidURIException
-
createResourceURI
public static org.eclipse.emf.common.util.URI createResourceURI(CDOView view, java.lang.String path)
-
convertExternalCDOID
public static CDOID convertExternalCDOID(org.eclipse.emf.common.util.URI baseURI, CDOID newCDOID)
Converting temporary CDOID to External CDOID
e.g.:
baseURI = cdo://2a57dfcf-8f97-4d39-8e17-9d99ae5c4b3c/resB#5/2
newCDOID = OID2
return = cdo://2a57dfcf-8f97-4d39-8e17-9d99ae5c4b3c/resB#1/2
-
sanitizePath
public static java.lang.String sanitizePath(java.lang.String path)
- Since:
- 4.11
-
analyzePath
public static java.util.List<java.lang.String> analyzePath(org.eclipse.emf.common.util.URI uri)
-
analyzePath
public static java.util.List<java.lang.String> analyzePath(java.lang.String path)
-
getParameters
public static java.util.Map<java.lang.String,java.lang.String> getParameters(java.lang.String query)
- Since:
- 4.0
-
formatQuery
public static java.lang.String formatQuery(java.util.Map<java.lang.String,java.lang.String> parameters)
- Since:
- 4.12
-
appendQueryParameter
public static void appendQueryParameter(java.lang.StringBuilder query, java.lang.String parameter, java.lang.String value)- Since:
- 4.12
-
appendResourcePath
public static org.eclipse.emf.common.util.URI appendResourcePath(org.eclipse.emf.common.util.URI uri, java.lang.String path)- Since:
- 4.12
-
trimResourceInfos
public static org.eclipse.emf.common.util.URI trimResourceInfos(org.eclipse.emf.common.util.URI uri)
- Since:
- 4.12
-
validateURI
@Deprecated public static void validateURI(org.eclipse.emf.common.util.URI uri) throws InvalidURIExceptionDeprecated.- Throws:
InvalidURIException
-
extractRepositoryUUID
@Deprecated public static java.lang.String extractRepositoryUUID(org.eclipse.emf.common.util.URI uri)
Deprecated.
-
createResourceURI
@Deprecated public static org.eclipse.emf.common.util.URI createResourceURI(java.lang.String repositoryUUID, java.lang.String path)Deprecated.This method is subject to removal in a future release.cdo://repositoryUUID/path
The path is added at the end of "cdo://repositoryUUID". If path doesn't start with '/', it will be added automatically.
e.g.: /resA or resA will give the same result → cdo://repositoryUUID/resA
authority = repositoryUUID
path = /resA
-
createResourceURI
@Deprecated public static org.eclipse.emf.common.util.URI createResourceURI(CDOSession session, java.lang.String path)
Deprecated.This method is subject to removal in a future release.
-
-