Class OkHttpClientAdapter
java.lang.Object
com.pragma.archetype.infrastructure.adapter.out.http.OkHttpClientAdapter
- All Implemented Interfaces:
HttpClientPort
HTTP client adapter using OkHttp.
Used for downloading templates from remote repositories.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.pragma.archetype.domain.port.out.HttpClientPort
HttpClientPort.HttpDownloadException -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondownloadContent(String url) Downloads content from a URL.booleanisAccessible(String url) Checks if a URL is accessible.
-
Constructor Details
-
OkHttpClientAdapter
public OkHttpClientAdapter()
-
-
Method Details
-
downloadContent
Description copied from interface:HttpClientPortDownloads content from a URL.- Specified by:
downloadContentin interfaceHttpClientPort- Parameters:
url- URL to download from- Returns:
- content as string
-
isAccessible
Description copied from interface:HttpClientPortChecks if a URL is accessible.- Specified by:
isAccessiblein interfaceHttpClientPort- Parameters:
url- URL to check- Returns:
- true if accessible, false otherwise
-