code: public static String retrieveData(String sUrl, String encoding, int timeout, SSLSocketFactory sslFactory) throws IOException {
          byte[] rawData = retrieveRawData(sUrl, timeout, sslFactory);
          if(encoding == null) {
              return new String(rawData);  // NOSONAR
          }
  
          return new String(rawData, encoding);
      }
docs: Download data from an URL, if necessary converting from a character encoding.
  
  @param sUrl The full URL used to download the content.
  @param encoding An encoding, e.g. UTF-8, ISO-8859-15. Can be null.
  @param timeout The timeout in milliseconds that is used for both
  connection timeout and read timeout.
  @param sslFactory The SSLFactory to use for the connection, this allows to support custom SSL certificates
  
  @return The resulting data, e.g. a HTML string.
  
  @throws IOException If accessing the resource fails.