Class HttpResourcesUtils
- java.lang.Object
-
- software.amazon.awssdk.regions.util.HttpResourcesUtils
-
public final class HttpResourcesUtils extends Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static HttpResourcesUtils
instance()
String
readResource(URI endpoint)
Connects to the given endpoint to read the resource and returns the text contents.String
readResource(ResourcesEndpointProvider endpointProvider)
Connects to the given endpoint to read the resource and returns the text contents.String
readResource(ResourcesEndpointProvider endpointProvider, String method)
Connects to the given endpoint to read the resource and returns the text contents.
-
-
-
Method Detail
-
instance
public static HttpResourcesUtils instance()
-
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.
-
-