public class SdkUtils
extends java.lang.Object
| Constructor and Description |
|---|
SdkUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
cloneSerializable(T source) |
static void |
closeQuietly(java.io.Closeable... closeables) |
static java.lang.String |
concatStringWithDelimiter(java.lang.String[] strings,
java.lang.String delimiter) |
static java.lang.String |
convertSerializableToString(java.io.Serializable obj) |
static void |
copyStream(java.io.InputStream inputStream,
java.io.OutputStream outputStream) |
static java.io.OutputStream |
createArrayOutputStream(java.io.OutputStream[] outputStreams) |
static java.util.concurrent.ThreadPoolExecutor |
createDefaultThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
java.util.concurrent.TimeUnit unit) |
static boolean |
deleteFolderRecursive(java.io.File f)
Recursively delete a folder and all its subfolders and files.
|
static java.lang.String |
generateStateToken()
Per OAuth2 specs, auth code exchange should include a state token for CSRF validation
|
static java.lang.String |
getAssetFile(android.content.Context context,
java.lang.String assetName)
Helper method for reading an asset file into a string.
|
static boolean |
isBlank(java.lang.String str) |
static boolean |
isEmptyString(java.lang.String str) |
static boolean |
isInternetAvailable(android.content.Context context)
Check for an internet connection.
|
static long |
parseJsonValueToInteger(com.eclipsesource.json.JsonValue value)
Parse a given JsonValue to an int regardless of whether that value is a String or an int.
|
static long |
parseJsonValueToLong(com.eclipsesource.json.JsonValue value)
Parse a given JsonValue to a long regardless of whether that value is a String or a long.
|
static java.lang.String |
sha1(java.io.InputStream inputStream) |
public static java.lang.String generateStateToken()
public static void copyStream(java.io.InputStream inputStream,
java.io.OutputStream outputStream)
throws java.io.IOException,
java.lang.InterruptedException
java.io.IOExceptionjava.lang.InterruptedExceptionpublic static java.io.OutputStream createArrayOutputStream(java.io.OutputStream[] outputStreams)
public static boolean isEmptyString(java.lang.String str)
public static boolean isBlank(java.lang.String str)
public static java.lang.String sha1(java.io.InputStream inputStream)
throws java.io.IOException,
java.security.NoSuchAlgorithmException
java.io.IOExceptionjava.security.NoSuchAlgorithmExceptionpublic static long parseJsonValueToLong(com.eclipsesource.json.JsonValue value)
value - a JsonValue to parse to a long.public static long parseJsonValueToInteger(com.eclipsesource.json.JsonValue value)
value - a JsonValue to parse to an int.public static java.lang.String concatStringWithDelimiter(java.lang.String[] strings,
java.lang.String delimiter)
public static java.util.concurrent.ThreadPoolExecutor createDefaultThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
java.util.concurrent.TimeUnit unit)
public static <T> T cloneSerializable(T source)
public static java.lang.String convertSerializableToString(java.io.Serializable obj)
public static void closeQuietly(java.io.Closeable... closeables)
public static boolean deleteFolderRecursive(java.io.File f)
f - directory to be deleted.public static boolean isInternetAvailable(android.content.Context context)
context - public static java.lang.String getAssetFile(android.content.Context context,
java.lang.String assetName)
context - current context.assetName - the asset name