public class Utils extends Object
| Constructor and Description |
|---|
Utils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
encryptSHA(String string)
Calculate the SHA-1 hash of the given string.
|
static String |
generateSaltForUserAccount() |
static String |
generateToken() |
static String |
generateUUID()
Generate a random UUID.
|
static String |
getConfigValue(ConfigurationKey key) |
static String |
getHexString(byte[] bytes)
Convert byte array to Hex notation.
|
static String |
getString(InputStream stream) |
static String |
join(String delimiter,
Collection<?> s)
Concatenate a Collection of Strings using the given delimiter.
|
static String |
stackTraceToString(Throwable throwable)
Retrieve the stack trace from the given Throwable, and output the string.
|
public static String join(String delimiter, Collection<?> s)
s - Collection to work ondelimiter - Delimiter to use to joinpublic static String generateToken()
public static String getHexString(byte[] bytes) throws UnsupportedEncodingException
bytes - bytes to convert.UnsupportedEncodingExceptionpublic static String stackTraceToString(Throwable throwable)
throwable - Throwable to process.public static String encryptSHA(String string)
string - Plain text to hash.public static String generateUUID()
public static String generateSaltForUserAccount()
public static String getConfigValue(ConfigurationKey key)
public static String getString(InputStream stream) throws IOException
IOExceptionCopyright © 2017. All rights reserved.