Package utility
Class Util
- java.lang.Object
-
- utility.Util
-
public class Util extends Object
Global Utility Class with static helper methods.- Version:
- 1.0
- Author:
- Frank Giordano
-
-
Constructor Summary
Constructors Constructor Description Util()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
checkConnection(ZOSConnection connection)
Check connection for validity.static void
checkIllegalParameter(boolean check, String msg)
Check for state of parameterstatic void
checkNullParameter(boolean check, String msg)
Check for null parameterstatic String
encodeURIComponent(String str)
Encodes the passed String as UTF-8 using an algorithm that's compatible with JavaScript's encodeURIComponent function.static String
getAuthEncoding(ZOSConnection connection)
Encodes the passed connection String as UTF-8 for usage of the AUTHORIZATION http header.static void
wait(int time)
Wait by time specified.
-
-
-
Method Detail
-
wait
public static void wait(int time)
Wait by time specified.- Parameters:
time
- in milliseconds
-
getAuthEncoding
public static String getAuthEncoding(ZOSConnection connection)
Encodes the passed connection String as UTF-8 for usage of the AUTHORIZATION http header.- Parameters:
connection
- connection information, see ZOSConnection object- Returns:
- encoded String
-
checkConnection
public static void checkConnection(ZOSConnection connection)
Check connection for validity.- Parameters:
connection
- connection information, see ZOSConnection object- Throws:
IllegalStateException
- with message "Connection data not setup properly"
-
checkNullParameter
public static void checkNullParameter(boolean check, String msg)
Check for null parameter- Parameters:
check
- check for true or false valuemsg
- message to display if check is true- Throws:
IllegalArgumentException
- with message
-
checkIllegalParameter
public static void checkIllegalParameter(boolean check, String msg)
Check for state of parameter- Parameters:
check
- Check for true or false valuemsg
- message to display if check is true- Throws:
IllegalArgumentException
- with message
-
encodeURIComponent
public static String encodeURIComponent(String str)
Encodes the passed String as UTF-8 using an algorithm that's compatible with JavaScript's encodeURIComponent function. Returns incoming string un-encoded if exception occurs.- Parameters:
str
- string to be encoded- Returns:
- encoded String or original string
-
-