public class GeneralUtility extends Object
Constructor and Description |
---|
GeneralUtility() |
Modifier and Type | Method and Description |
---|---|
static String |
calculateMD5ByByteArray(byte[] payload) |
static String |
calculateMD5ByString(String data) |
static boolean |
generateTextFile(String fileName,
String fileData) |
static String |
getFilenameExtension(String fileName)
Return the extension as the substring from the last dot.
|
static boolean |
isBase64Encoded(byte[] data) |
static boolean |
isBase64Encoded(String str) |
static boolean |
isExceedingLimit(List<String> strList,
int limit,
int delimiterLength)
Checks the passed string list whether the cumulative length of strings
and delimiters between them exceeds a limit of number of characters.
|
static boolean |
isExceedingLimit(String str,
int limit)
Checks whether the passed string exceeds a limit of number of characters.
|
public static boolean isBase64Encoded(byte[] data)
public static boolean isBase64Encoded(String str)
public static boolean isExceedingLimit(String str, int limit)
str
- strlimit
- limitpublic static boolean isExceedingLimit(List<String> strList, int limit, int delimiterLength)
strList
- strListlimit
- LimitdelimiterLength
- delimiterLength
- 0 if there is no delimeter.public static String getFilenameExtension(String fileName)
fileName
- fileNamepublic static String calculateMD5ByByteArray(byte[] payload)
Copyright © 2017. All rights reserved.