Class OkHttpClientAdapter

java.lang.Object
com.pragma.archetype.infrastructure.adapter.out.http.OkHttpClientAdapter
All Implemented Interfaces:
HttpClientPort

public class OkHttpClientAdapter extends Object implements HttpClientPort
HTTP client adapter using OkHttp. Used for downloading templates from remote repositories.
  • Constructor Details

    • OkHttpClientAdapter

      public OkHttpClientAdapter()
  • Method Details

    • downloadContent

      public String downloadContent(String url)
      Description copied from interface: HttpClientPort
      Downloads content from a URL.
      Specified by:
      downloadContent in interface HttpClientPort
      Parameters:
      url - URL to download from
      Returns:
      content as string
    • isAccessible

      public boolean isAccessible(String url)
      Description copied from interface: HttpClientPort
      Checks if a URL is accessible.
      Specified by:
      isAccessible in interface HttpClientPort
      Parameters:
      url - URL to check
      Returns:
      true if accessible, false otherwise