public final class Rid extends Object implements Comparable, Serializable, IRid
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 'and' query | empty parameter ::= varname | varname '=' value varname ::= any char except '=', 'and' value ::= any character except 'and'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-2003
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 |
---|---|
IRid |
add(IRid uri)
Concatenate this Rid with the given Rid.
|
IRid |
add(String uri)
Concatenate this Rid with the given Rid.
|
IRid |
addPathSegment(String segment)
Adds a path segment.
|
IRid |
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(IRid other)
Determine if this Rid equals other.
|
boolean |
equals(Object other)
Determine if this Rid equals other.
|
String |
extension()
Get the extension part of the resource name.
|
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 IRid |
getRid(String path,
String query) |
int |
hashCode() |
boolean |
isAbsolute()
Return if Rid is absolute, e.g. start with a slash.
|
boolean |
isAncestorOf(IRid child)
Determine if this Rid is an ancestor (parent or parent's parent, etc.) of
the given child Rid.
|
boolean |
isAncestorOfOrSelf(IRid 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
|
IRid |
name()
Get the name of the resource, designated by this Rid.
|
IRid |
parent()
Get the Rid of the parent collection of this Rid
|
IRid |
removeExtension()
Remove the (optional) extension of the resource name.
|
IRid |
removeName()
Remove the name of the resource, same as parent()
|
IRid |
removeRoot()
Get a new Rid with the toplevel collection removed
|
IRid |
removeTrailingSlash()
Remove a possible trailing slash from the Rid.
|
IRid |
resolveRelativeRid(String uri)
Resolve relative Rids
|
IRid |
root()
Get Rid of toplevel collection (below root) of this Rid.
|
IRid |
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)
uri
- TBD: Description of the incoming method parameterpublic Rid encode()
public Rid decode()
public String toExternalForm()
IRid
Note that such an encoded string cannot be used to construct an new Rid object! The path in Rid objects is never, ever encoded.
toExternalForm
in interface IRid
public String getPath()
public String getQuery()
public Properties getQueryParameter()
Properties
object has no
effect on the Rid itself.getQueryParameter
in interface IRid
Properties
public IRid 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 IRid name()
public IRid parent()
public String extension()
public IRid removeRoot()
removeRoot
in interface IRid
public IRid removeName()
removeName
in interface IRid
public IRid removeExtension()
removeExtension
in interface IRid
public IRid removeTrailingSlash()
removeTrailingSlash
in interface IRid
public boolean isAbsolute()
isAbsolute
in interface IRid
public boolean isRoot()
public boolean isAncestorOf(IRid child)
isAncestorOf
in interface IRid
child
- to test againstpublic boolean isAncestorOfOrSelf(IRid child)
isAncestorOfOrSelf
in interface IRid
child
- to test againstpublic boolean endsWithSlash()
endsWithSlash
in interface IRid
public IRid 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.
public IRid add(IRid uri)
public List split()
public String toString()
public boolean equals(IRid other)
other
- Ridpublic boolean equals(Object other)
public int length()
public IRid resolveRelativeRid(String uri)
resolveRelativeRid
in interface IRid
uri
- An Rid, which may be relative or absolutepublic IRid addPathSegment(String segment) throws WcmException
addPathSegment
in interface IRid
segment
- String containing the new path segmentWcmException
- if segment contains characters that aren't allowed in
path segmentspublic IRid addQueryParameter(Properties parameter)
parameter
- to set to querypublic IRid setQueryParameter(Properties parameter)
setQueryParameter
in interface IRid
parameter
- to set to querypublic 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