Class HttpUtils

  • All Implemented Interfaces:
    Loggable

    public class HttpUtils
    extends LoggedObject
    Set of common HTTP(S) utility methods.
    • Constructor Detail

      • HttpUtils

        public HttpUtils()
    • Method Detail

      • ping

        public boolean ping​(URL pingURL)
        Parameters:
        pingURL - the URL to ping
        Returns:
        true if the URL can be ping or false otherwise
      • ping

        public boolean ping​(URL pingURL,
                            HttpUtils.HttpResult result)
        Ping a URL and store the detailed result in a HttpUtils.HttpResult object.
        Parameters:
        pingURL - the URL to ping
        result - the detailed ping result
        Returns:
        true if the URL can be ping or false otherwise
      • ping

        public boolean ping​(URL pingURL,
                            HttpUtils.HttpResult result,
                            long timeout)
        Ping a URL and store the detailed result in a HttpUtils.HttpResult object.
        Parameters:
        pingURL - the URL to ping
        result - the detailed ping result
        timeout - the timeout to wait for, 0 if waiting to infinity
        Returns:
        true if the URL can be ping or false otherwise
      • ping

        public boolean ping​(URL pingURL,
                            Map<String,​String> requestProperties,
                            HttpUtils.HttpResult result)
        Ping a URL and store the detailed result in a HttpUtils.HttpResult object.
        Parameters:
        pingURL - the URL to ping
        requestProperties - optional request properties to add to the connection (can be null)
        result - the detailed ping result
        Returns:
        true if the URL can be ping or false otherwise
      • ping

        public boolean ping​(URL pingURL,
                            Map<String,​String> requestProperties,
                            HttpUtils.HttpResult result,
                            long timeout)
        Ping a URL and store the detailed result in a HttpUtils.HttpResult object.
        Parameters:
        pingURL - the URL to ping
        requestProperties - optional request properties to add to the connection (can be null)
        result - the detailed ping result
        timeout - the timeout to wait for, 0 if waiting to infinity
        Returns:
        true if the URL can be ping or false otherwise