hu.midori.kosmos.server.util
Class UrlUtils

java.lang.Object
  extended by hu.midori.kosmos.server.util.UrlUtils

public class UrlUtils
extends java.lang.Object

Utility methods for manipulating complicated URLs.

Version:
$Id$
Author:
Aron Gombas

Constructor Summary
UrlUtils()
           
 
Method Summary
static java.lang.String getBaseUrl(java.lang.String url)
          Returns the "base part" (the part that doesn't contain the path and query parts) of the given URL.
static java.lang.String parseAdditionalItemFromUrl(java.lang.String url)
          TODO
static java.lang.String[] parseUserInfoFromUrl(java.lang.String url)
          Returns a two-element array with the username and password from the given URL, or null if those are not specified in the URL.
static java.lang.String removeUserInfoFromUrl(java.lang.String url)
          Removes the userinfo part from the given URL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UrlUtils

public UrlUtils()
Method Detail

getBaseUrl

public static java.lang.String getBaseUrl(java.lang.String url)
                                   throws java.net.MalformedURLException
Returns the "base part" (the part that doesn't contain the path and query parts) of the given URL.

Throws:
java.net.MalformedURLException

removeUserInfoFromUrl

public static java.lang.String removeUserInfoFromUrl(java.lang.String url)
                                              throws java.net.MalformedURLException
Removes the userinfo part from the given URL.

Returns:
the truncated URL.
Throws:
java.net.MalformedURLException

parseUserInfoFromUrl

public static java.lang.String[] parseUserInfoFromUrl(java.lang.String url)
                                               throws java.net.MalformedURLException
Returns a two-element array with the username and password from the given URL, or null if those are not specified in the URL.

Throws:
java.net.MalformedURLException

parseAdditionalItemFromUrl

public static java.lang.String parseAdditionalItemFromUrl(java.lang.String url)
TODO