m.c.m.proxyma.rewrite
Class URLUtils

java.lang.Object
  extended by m.c.m.proxyma.rewrite.URLUtils

public class URLUtils
extends java.lang.Object

This class is a collection some useful function for the URL management

NOTE: this software is released under GPL License. See the LICENSE of this distribution for more informations.

Version:
$Id: URLUtils.java 144 2010-06-23 22:24:28Z marcolinuz $
Author:
Marco Casavecchia Morganti (marcolinuz) [marcolinuz-at-gmail.com]

Constructor Summary
URLUtils()
           
 
Method Summary
static java.lang.String getDestinationHost(java.net.URL theUrl)
          Translates the URL into a new URL countaining only the protocol,the host and the port.
protected static int getPort(java.net.URL theUrl)
          Returns always the "real" port for the passed 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

getDestinationHost

public static java.lang.String getDestinationHost(java.net.URL theUrl)
Translates the URL into a new URL countaining only the protocol,the host and the port. (ex: http://www.a.b/c/d -> http://www.a.b:80)

Parameters:
theUrl -
Returns:

getPort

protected static int getPort(java.net.URL theUrl)
Returns always the "real" port for the passed URL.
In other words it returns the port to use to make a connection to the given url and never returns -1 unlike URL.getPort().

Parameters:
theUrl - to check
Returns:
the real port of the resource pointed by the url.


Copyright © 2010. All Rights Reserved.