This repository has been archived by the owner on Mar 19, 2024. It is now read-only.
Remove redundant use of HttpClient
#378
Labels
HttpClient
#378
With the changes done by removing the ok http singleton I also introduced a redundend use of the
HttpClient
wrapper.The HttpClient gets introduced to the HttpMethod through the constructor:
android-library/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/methods/HttpBaseMethod.kt
Lines 15 to 17 in 9d80a95
However the
execute()
method of theHttpMethod
is later called from theOwnCloudClient
which extends theHttpClient
wrapper:android-library/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/OwnCloudClient.java
Lines 94 to 110 in b96a3e9
Getting "in touch" twice with the client is redundant and should be removed. Here are two possible solutions:
1. Try to Inject the client from the constructor:
But the code calling the
method.execute()
in theOwnCloudClient
has to be moved to theHttpMethod
:android-library/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/OwnCloudClient.java
Line 95 in 9d80a95
2. Try to inject the client from the execute method:
Instead of modifying the OkHttp client directly we could save the modifications and apply them when calling the
execute(client)
method.The only change that need to be applied to
OwnCloudClient
would be thatthis
is suplied the theexecution()
method.Issue: #378
Library: #427
App: owncloud/android#3353
The text was updated successfully, but these errors were encountered: