SAP NetWeaver '04

com.sap.netweaver.bc.rf.common
Class HttpUrl

[contained in: com.sap.netweaver.bc.rf.par - bc.rf.common_api.jar]
java.lang.Object
  |
  +--com.sap.netweaver.bc.rf.common.HttpUrl
All Implemented Interfaces:
IAbsoluteUri, IHierarchicalUri

public class HttpUrl
extends java.lang.Object
implements IHierarchicalUri

An IHierarchicalUri implementation for HTTP/HTTPS URLs.

Copyright (c) SAP AG 2001-2003


Field Summary
static int DEFAULT_PORT
           
 
Constructor Summary
HttpUrl(java.lang.String scheme, java.lang.String host, int port, java.lang.String path, java.lang.String query)
           
HttpUrl(java.lang.String scheme, java.lang.String authority, java.lang.String path, java.lang.String query)
           
 
Method Summary
 IHierarchicalUri appendPath(java.lang.String path)
          Append the given path segment to the current path of this uri.
 boolean equals(HttpUrl other)
           
 boolean equals(IAbsoluteUri other)
           
 boolean equals(IHierarchicalUri other)
           
 boolean equals(java.lang.Object other)
           
 java.lang.String getAuthority()
          Return authority part of this hierarchical Uri.
 java.lang.String getHost()
          Return the host name of this uri
 java.lang.String getPath()
          Return path of this Uri or, if not there, the emtpy string
 java.lang.String[] getPathSegments()
          Return the segments of the uri path
 int getPort()
          Return the port number of this uri
 java.lang.String getQuery()
          Return query of this Uri or, if not there, null
 java.lang.String getRemainder()
          Get the remainder of this Uri (part after scheme without ':').
 IHierarchicalUri getRoot()
          Returns the uri of the root collection (path = "/").
 java.lang.String getScheme()
          Get the scheme of this Uri (without ':').
 int hashCode()
           
 boolean isAncestorOf(IHierarchicalUri other)
          Determine if this Uri is ancestor of other uri
 IUriReference mapToAbsolutePath(IUriReference ref)
          Given this Uri as the base, map the uri reference to a uri reference with absolute path component.
 IUriReference mapToAbsolutePath(Rid wcmPath)
          TBD: Description of the Method.
 IUriReference mapToAbsolutePath(Rid wcmPath, UriCodec codec)
          TBD: Description of the Method.
 IHierarchicalUri mapToAbsoluteUri(Rid wcmPath)
          TBD: Description of the Method.
 IHierarchicalUri mapToAbsoluteUri(Rid wcmPath, UriCodec codec)
          TBD: Description of the Method.
 Rid mapToResourceID(IUriReference ref)
          TBD: Description of the Method.
 Rid mapToResourceID(IUriReference ref, UriCodec codec)
          TBD: Description of the Method.
protected static java.lang.StringBuffer normalizePath(java.lang.StringBuffer sb)
           
 IAbsoluteUri resolve(IUriReference reference)
          Resolve the uri reference in the context of this Uri.
 IHierarchicalUri setPath(java.lang.String path)
          Construct a new object of same type with the given path.
 IHierarchicalUri setQuery(java.lang.String query)
          Construct a new object of same type with the given query.
 java.lang.String toExternalForm()
          Returns a string representation according to RFC 2396 of this uri.
 java.lang.String toString()
           
 IUriReference unresolve(IHierarchicalUri other, java.lang.String fragment)
          Convert the given uri to a relative uri reference with this uri as base.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_PORT

public static int DEFAULT_PORT
Constructor Detail

HttpUrl

public HttpUrl(java.lang.String scheme,
               java.lang.String host,
               int port,
               java.lang.String path,
               java.lang.String query)
        throws java.lang.IllegalArgumentException

HttpUrl

public HttpUrl(java.lang.String scheme,
               java.lang.String authority,
               java.lang.String path,
               java.lang.String query)
        throws java.lang.IllegalArgumentException
Method Detail

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object

equals

