Class ClientUtil


  • public class ClientUtil
    extends Object
    Version:
    0.9, 26/12/2012
    Author:
    Yuriy Zabrovarnyy, Yuriy Movchan
    • Method Detail

      • toPrettyJson

        public static String toPrettyJson​(org.json.JSONObject jsonObject)
                                   throws com.fasterxml.jackson.core.JsonProcessingException
        Throws:
        com.fasterxml.jackson.core.JsonProcessingException
      • extractListByKey

        public static List<String> extractListByKey​(org.json.JSONObject jsonObject,
                                                    String key)
      • extractListByKeyOptString

        public static List<String> extractListByKeyOptString​(org.json.JSONObject jsonObject,
                                                             String key)
      • integerOrNull

        public static Integer integerOrNull​(org.json.JSONObject jsonObject,
                                            String key)
      • booleanOrNull

        public static Boolean booleanOrNull​(org.json.JSONObject jsonObject,
                                            String key)
      • longOrNull

        public static Long longOrNull​(org.json.JSONObject jsonObject,
                                      String key)
      • stringOrNull

        public static String stringOrNull​(org.json.JSONObject jsonObject,
                                          String key)
      • createHttpClient

        public static org.apache.http.impl.client.CloseableHttpClient createHttpClient​(String tlsVersion,
                                                                                       String[] ciphers)
        Creates a special SSLContext using a custom TLS version and a set of ciphers enabled to process SSL connections.
        Parameters:
        tlsVersion - TLS version, for example TLSv1.2
        ciphers - Set of ciphers used to create connections.