Class UtilsKt
-
- All Implemented Interfaces:
public final class UtilsKt
-
-
Method Summary
Modifier and Type Method Description final static BooleanhasRequestSucceeded(NetworkResponse $self)Checks if the network response indicates a successful request. final static BooleanhasRequestSucceeded(Response $self)final static BooleanisSuccessfulResponse(Response $self)Checks if the OkHttp response indicates a successful request. final static BufferedSourcefromFile(String filePath)Reads the response body as a BufferedSource from the given Response. final static UnitsafeClose(Source $self)Reads the response body as a BufferedSource from the given Response. final static Unitsleep(Long timeInMillis)Sleeps for the specified time in milliseconds, handling interruptions gracefully. final static ResponseexecuteAsync(Call $self)-
-
Method Detail
-
hasRequestSucceeded
final static Boolean hasRequestSucceeded(NetworkResponse $self)
Checks if the network response indicates a successful request.
-
hasRequestSucceeded
final static Boolean hasRequestSucceeded(Response $self)
-
isSuccessfulResponse
final static Boolean isSuccessfulResponse(Response $self)
Checks if the OkHttp response indicates a successful request.
-
fromFile
final static BufferedSource fromFile(String filePath)
Reads the response body as a BufferedSource from the given Response.
-
safeClose
final static Unit safeClose(Source $self)
Reads the response body as a BufferedSource from the given Response.
-
sleep
final static Unit sleep(Long timeInMillis)
Sleeps for the specified time in milliseconds, handling interruptions gracefully.
- Parameters:
timeInMillis- The time to sleep in milliseconds.
-
executeAsync
final static Response executeAsync(Call $self)
-
-
-
-