de.uplanet.lucy.server.composer
Class UrlBuilder

java.lang.Object
  extended by de.uplanet.lucy.server.composer.UrlBuilder

@Scriptable
public final class UrlBuilder
extends Object

Version:
$Revision: 105001 $

Constructor Summary
UrlBuilder()
           
 
Method Summary
static URL createAbsoluteBaseDirectoryUrl(IRequestProcessingContext p_ctx)
           
static URL createAbsoluteBaseDirectoryUrl(IServerBridgeRequest p_request)
          The same URL as createAbsoluteBaseUrl(IServerBridgeRequest) but without the document part in the path.
static URL createAbsoluteBaseUrl(IRequestProcessingContext p_ctx)
           
static URL createAbsoluteBaseUrl(IServerBridgeRequest p_request)
          Create an absolute base URL from the given request.
static URL createBaseUrl(IRequestProcessingContext p_ctx)
           
static URL createBaseUrl(IServerBridgeRequest p_request)
          Create a base URL from the given request.
static URL createDefaultUrl(IRequestProcessingContext p_ctx)
           
static URL createDefaultUrl(IServerBridgeRequest p_request)
          Creates a default URL from the given request.
static URL createPersistentBaseUrl(IServerBridgeRequest p_request)
           
static URL createPersistentDefaultUrl(IServerBridgeRequest p_request)
           
static URL createRequestBaseDirectoryUrl(IRequestProcessingContext p_ctx)
           
static URL createRequestBaseDirectoryUrl(IServerBridgeRequest p_request)
          Reconstructs the URL the client used to make the request.
static URL parseUrl(String p_strUrl)
          Create an URL from the given string.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UrlBuilder

public UrlBuilder()
Method Detail

createDefaultUrl

public static URL createDefaultUrl(IServerBridgeRequest p_request)
                            throws MalformedURLException
Creates a default URL from the given request. The default URL is the base URL including the connector page or servlet, e.g.
 http://www.domain.tld/portalname/default.asp
 http://www.domain.tld/portalname/default.ixsp
 

Parameters:
p_request - The request to get the base part from.
Returns:
The default URL.
Throws:
MalformedURLException

createDefaultUrl

public static URL createDefaultUrl(IRequestProcessingContext p_ctx)
                            throws MalformedURLException
Throws:
MalformedURLException
See Also:
createDefaultUrl(IServerBridgeRequest)

createPersistentDefaultUrl

public static URL createPersistentDefaultUrl(IServerBridgeRequest p_request)
                                      throws MalformedURLException
Throws:
MalformedURLException

createBaseUrl

public static URL createBaseUrl(IServerBridgeRequest p_request)
                         throws MalformedURLException
Create a base URL from the given request.

The method uses the SERVERVAR.REQUEST_URI server variable to build the absolute or relative base URL.

Parameters:
p_request - The request.
Returns:
The base URL.
Throws:
MalformedURLException - - If a parsing error occurred.

createBaseUrl

public static URL createBaseUrl(IRequestProcessingContext p_ctx)
                         throws MalformedURLException
Throws:
MalformedURLException
See Also:
createBaseUrl(IServerBridgeRequest)

createRequestBaseDirectoryUrl

public static URL createRequestBaseDirectoryUrl(IServerBridgeRequest p_request)
                                         throws MalformedURLException
Reconstructs the URL the client used to make the request. The returned URL contains a protocol, server name, (optional) port number, and server virtual directory/context, but not the document part in the path.

Parameters:
p_request - The request.
Returns:
The request base URL.
Throws:
MalformedURLException

createRequestBaseDirectoryUrl

public static URL createRequestBaseDirectoryUrl(IRequestProcessingContext p_ctx)
                                         throws MalformedURLException
Throws:
MalformedURLException
See Also:
createRequestBaseDirectoryUrl(IServerBridgeRequest)

createAbsoluteBaseUrl

public static URL createAbsoluteBaseUrl(IServerBridgeRequest p_request)
                                 throws MalformedURLException
Create an absolute base URL from the given request.

This method tries to create an absolute base URL as follows

Parameters:
p_request - The request.
Returns:
The base URL.
Throws:
MalformedURLException - - If a parsing error occurred.

createAbsoluteBaseUrl

public static URL createAbsoluteBaseUrl(IRequestProcessingContext p_ctx)
                                 throws MalformedURLException
Throws:
MalformedURLException
See Also:
createAbsoluteBaseUrl(IServerBridgeRequest)

createAbsoluteBaseDirectoryUrl

public static URL createAbsoluteBaseDirectoryUrl(IServerBridgeRequest p_request)
                                          throws MalformedURLException
The same URL as createAbsoluteBaseUrl(IServerBridgeRequest) but without the document part in the path.

Parameters:
p_request - The request.
Returns:
The base directory URL.
Throws:
MalformedURLException - - If a parsing error occurred.

createAbsoluteBaseDirectoryUrl

public static URL createAbsoluteBaseDirectoryUrl(IRequestProcessingContext p_ctx)
                                          throws MalformedURLException
Throws:
MalformedURLException
See Also:
createAbsoluteBaseDirectoryUrl(IServerBridgeRequest)

createPersistentBaseUrl

public static URL createPersistentBaseUrl(IServerBridgeRequest p_request)

parseUrl

public static URL parseUrl(String p_strUrl)
                    throws MalformedURLException
Create an URL from the given string.

Parameters:
p_strUrl - The string to be parsed.
Returns:
The URL.
Throws:
MalformedURLException - - If a parsing error occurred.