public boolean equals(IAbsoluteUri other)

equals

public boolean equals(IHierarchicalUri other)

equals

public boolean equals(HttpUrl other)

appendPath

public IHierarchicalUri appendPath(java.lang.String path)
Append the given path segment to the current path of this uri. Takes care of leading, trailing slashes. Note that the path must be uri encoded or the resulting uri is not valid.
Specified by:
appendPath in interface IHierarchicalUri
Parameters:
path - TBD: Description of the incoming method parameter
Returns:
new uri with concatenated path

getScheme

public java.lang.String getScheme()
Get the scheme of this Uri (without ':').
Specified by:
getScheme in interface IAbsoluteUri
Returns:
scheme of this Uri

getRemainder

public java.lang.String getRemainder()
Get the remainder of this Uri (part after scheme without ':').
Specified by:
getRemainder in interface IAbsoluteUri
Returns:
remainder of this Uri

getAuthority

public java.lang.String getAuthority()
Return authority part of this hierarchical Uri.
Specified by:
getAuthority in interface IHierarchicalUri
Returns:
authority part of this hierarchical Uri

getHost

public java.lang.String getHost()
Return the host name of this uri
Returns:
the host name

getPort

public int getPort()
Return the port number of this uri
Returns:
the port number

getPath

public java.lang.String getPath()
Return path of this Uri or, if not there, the emtpy string
Specified by:
getPath in interface IHierarchicalUri
Returns:
path of this uri

getPathSegments

public java.lang.String[] getPathSegments()
Return the segments of the uri path
Specified by:
getPathSegments in interface IHierarchicalUri
Returns:
segments of uri path

getQuery

public java.lang.String getQuery()
Return query of this Uri or, if not there, null
Specified by:
getQuery in interface IHierarchicalUri
Returns:
query of this uri or null

getRoot

public IHierarchicalUri getRoot()
Returns the uri of the root collection (path = "/").
Specified by:
getRoot in interface IHierarchicalUri
Returns:
uri of server root

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hashCode

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

isAncestorOf

public boolean isAncestorOf(IHierarchicalUri other)
Determine if this Uri is ancestor of other uri
Specified by:
isAncestorOf in interface IHierarchicalUri
Parameters:
other - TBD: Description of the incoming method parameter
Returns:
if this Uri is ancestor of other uri

resolve

public IAbsoluteUri resolve(IUriReference reference)
Resolve the uri reference in the context of this Uri.
Specified by:
resolve in interface IAbsoluteUri
Parameters:
reference - TBD: Description of the incoming method parameter
Returns:
resolved reference as absolute uri without fragment identifier

unresolve

public IUriReference unresolve(IHierarchicalUri other,
                               java.lang.String fragment)
Convert the given uri to a relative uri reference with this uri as base. If this uri is no ancestor of the other uri, an absolute uri refernce is returned.
Specified by:
unresolve in interface IHierarchicalUri
Parameters:
other - uri to unresolve
fragment - to add to result reference
Returns:
uri reference relative to this uri

mapToResourceID

public Rid mapToResourceID(IUriReference ref)
Description copied from interface: IHierarchicalUri
TBD: Description of the Method.
Specified by:
mapToResourceID in interface IHierarchicalUri
Following copied from interface: com.sap.netweaver.bc.rf.common.IHierarchicalUri
Parameters:
ref - TBD: Description of the incoming method parameter
Returns:
TBD: Description of the outgoing return value

mapToResourceID

public Rid mapToResourceID(IUriReference ref,
                           UriCodec codec)
Description copied from interface: IHierarchicalUri
TBD: Description of the Method.
Specified by:
mapToResourceID in interface IHierarchicalUri
Following copied from interface: com.sap.netweaver.bc.rf.common.IHierarchicalUri
Parameters:
ref - TBD: Description of the incoming method parameter
codec - TBD: Description of the incoming method parameter
Returns:
TBD: Description of the outgoing return value

mapToAbsolutePath

