package Ġapp . lu is ram os . ler . data Ċ Ċ import Ġkotlinx . coroutines . Dispatch ers Ċ import Ġkotlinx . coroutines . with Context Ċ import Ġokhttp 3 . Ok HttpClient Ċ import Ġokhttp 3 . Request Ċ import Ġokhttp 3 . Response Ċ import Ġjava . net . URL Ċ import Ġkotlin . coroutines . Coroutine Context Ċ Ċ interface ĠApi Ġ{ ĊĠĠĠ Ġsuspend Ġfun Ġdownload ( url : ĠURL ): ĠResponse ĊĠĠĠ Ġsuspend Ġfun Ġdownload ( url : ĠString ): ĠResponse Ċ } Ċ Ċ class ĠDefault Api ( ĊĠĠĠ Ġprivate Ġval Ġcoroutine Context : ĠCor outine Context Ċ ) Ġ: ĠApi Ġ{ ĊĠĠĠ Ġprivate Ġval Ġclient Ġ= ĠOk HttpClient . Builder (). build () ĊĊĠĠĠ Ġ@ Suppress (" Blocking Method In Non Blocking Context ") ĊĠĠĠ Ġoverride Ġsuspend Ġfun Ġdownload ( url : ĠURL ): ĠResponse Ġ= Ġwith Context ( coroutine Context ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġrequest Ġ= ĠRequest . Builder (). url ( url ). build () ĊĠĠĠĠĠĠĠ Ġclient . new Call ( request ). execute () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Suppress (" Blocking Method In Non Blocking Context ") ĊĠĠĠ Ġoverride Ġsuspend Ġfun Ġdownload ( url : ĠString ): ĠResponse Ġ= Ġwith Context ( coroutine Context ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġrequest Ġ= ĠRequest . Builder (). url ( url ). build () ĊĠĠĠĠĠĠĠ Ġclient . new Call ( request ). execute () ĊĠĠĠ Ġ} Ċ }