public class Utils extends Object
Modifier and Type | Field and Description |
---|---|
private static Pattern |
pattern
Pattern that matches strings like ${com.sun.aas.instanceRoot}
|
private static int |
PORT_CHECK_TIMEOUT
Port check timeout in ms.
|
private static byte[] |
TEST_QUERY
This is the test query used to ping the server in an attempt to
determine if it is secure or not.
|
Constructor and Description |
---|
Utils() |
Modifier and Type | Method and Description |
---|---|
static List<File> |
classPathToFileList(String cp,
File root)
Convert classpath fragment using standard separator to a list of
normalized files (nonexistent jars will be removed).
|
static String |
concatenate(String[] array)
|
static String |
doSub(String value,
Map<String,String> varMap)
Utility method that finds all occurrences of variable references and
replaces them with their values.
|
static String |
escapePath(String path)
Add escape characters for backslash and dollar sign characters in
path field.
|
static boolean |
isSecurePort(String hostname,
int port)
Determine whether an http listener is secure or not..
|
private static boolean |
isSecurePort(String hostname,
int port,
int depth)
Determine whether an http listener is secure or not..
|
static String |
lineSeparator()
Get system default line separator.
|
static String |
quote(String path)
Add quotes to string if and only if it contains space characters.
|
static String |
sanitizeName(String name)
Sanitize module name for use as Glassfish query parameter.
|
static String[] |
splitOptionsString(String optionString) |
private static final int PORT_CHECK_TIMEOUT
private static byte[] TEST_QUERY
private static Pattern pattern
public static boolean isSecurePort(String hostname, int port) throws IOException, ConnectException, SocketTimeoutException
hostname
- the host for the http-listener.port
- the port for the http-listener.IOException
SocketTimeoutException
ConnectException
private static boolean isSecurePort(String hostname, int port, int depth) throws IOException, ConnectException, SocketTimeoutException
hostname
- the host for the http-listener.port
- the port for the http-listener.depth
- Method calling depth.IOException
SocketTimeoutException
ConnectException
public static String lineSeparator()
public static String sanitizeName(String name)
name
- Glassfish module name.public static String quote(String path)
path
- File path in string form.public static List<File> classPathToFileList(String cp, File root)
cp
- classpath stringroot
- root folder for expanding relative path namespublic static String doSub(String value, Map<String,String> varMap)
varMap
and escaped. If they are
not present there, system properties are queried. If not found there
the variable reference is replaced with the same string with special
characters escaped.value
- String value where the variables have to be replaced with valuesvarMap
- mapping of variable names to their valuespublic static String escapePath(String path)
path
- file path in string form.Copyright © 2013. All Rights Reserved.