public IUriReference mapToAbsolutePath(IUriReference ref)
Given this Uri as the base, map the uri reference to a uri reference with absolute path component.
 Example: "http://host/docs" + "test%203", gives "/test%203"
 Example: "http://host/docs/" + "test%203", gives "/docs/test%203"
 Example: "http://host/docs" + "http://another/docs/test", gives "http://another/docs/test"
 
Specified by:
mapToAbsolutePath in interface IHierarchicalUri
Parameters:
ref - TBD: Description of the incoming method parameter
Returns:
the mapped uri reference

mapToAbsolutePath

public IUriReference mapToAbsolutePath(Rid wcmPath)
Description copied from interface: IHierarchicalUri
TBD: Description of the Method.
Specified by:
mapToAbsolutePath in interface IHierarchicalUri
Following copied from interface: com.sap.netweaver.bc.rf.common.IHierarchicalUri
Parameters:
wcmPath - TBD: Description of the incoming method parameter
Returns:
TBD: Description of the outgoing return value

mapToAbsolutePath

public IUriReference mapToAbsolutePath(Rid wcmPath,
                                       UriCodec codec)
Description copied from interface: IHierarchicalUri
TBD: Description of the Method.
Specified by:
mapToAbsolutePath in interface IHierarchicalUri
Following copied from interface: com.sap.netweaver.bc.rf.common.IHierarchicalUri
Parameters:
wcmPath - TBD: Description of the incoming method parameter
codec - TBD: Description of the incoming method parameter
Returns:
TBD: Description of the outgoing return value

mapToAbsoluteUri

public IHierarchicalUri mapToAbsoluteUri(Rid wcmPath)
Description copied from interface: IHierarchicalUri
TBD: Description of the Method.
Specified by:
mapToAbsoluteUri in interface IHierarchicalUri
Following copied from interface: com.sap.netweaver.bc.rf.common.IHierarchicalUri
Parameters:
wcmPath - TBD: Description of the incoming method parameter
Returns:
TBD: Description of the outgoing return value

mapToAbsoluteUri

public IHierarchicalUri mapToAbsoluteUri(Rid wcmPath,
                                         UriCodec codec)
Description copied from interface: IHierarchicalUri
TBD: Description of the Method.
Specified by:
mapToAbsoluteUri in interface IHierarchicalUri
Following copied from interface: com.sap.netweaver.bc.rf.common.IHierarchicalUri
Parameters:
wcmPath - TBD: Description of the incoming method parameter
codec - TBD: Description of the incoming method parameter
Returns:
TBD: Description of the outgoing return value

setQuery

public IHierarchicalUri setQuery(java.lang.String query)
Description copied from interface: IHierarchicalUri
Construct a new object of same type with the given query. If query is null , the new uri will be without query. The query string must be in RFC 2396 encoded form. See UriQuery for manipulation of query strings.
Specified by:
setQuery in interface IHierarchicalUri
Following copied from interface: com.sap.netweaver.bc.rf.common.IHierarchicalUri
Parameters:
query - encoded query string for returned object
Returns:
hierarchical uri of same type as this

setPath

public IHierarchicalUri setPath(java.lang.String path)
Description copied from interface: IHierarchicalUri
Construct a new object of same type with the given path. If path is null , the new uri will have the root path /. The path string must be in RFC 2396 encoded form. See URICodec. The query of the resulting uri will always be empty.
Specified by:
setPath in interface IHierarchicalUri
Following copied from interface: com.sap.netweaver.bc.rf.common.IHierarchicalUri
Parameters:
path - encoded path string for returned object
Returns:
hierarchical uri of same type as this

toExternalForm

public java.lang.String toExternalForm()
Description copied from interface: IAbsoluteUri
Returns a string representation according to RFC 2396 of this uri.
Specified by:
toExternalForm in interface IAbsoluteUri
Following copied from interface: com.sap.netweaver.bc.rf.common.IAbsoluteUri
Returns:
string in URI format

normalizePath

protected static java.lang.StringBuffer normalizePath(java.lang.StringBuffer sb)

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.