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 DateTimeFormatter
LS_DATE_FORMAT
-
Constructor Summary
Constructors Constructor Description CommonUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static GenericResponse
createGenericResponse(boolean result, int responseCode, String responseMessage)
static GenericResponse
createGenericResponse(boolean result, int responseCode, String responseMessage, com.fasterxml.jackson.databind.JsonNode node)
static String
decode(String toDecode)
static String
encode(String str)
static String
getFormattedDate()
static boolean
hasShortCode(String input)
static boolean
hasShortCode(Map<String,?> map)
static boolean
isValidJson(String json)
static String
joinAndUrlEncode(Collection<String> list)
static Map<String,Object>
jsonStringToMap(String jsonString)
static RSAPrivateKey
loadPrivateKey(String privateKeyPEM)
static String
mapToJsonString(Map<String,Object> mapObj)
static String
replacePlaceholders(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)
-
-