Package io.jans.ca.plugin.adminui.utils
Class CommonUtils
- java.lang.Object
-
- io.jans.ca.plugin.adminui.utils.CommonUtils
-
public class CommonUtils extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static DateTimeFormatterLS_DATE_FORMAT
-
Constructor Summary
Constructors Constructor Description CommonUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static GenericResponsecreateGenericResponse(boolean result, int responseCode, String responseMessage)static GenericResponsecreateGenericResponse(boolean result, int responseCode, String responseMessage, com.fasterxml.jackson.databind.JsonNode node)static Stringdecode(String toDecode)static Stringencode(String str)static StringgetFormattedDate()static booleanhasShortCode(String input)static booleanhasShortCode(Map<String,?> map)static booleanisEmptyOrNullCollection(Collection<?> collection)static booleanisEmptyOrNullCollection(Map<?,?> m)static StringjoinAndUrlEncode(Collection<String> list)static RSAPrivateKeyloadPrivateKey(String privateKeyPEM)static StringreplacePlaceholders(String url, Map<String,Object> placeholderValues)static Map<String,Object>replacePlaceholders(Map<String,Object> map, Map<String,Object> placeholderValues)
-
-
-
Field Detail
-
LS_DATE_FORMAT
public static final DateTimeFormatter LS_DATE_FORMAT
-
-
Method Detail
-
joinAndUrlEncode
public static String joinAndUrlEncode(Collection<String> list) throws UnsupportedEncodingException
- Throws:
UnsupportedEncodingException
-
encode
public static String encode(String str) throws UnsupportedEncodingException
- Throws:
UnsupportedEncodingException
-
getFormattedDate
public static String getFormattedDate()
-
loadPrivateKey
public static RSAPrivateKey loadPrivateKey(String privateKeyPEM) throws Exception
- Throws:
Exception
-
decode
public static String decode(String toDecode) throws UnsupportedEncodingException
- Throws:
UnsupportedEncodingException
-
createGenericResponse
public static GenericResponse createGenericResponse(boolean result, int responseCode, String responseMessage)
-
createGenericResponse
public static GenericResponse createGenericResponse(boolean result, int responseCode, String responseMessage, com.fasterxml.jackson.databind.JsonNode node)
-
isEmptyOrNullCollection
public static boolean isEmptyOrNullCollection(Collection<?> collection)
-
isEmptyOrNullCollection
public static boolean isEmptyOrNullCollection(Map<?,?> m)
-
hasShortCode
public static boolean hasShortCode(String input)
-
replacePlaceholders
public static Map<String,Object> replacePlaceholders(Map<String,Object> map, Map<String,Object> placeholderValues)
-
-