com.sap.ip.me.api.services
Class URLFormatter

java.lang.Object
  extended bycom.sap.ip.me.api.services.URLFormatter

public class URLFormatter
extends java.lang.Object

This class provides methods that support the prevention of browser caching.

Author:
SAP

Constructor Summary
URLFormatter()
           
 
Method Summary
static java.lang.String getUniqueMIHomeURL()
          Returns a unique absolute URL string that represents a link to the Mobile Engine homepage.
static java.lang.String getUniqueURL(java.lang.String relativeURL)
          Returns an unique absolute URL string that is created on base of a given relative URL string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

URLFormatter

public URLFormatter()
Method Detail

getUniqueMIHomeURL

public static java.lang.String getUniqueMIHomeURL()
Returns a unique absolute URL string that represents a link to the Mobile Engine homepage.

Returns:
Link to Mobile Engine homepage

getUniqueURL

public static java.lang.String getUniqueURL(java.lang.String relativeURL)
Returns an unique absolute URL string that is created on base of a given relative URL string. For that purpose the relative URL string is enhanced by a prefix containing the protocol (always: http), the host and the port information from the Mobile Engine configuartion. Furthermore the current time in milliseconds is added in the query part of the URL string. In fact this makes the URL string unique.

Examples:

Given relative URL string Returned unique URL
/test/xyz.html http://localhost:4444/test/xyz.html?1064413138617
xyz.html?param=value& http://127.0.0.1:4444/xyz.html?param=value&1064413138617&
test/appl/xyz.html?p=v#ref http://localhost:3333/test/app/xyz.html?p=v&1064413138617#ref

If the empty string or null is given as input value then the empty string is returned. The given relative URL string is not validated for syntactical correctness.

Parameters:
relativeURL - A relative URL string that has to be made unique.
Returns:
An absolute URL string that is unique and corresponds to the given relative URL string.


Copyright © 2005 SAP AG. All Rights Reserved.