SMILA (incubation) API documentation

org.eclipse.smila.http.server.util
Class URLCreator

java.lang.Object
  extended by org.eclipse.smila.http.server.util.URLCreator

public final class URLCreator
extends java.lang.Object

Utility class to create URLs in Httphandlers and RequestHandlers.

Author:
jschumacher

Field Summary
static java.lang.String HTTP_PTOTOCOL
          String constant for the HTTP protocol.
 
Method Summary
static java.net.URL create(java.lang.String host, java.lang.String path)
          Create a HTTP URL with the given parameters.
static java.net.URL create(java.lang.String requestHost, java.lang.String requestUri, java.lang.String pathToAppend)
          Create a HTTP URL with the given parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HTTP_PTOTOCOL

public static final java.lang.String HTTP_PTOTOCOL
String constant for the HTTP protocol.

See Also:
Constant Field Values
Method Detail

create

public static java.net.URL create(java.lang.String host,
                                  java.lang.String path)
                           throws java.net.MalformedURLException
Create a HTTP URL with the given parameters.

Parameters:
host - the host name
path - the url path
Returns:
a URL
Throws:
java.net.MalformedURLException - if the URL cannot be created

create

public static java.net.URL create(java.lang.String requestHost,
                                  java.lang.String requestUri,
                                  java.lang.String pathToAppend)
                           throws java.net.MalformedURLException
Create a HTTP URL with the given parameters. The URL is created by appending the pathToAppend to the requestURI. Missing slashes are added if necessary. Any parameters in the requestURI are removed.

Parameters:
requestHost - the Host request-header
requestUri - the uri the request was issued at
pathToAppend - the path to append to the request uri
Returns:
a URL
Throws:
java.net.MalformedURLException - if the URL cannot be created

SMILA (incubation) API documentation