org.objectweb.carol.util.configuration
Class ConfigurationUtil

java.lang.Object
  extended by org.objectweb.carol.util.configuration.ConfigurationUtil

public class ConfigurationUtil
extends java.lang.Object

Utility class to analyze some configuration properties

Author:
Florent Benoit

Method Summary
static java.lang.String getHostOfUrl(java.lang.String url)
          Parses the given url, and returns the hostname If not found, returns localhost
static int getPortOfUrl(java.lang.String url)
          Parses the given url, and returns the port number.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getPortOfUrl

public static int getPortOfUrl(java.lang.String url)
                        throws ConfigurationException
Parses the given url, and returns the port number. 0 is given in error case)

Parameters:
url - given url on which extract port number
Returns:
port number of the url
Throws:
ConfigurationException - if URL is invalid

getHostOfUrl

public static java.lang.String getHostOfUrl(java.lang.String url)
                                     throws ConfigurationException
Parses the given url, and returns the hostname If not found, returns localhost

Parameters:
url - given url on which extract hostname
Returns:
hostname of the url
Throws:
ConfigurationException - if URL is invalid