Project JXTA

net.jxta.ext.config
Class Util

java.lang.Object
  extended by net.jxta.ext.config.Util

public class Util
extends Object

Description of the Class

Version:
$Id: Util.java,v 1.19 2004/11/30 22:42:11 gonzo Exp $
Author:
james todd [gonzo at jxta dot org]

Constructor Summary
Util()
           
 
Method Summary
static String expand(String s)
          Description of the Method
static String getLocalHost()
          Gets the local address.
static String getProxyFromUserAgent()
           
static ServerSocket getServerSocket(InetAddress address, int port)
           
static byte[] inetAddressToBytes(String ipAddr)
           
static boolean isMulticast(URI u)
           
static boolean isNonRoutable(URI u)
           
static boolean isPortAvailable(InetAddress address, int port)
          Checks for the specified port availability.
static URI model(String scheme)
          Description of the Method
static URI model(String scheme, int port)
           
static URI normalize(Address address)
          Description of the Method
static URI normalize(Address address, boolean portScan)
          Description of the Method
static URI normalize(Address address, boolean portScan, URI model)
          Address normalizer.
static URI toURI(String scheme, String host, int port)
          Description of the Method
static String validateAddress(URI address)
          Description of the Method
static String validateAddress(URI address, boolean requireHost)
          Description of the Method
static String validateAddress(URI address, int minimumPort)
           
static String validateAddress(URI address, String scheme)
          Validate address against the provided scheme.
static String validateAddress(URI address, String scheme, boolean requireHost)
          Validate address against the provided scheme and host requirement.
static String validateAddress(URI address, String scheme, boolean requireHost, int minimumPort)
          Validate address against the provided scheme and host requirement.
static String validateAddress(URI address, String scheme, int minimumPort)
          Validate address against the provided scheme and host requirement.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Util

public Util()
Method Detail

expand

public static String expand(String s)
Description of the Method

Parameters:
s - Description of the Parameter
Returns:
Description of the Return Value

getLocalHost

public static String getLocalHost()
Gets the local address.

Returns:
The local address

validateAddress

public static String validateAddress(URI address)
Description of the Method

Parameters:
address - Description of the Parameter
Returns:
Description of the Return Value

validateAddress

public static String validateAddress(URI address,
                                     int minimumPort)

validateAddress

public static String validateAddress(URI address,
                                     boolean requireHost)
Description of the Method

Parameters:
address - Description of the Parameter
requireHost - Description of the Parameter
Returns:
Description of the Return Value

validateAddress

public static String validateAddress(URI address,
                                     String scheme)
Validate address against the provided scheme.

Parameters:
address - Description of the Parameter
scheme - scheme
Returns:
Validation state

validateAddress

public static String validateAddress(URI address,
                                     String scheme,
                                     boolean requireHost)
Validate address against the provided scheme and host requirement.

Parameters:
address - addresss
scheme - scheme
requireHost - Description of the Parameter
Returns:
Validation state

validateAddress

public static String validateAddress(URI address,
                                     String scheme,
                                     int minimumPort)
Validate address against the provided scheme and host requirement.

Parameters:
address - addresss
scheme - scheme
minimumPort - minimum port
Returns:
Validation state

validateAddress

public static String validateAddress(URI address,
                                     String scheme,
                                     boolean requireHost,
                                     int minimumPort)
Validate address against the provided scheme and host requirement.

Parameters:
address - addresss
scheme - scheme
requireHost - Description of the Parameter
minimumPort - minimum port
Returns:
Validation state

normalize

public static URI normalize(Address address)
Description of the Method

Parameters:
address - Description of the Parameter
Returns:
Description of the Return Value

normalize

public static URI normalize(Address address,
                            boolean portScan)
Description of the Method

Parameters:
address - Description of the Parameter
portScan - port scan
Returns:
Description of the Return Value

normalize

public static URI normalize(Address address,
                            boolean portScan,
                            URI model)
Address normalizer.

Parameters:
address - base address
portScan - port scan
model - model address
Returns:
Resultant address

toURI

public static URI toURI(String scheme,
                        String host,
                        int port)
Description of the Method

Parameters:
scheme - Description of the Parameter
host - Description of the Parameter
port - Description of the Parameter
Returns:
Description of the Return Value

model

public static URI model(String scheme)
Description of the Method

Parameters:
scheme - Description of the Parameter
Returns:
Description of the Return Value

model

public static URI model(String scheme,
                        int port)

isPortAvailable

public static boolean isPortAvailable(InetAddress address,
                                      int port)
Checks for the specified port availability.

Parameters:
address - target system address
port - target port
Returns:
The availability indicator

getServerSocket

public static ServerSocket getServerSocket(InetAddress address,
                                           int port)

getProxyFromUserAgent

public static String getProxyFromUserAgent()

isNonRoutable

public static boolean isNonRoutable(URI u)

isMulticast

public static boolean isMulticast(URI u)

inetAddressToBytes

public static byte[] inetAddressToBytes(String ipAddr)

JXTA J2SE