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 booleanisValidJson(String json)static StringjoinAndUrlEncode(Collection<String> list)static Map<String,Object>jsonStringToMap(String jsonString)static RSAPrivateKeyloadPrivateKey(String privateKeyPEM)static StringmapToJsonString(Map<String,Object> mapObj)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)
-
hasShortCode
public static boolean hasShortCode(String input)
-
replacePlaceholders
public static Map<String,Object> replacePlaceholders(Map<String,Object> map, Map<String,Object> placeholderValues)
-
replacePlaceholders
public static String replacePlaceholders(String url, Map<String,Object> placeholderValues)
-
jsonStringToMap
public static Map<String,Object> jsonStringToMap(String jsonString) throws com.fasterxml.jackson.core.JsonProcessingException
- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
mapToJsonString
public static String mapToJsonString(Map<String,Object> mapObj) throws com.fasterxml.jackson.core.JsonProcessingException
- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
isValidJson
public static boolean isValidJson(String json)
-
-