SAP NetWeaver '04

com.sapportals.wcm.util.uri
Class URI

[contained in: com.sap.netweaver.bc.util.par - bc.util.public_api.jar]
java.lang.Object
  |
  +--com.sapportals.wcm.util.uri.URI
All Implemented Interfaces:
java.lang.Comparable

Deprecated. as of EP 5.0 SP3, replaced by RID

public final class URI
extends java.lang.Object
implements java.lang.Comparable

An URI (better WcmPath) is an identifier for a WCM resource.

An URI holds all information to identify a WCM resource and retrieve it via the WCM Framework. Each WCM resource has its unique URI.

A URI has a path-like structure, like a path in a file system and follows the following production:

   URI         ::= '/' 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 URIs "/docs/" and /docs" are considered equal. There is special handling for the root collection "/", which is not equal to the empty URI "".

Copyright (c) SAP AG 2001-2002


Constructor Summary
URI(java.lang.String uri)
          Deprecated. Create a new UTI with given path, without query
URI(java.lang.String path, java.lang.String query)
          Deprecated. Create a new URI with given path and query string
 
Method Summary
 URI add(java.lang.String uri)
          Deprecated. Concatenate this URI with the given URI.
 URI add(URI uri)
          Deprecated. Concatenate this URI with the given URI.
 URI addQueryParameter(java.util.Properties parameter)
          Deprecated. as of NW04. Use setQueryParameter
 int compareTo(java.lang.Object o)
          Deprecated.  
 URI decode()
          Deprecated. as of NW04. URI objects are never decoded
 URI encode()
          Deprecated. as of NW04. URI objects are never encoded
 boolean endsWithSlash()
          Deprecated. Return if this URI ends with a slash.
 boolean equals(java.lang.Object other)
          Deprecated. Determine if this URI equals other.
 boolean equals(java.lang.String other)
          Deprecated. Determine if this URI equals other.
 boolean equals(URI other)
          Deprecated. Determine if this URI equals other.
 java.lang.String extension()
          Deprecated. Get the extension part of the resource name.
 java.lang.String getPath()
          Deprecated. Return the path component of this URI.
 java.lang.String getQuery()
          Deprecated. Return the query component of this URI (null if it does not exist).
 java.util.Properties getQueryParameter()
          Deprecated. Get the query parameters of the URI.
 int hashCode()
          Deprecated.  
 boolean isAbsolute()
          Deprecated. Return if URI is absolute, e.g. start with a slash.
 boolean isAncestorOf(URI child)
          Deprecated. Determine if this URI is an ancestor (parent or parent's parent, etc.) of the given child URI.
 boolean isRoot()
          Deprecated. Return if URI is root collection.
 int length()
          Deprecated. Return length of URI in string representation
 URI name()
          Deprecated. Get the name of the resource, designated by this URI.
 URI parent()
          Deprecated. Get the URI of the parent collection of this URI
 URI removeExtension()
          Deprecated. Remove the (optional) extension of the resource name.
 URI removeName()
          Deprecated. Remove the name of the resource, same as parent()
 URI removeRoot()
          Deprecated. Get a new URI with the toplevel collection removed
 URI removeTrailingSlash()
          Deprecated. Remove a possible trailing slash from the URI.
 URI resolveRelativeURI(java.lang.String uri)
          Deprecated. Resolve relative URIs
 URI root()
          Deprecated. Get URI of toplevel collection (below root) of this URI.
 URI setQueryParameter(java.util.Properties parameter)
          Deprecated. Create a new URI by setting the given parameters as query part of this URI.
 java.util.List split()
          Deprecated. Splits the URI into its path components
 java.lang.String toExternalForm()
          Deprecated. Convert this URI to a representation usable in W3C Uri References.
 java.lang.String toString()
          Deprecated. Returns string representation of this URI
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

URI

public URI(java.lang.String path,
           java.lang.String query)
Deprecated. 
Create a new URI with given path and query string
Parameters:
path - of URI
query - part or URI (can be null)

URI

public URI(java.lang.String uri)
Deprecated. 
Create a new UTI with given path, without query
Parameters:
uri - TBD: Description of the incoming method parameter
Method Detail

encode

public URI encode()
Deprecated. as of NW04. URI objects are never encoded

Returns:
TBD: Description of the outgoing return value

decode

public URI decode()
Deprecated. as of NW04. URI objects are never decoded

Returns:
TBD: Description of the outgoing return value

toExternalForm

public java.lang.String toExternalForm()
Deprecated. 
Convert this URI to a representation usable in W3C Uri References. Non-ascii and reserved characters are encoded.

Note that such an encoded string cannot be used to construct an new URI object! The path in URI objects is never, ever encoded.

Returns:
URI in W3C string representation

getPath

public java.lang.String getPath()
Deprecated. 
Return the path component of this URI.
Returns:
the path component

getQuery

public java.lang.String getQuery()
Deprecated. 
Return the query component of this URI (null if it does not exist).
Returns:
the query component

getQueryParameter

public java.util.Properties getQueryParameter()
Deprecated. 
Get the query parameters of the URI. Will return an empty Properties object if URI has no query part. Modifying the Properties object has no effect on the URI itself.
Returns:
query parameters as Properties

root

public URI root()
Deprecated. 
Get URI of toplevel collection (below root) of this URI.

The root URI of a toplevel collection is the root collection URI. The root URI of the root URI is the root URI itself.

Returns:
URI of toplevel collection below root

name

public URI name()
Deprecated. 
Get the name of the resource, designated by this URI. If the URI has query parameter, these are discarded.
Returns:
the name of the resource, designated by this URI

parent

public URI parent()
Deprecated. 
Get the URI of the parent collection of this URI
Returns:
the URI of the parent collection

extension

public java.lang.String extension()
Deprecated. 
Get the extension part of the resource name. Returns the empty string if there is no extension.
Returns:
the extension part of the resource name

removeRoot

public URI removeRoot()
Deprecated. 
Get a new URI with the toplevel collection removed
Returns:
URI with toplevel collection removed

removeName

public URI removeName()
Deprecated. 
Remove the name of the resource, same as parent()
Returns:
parent of the resource

removeExtension

public URI removeExtension()
Deprecated. 
Remove the (optional) extension of the resource name. Query parameters are discarded.
Returns:
uri with extension of name removed

removeTrailingSlash

public URI removeTrailingSlash()
Deprecated. 
Remove a possible trailing slash from the URI. Query parameters are preserved.
Returns:
URI without trailing slash

isAbsolute

public boolean isAbsolute()
Deprecated. 
Return if URI is absolute, e.g. start with a slash.
Returns:
if URI is absolute path

isRoot

public boolean isRoot()
Deprecated. 
Return if URI is root collection.
Returns:
if this is the root collection

isAncestorOf

public boolean isAncestorOf(URI child)
Deprecated. 
Determine if this URI is an ancestor (parent or parent's parent, etc.) of the given child URI.
Parameters:
child - to test against
Returns:
if this URI is ancestor of child

endsWithSlash

public boolean endsWithSlash()
Deprecated. 
Return if this URI ends with a slash.
Returns:
if this URI ends with a slash

add

public URI add(java.lang.String uri)
Deprecated. 
Concatenate this URI with the given URI. Treats this URI as if it ends with a slash and the parameter URI as if it starts without a slash.
Parameters:
uri - to append to this
Returns:
new URI as concatenation

add

public URI add(URI uri)
Deprecated. 
Concatenate this URI with the given URI. Treats this URI as if it ends with a slash and the parameter URI as if it starts without a slash.
Parameters:
uri - to append to this
Returns:
new URI as concatenation

split

public java.util.List split()
Deprecated. 
Splits the URI into its path components
Returns:
List of Strings

toString

public java.lang.String toString()
Deprecated. 
Returns string representation of this URI
Overrides:
toString in class java.lang.Object
Returns:
this URI as string

equals

public boolean equals(URI other)
Deprecated. 
Determine if this URI equals other.
Parameters:
other - URI
Returns:
if this URI equals other

equals

public boolean equals(java.lang.String other)
Deprecated. 
Determine if this URI equals other.
Parameters:
other - URI (string representation)
Returns:
if this URI equals other

equals

public boolean equals(java.lang.Object other)
Deprecated. 
Determine if this URI equals other. Equality is defined for instances of URI only.
Overrides:
equals in class java.lang.Object
Parameters:
other -  
Returns:
if this URI equals other

hashCode

public int hashCode()
Deprecated. 
Overrides:
hashCode in class java.lang.Object

length

public int length()
Deprecated. 
Return length of URI in string representation
Returns:
length of URI in string representation

resolveRelativeURI

public URI resolveRelativeURI(java.lang.String uri)
Deprecated. 
Resolve relative URIs
Parameters:
uri - An URI, which may be relative or absolute
Returns:
TBD: Description of the outgoing return value

addQueryParameter

public URI addQueryParameter(java.util.Properties parameter)
Deprecated. as of NW04. Use setQueryParameter

Create a new URI by setting the given parameters as query part of this URI.
Parameters:
parameter - to set to query
Returns:
new URI with parameter in query

setQueryParameter

public URI setQueryParameter(java.util.Properties parameter)
Deprecated. 
Create a new URI by setting the given parameters as query part of this URI.
Parameters:
parameter - to set to query
Returns:
new URI with parameter in query

compareTo

public int compareTo(java.lang.Object o)
Deprecated. 
Specified by:
compareTo in interface java.lang.Comparable

SAP NetWeaver '04

Copyright © 2004 by SAP AG. All Rights Reserved.
SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.

These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.