Class HTTPUtility


  • public class HTTPUtility
    extends Object
    The Class HTTPUtility.
    Author:
    Luca Frosini (ISTI - CNR)
    • Constructor Detail

      • HTTPUtility

        public HTTPUtility()
    • Method Detail

      • getElementAvailableInAnotherContextException

        protected static <C> AvailableInAnotherContextException getElementAvailableInAnotherContextException​(Class<C> clz)
        Gets the element available in another context exception.
        Type Parameters:
        C - the generic type
        Parameters:
        clz - the clz
        Returns:
        the element available in another context exception
      • getStringBuilder

        protected static StringBuilder getStringBuilder​(InputStream inputStream)
                                                 throws IOException
        Gets the string builder.
        Parameters:
        inputStream - the input stream
        Returns:
        the string builder
        Throws:
        IOException - Signals that an I/O exception has occurred.
      • getResponse

        public static <C> C getResponse​(Class<C> clz,
                                        HttpURLConnection connection)
                                 throws Exception
        Gets the response.
        Type Parameters:
        C - the generic type
        Parameters:
        clz - the clz
        connection - the connection
        Returns:
        the response
        Throws:
        Exception - the exception