public final class RID extends Object implements Comparable, Serializable
A RID has a path-like structure, like a path in a file system and follows the following production:
RID ::= '/' pathsegment | '/' pathsegment '?' query pathsegment ::= name | name '/' pathsegment | empty name ::= any char except '/' query ::= parameter | parameter '&' query | empty parameter ::= varname | varname '=' value varname ::= any char except '=', '&' value ::= any character except '&'Equality is defined as ignoring trailing '/' characters. Thus, the RIDs "/docs/" and /docs" are considered equal. There is special handling for the root collection "/", which is not equal to the empty RID "".
Copyright (c) SAP AG 2001-2005
Modifier and Type | Field and Description |
---|---|
static char |
PATH_SEPARATOR |
Constructor and Description |
---|
RID(String uri)
Deprecated.
as of NW04. Use RID.getRID(uri)
|
RID(String path,
String query)
Deprecated.
as of NW04. Use RID.getRID(path, query)
|
Modifier and Type | Method and Description |
---|---|
RID |
add(RID uri)
Concatenate this RID with the given RID.
|
RID |
add(String uri)
Concatenate this RID with the given RID.
|
RID |
addPathSegment(String segment)
Adds a path segment.
|
RID |
addQueryParameter(Properties parameter)
Deprecated.
as of NW04. Use setQueryParameter
|
int |
compareTo(Object o) |
RID |
decode()
Deprecated.
as of NW04. RID objects are never decoded
|
RID |
encode()
Deprecated.
as of NW04. RID objects are never encoded
|
boolean |
endsWithSlash()
Return if this RID ends with a slash.
|
boolean |
equals(Object other)
Determine if this RID equals other.
|
boolean |
equals(RID other)
Determine if this RID equals other.
|
boolean |
equals(String other)
Determine if this RID equals other.
|
String |
extension()
Get the extension part of the resource name.
|
String |
getFirstSegment()
Gets the first (top level) segment of the path.
|
String |
getHashId()
Returns the hash ID of this RID.
|
String |
getPath()
Return the path component of this RID.
|
String |
getQuery()
Return the query component of this RID (null if it does not exist).
|
Properties |
getQueryParameter()
Get the query parameters of the RID.
|
static RID |
getRID(String uri) |
static RID |
getRID(String path,
String query) |
int |
hashCode() |
boolean |
isAbsolute()
Return if RID is absolute, e.g. start with a slash.
|
boolean |
isAncestorOf(RID child)
Determine if this RID is an ancestor (parent or parent's parent, etc.) of
the given child RID.
|
boolean |
isAncestorOfOrSelf(RID child)
Determine if this RID is an ancestor (parent or parent's parent, etc.) of
the given child RID or the same.
|
boolean |
isRoot()
Return if RID is root collection.
|
int |
length()
Return length of RID in string representation
|
RID |
name()
Get the name of the resource, designated by this RID.
|
RID |
parent()
Get the RID of the parent collection of this RID
|
RID |
removeExtension()
Remove the (optional) extension of the resource name.
|
RID |
removeName()
Remove the name of the resource, same as parent()
|
RID |
removeRoot()
Get a new RID with the toplevel collection removed
|
RID |
removeTrailingSlash()
Remove a possible trailing slash from the RID.
|
RID |
resolveRelativeRID(String uri)
Resolve relative RIDs
|
RID |
root()
Get RID of toplevel collection (below root) of this RID.
|
RID |
setQueryParameter(Properties parameter)
Create a new RID by setting the given parameters as query part of this RID.
|
List |
split()
Splits the RID into its path components
|
String |
toExternalForm()
Convert this RID to a representation usable in RFC2396 URI references.
|
String |
toString()
Returns string representation of this RID
|
public static final char PATH_SEPARATOR
public RID(String path, String query)
path
- of RIDquery
- part or RID (can be null)public RID(String uri)
public String getHashId()
String
representing the hash IDpublic RID encode()
public RID decode()
public String toExternalForm()
Note that such an encoded string cannot be used to construct an new RID object! The path in RID objects is never, ever encoded.
public String getPath()
public String getQuery()
public Properties getQueryParameter()
Properties
object has no
effect on the RID itself.Properties
public RID root()
The root RID of a toplevel collection is the root collection RID. The root RID of the root RID is the root RID itself.
public RID name()
public RID parent()
public String extension()
public RID removeRoot()
public RID removeName()
public RID removeExtension()
public RID removeTrailingSlash()
public boolean isAbsolute()
public boolean isRoot()
public boolean isAncestorOf(RID child)
child
- to test againstpublic boolean isAncestorOfOrSelf(RID child)
child
- to test againstpublic boolean endsWithSlash()
public RID add(String uri)
Note: do not use this method to add path segments, as the parameter is
parsed as legal RID, not as a legal RID segment; use addPathSegment(String)
instead.
uri
- to append to thispublic RID add(RID uri)
uri
- to append to thispublic String toString()
public boolean equals(RID other)
other
- RIDpublic boolean equals(String other)
other
- RID (string representation)public boolean equals(Object other)
public int length()
public RID resolveRelativeRID(String uri)
uri
- An RID, which may be relative or absolutepublic RID addPathSegment(String segment) throws WcmException
segment
- String containing the new path segmentWcmException
- if segment contains characters that aren't allowed in
path segmentspublic RID addQueryParameter(Properties parameter)
parameter
- to set to querypublic RID setQueryParameter(Properties parameter)
parameter
- to set to querypublic String getFirstSegment()
public int compareTo(Object o)
compareTo
in interface Comparable
Access Rights |
---|
SC | DC | Public Part | ACH |
---|---|---|---|
[sap.com] KMC-CM
|
[sap.com] tc/km/frwk
|
api
|
EP-KM-CM
|
[sap.com] KMC-WPC
|
[sap.com] tc/kmc/wpc/wpcfacade
|
api
|
EP-PIN-WPC-WCM
|
Copyright 2018 SAP AG Complete Copyright Notice