public class CoreUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
BUFFER_SIZE |
static int |
COMMAND_STR_LENGTH_SIZE |
static String |
DOC_URL |
static String |
UTF8
UTF-8 encoding string
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
allNotBlank(String... p_strings) |
static Command |
asCommand(String commandAsJson) |
static String |
asJson(Object p_object)
Converts object to json string.
|
static String |
asJsonSilently(Object p_object) |
static ScheduledExecutorService |
createExecutor() |
static org.apache.http.client.HttpClient |
createHttpClientTrustAll() |
static org.apache.http.client.HttpClient |
createHttpClientWithKeyStore(File pathToKeyStore,
String password) |
static org.codehaus.jackson.map.ObjectMapper |
createJsonMapper()
Creates json mapper for json object serialization/deserialization.
|
static ThreadFactory |
daemonThreadFactory() |
static boolean |
isExpired(Date expiredAt) |
static String |
normalizeLengthPrefixString(int p_length) |
static long |
parseSilently(String p_str) |
static ReadResult |
readCommand(String p_leftString,
BufferedReader p_reader) |
static String |
secureRandomString() |
static void |
sleep(int i) |
static Map<String,String> |
splitQuery(String url) |
static Map<String,String> |
splitQuery(URL url) |
public static final String DOC_URL
public static final String UTF8
public static final int COMMAND_STR_LENGTH_SIZE
public static final int BUFFER_SIZE
public static boolean isExpired(Date expiredAt)
public static ScheduledExecutorService createExecutor()
public static ThreadFactory daemonThreadFactory()
public static void sleep(int i)
public static String asJson(Object p_object) throws IOException
p_object - object to convert to stringIOException - if io problems occurspublic static org.codehaus.jackson.map.ObjectMapper createJsonMapper()
public static Command asCommand(String commandAsJson) throws IOException
IOExceptionpublic static long parseSilently(String p_str)
public static String normalizeLengthPrefixString(int p_length)
public static ReadResult readCommand(String p_leftString, BufferedReader p_reader) throws IOException
IOExceptionpublic static boolean allNotBlank(String... p_strings)
public static org.apache.http.client.HttpClient createHttpClientWithKeyStore(File pathToKeyStore, String password) throws Exception
pathToKeyStore - path to key store, e.g. D:/Development/gluu_conf/etc/certs/DA855F9895A1CA3B9E7D4BF5-java.jkspassword - key store passwordExceptionpublic static org.apache.http.client.HttpClient createHttpClientTrustAll()
throws NoSuchAlgorithmException,
KeyManagementException,
KeyStoreException,
UnrecoverableKeyException
public static String secureRandomString()
public static Map<String,String> splitQuery(String url) throws UnsupportedEncodingException, MalformedURLException
public static Map<String,String> splitQuery(URL url) throws UnsupportedEncodingException
UnsupportedEncodingExceptionCopyright © 2018. All rights reserved.