|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.rioproject.boot.BootUtil
public class BootUtil
Provides static convenience methods for use in configuration files. This class cannot be instantiated.
| Method Summary | |
|---|---|
static int |
getAnonymousPort()
Get an anonymous port |
static String |
getCodebase(String[] jars,
String port)
Return the codebase for the provided JAR names and port. |
static String |
getCodebase(String[] jars,
String address,
String port)
Return the codebase for the provided JAR names, port and address |
static String |
getCodebase(String jar,
String port)
Return the codebase for the provided JAR name and port. |
static String |
getCodebase(String jar,
String address,
String port)
Return the codebase for the provided JAR name, port and address |
static String |
getHostAddress()
Return the local host address using java.net.InetAddress.getLocalHost().getHostAddress() |
static String |
getHostAddress(String name)
Return the local host address for a passed in host using InetAddress.getByName(String) |
static String |
getHostAddressFromProperty(String property)
Return the local host address based on the value of a system property. |
static String |
getHostName()
Return the local host name java.net.InetAddress.getLocalHost().getHostName() |
static int |
getPortFromRange(int start,
int end)
Get a port from a range of ports |
static int |
getPortFromRange(String portRange)
Get a port from a range of ports |
static URL[] |
scanDirectory(String dirPath)
Will return an array of URLs for all .jar and .zip files in the directory, including the directory itself |
static String[] |
toArray(String arg)
Convert a comma, space and/or File.pathSeparator
delimited String to array of Strings |
static String[] |
toArray(String arg,
String delim)
Convert a delimited String to array of Strings |
static URL[] |
toURLs(String[] elements)
Will return an array of URLs based on the input String array. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static String getCodebase(String jar,
String port)
throws UnknownHostException
java.net.InetAddress.getLocalHost().getHostAddress(), then
construct the codebase using the host address and the port for the provided
jar.
jar - The JAR to useport - The port to use when constructing the codebase
UnknownHostException - if no IP address for the local
host could be found.
public static String getCodebase(String[] jars,
String port)
throws UnknownHostException
java.net.InetAddress.getLocalHost().getHostAddress(), then
construct the codebase using the host address and the port for each jar in
the array of jars.
jars - The JAR names to useport - The port to use when constructing the codebase
UnknownHostException - if no IP address for the local
host could be found.
public static String getCodebase(String jar,
String address,
String port)
jar - The JAR to useaddress - The address to use when constructing the codebaseport - The port to use when constructing the codebase
public static String getCodebase(String[] jars,
String address,
String port)
jars - Array of JAR namesaddress - The address to use when constructing the codebaseport - The port to use when constructing the codebase
public static String getHostAddress()
throws UnknownHostException
java.net.InetAddress.getLocalHost().getHostAddress()
UnknownHostException - if no IP address for the local
host could be found.
public static String getHostAddress(String name)
throws UnknownHostException
InetAddress.getByName(String)
name - The name of the host to return
UnknownHostException - if no IP address for the host name
could be found.
public static String getHostAddressFromProperty(String property)
throws UnknownHostException
InetAddress.getByName(String). If the system
property is not resolvable, return the default host address obtained from
InetAddress.getLocalHost()
property - The property name to use
UnknownHostException - if no IP address for the host name
could be found.
public static String getHostName()
throws UnknownHostException
java.net.InetAddress.getLocalHost().getHostName()
UnknownHostException - if no hostname for the local
host could be found.
public static int getAnonymousPort()
throws IOException
java.net.ServerSocket with a port of 0
IOException - If an anonymous port cannot be obtained
public static int getPortFromRange(String portRange)
throws IOException
portRange - A range of ports. The port range is specified as "-" delimited
string, startRange-endRange, where startRange and endRange
are inclusive.
org.rioproject.net.PortRangeServerSocketFactory with provided range
IOException - If a port cannot be obtained
IllegalArgumentException - is either bound is not between
0 and 65535, or if end is < than low.
public static int getPortFromRange(int start,
int end)
throws IOException
start - The range to start from (inclusive)end - The end of the range (inclusive)
org.rioproject.net.PortRangeServerSocketFactory with provided range
IOException - If a port cannot be obtained
IllegalArgumentException - is either bound is not between
0 and 65535, or if end is < than low.
public static URL[] toURLs(String[] elements)
throws MalformedURLException
elements - A String array of fully qualified directory path
MalformedURLException - if any of the elements cannot be converted
public static URL[] scanDirectory(String dirPath)
throws MalformedURLException
dirPath - A fully qualified directory path
MalformedURLException - If elements in the directory cannot be
created into a URLpublic static String[] toArray(String arg)
File.pathSeparator
delimited String to array of Strings
arg - The String to convert
public static String[] toArray(String arg,
String delim)
arg - The String to convertdelim - the delimiters to use
|
Copyright © Rio Project. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||