Class HttpResourcesUtils


  • public final class HttpResourcesUtils
    extends Object
    • Method Detail

      • readResource

        public String readResource​(URI endpoint)
                            throws IOException
        Connects to the given endpoint to read the resource and returns the text contents. If the connection fails, the request will not be retried.
        Parameters:
        endpoint - The service endpoint to connect to.
        Returns:
        The text payload returned from the container metadata endpoint service for the specified resource path.
        Throws:
        IOException - If any problems were encountered while connecting to the service for the requested resource path.
        SdkClientException - If the requested service is not found.
      • readResource

        public String readResource​(ResourcesEndpointProvider endpointProvider)
                            throws IOException
        Connects to the given endpoint to read the resource and returns the text contents.
        Parameters:
        endpointProvider - The endpoint provider.
        Returns:
        The text payload returned from the container metadata endpoint service for the specified resource path.
        Throws:
        IOException - If any problems were encountered while connecting to the service for the requested resource path.
        SdkClientException - If the requested service is not found.
      • readResource

        public String readResource​(ResourcesEndpointProvider endpointProvider,
                                   String method)
                            throws IOException
        Connects to the given endpoint to read the resource and returns the text contents.
        Parameters:
        endpointProvider - The endpoint provider.
        method - The HTTP request method to use.
        Returns:
        The text payload returned from the container metadata endpoint service for the specified resource path.
        Throws:
        IOException - If any problems were encountered while connecting to the service for the requested resource path.
        SdkClientException - If the requested service is not found.