mirror of
https://github.com/owncloud/android-library.git
synced 2025-06-08 08:26:10 +00:00
Use callback to get okhttp response
This commit is contained in:
parent
4968ca6e62
commit
e0e6d3da49
@ -175,8 +175,6 @@ public class OwnCloudClient extends HttpClient {
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public RedirectionPath followRedirection(HttpBaseMethod method) throws Exception {
|
public RedirectionPath followRedirection(HttpBaseMethod method) throws Exception {
|
||||||
int redirectionsCount = 0;
|
int redirectionsCount = 0;
|
||||||
int status = method.getStatusCode();
|
int status = method.getStatusCode();
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
|
|
||||||
package com.owncloud.android.lib.common.http.methods.webdav;
|
package com.owncloud.android.lib.common.http.methods.webdav;
|
||||||
|
|
||||||
import com.owncloud.android.lib.common.http.HttpClient;
|
|
||||||
import com.owncloud.android.lib.common.http.methods.HttpBaseMethod;
|
import com.owncloud.android.lib.common.http.methods.HttpBaseMethod;
|
||||||
|
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
@ -32,7 +31,6 @@ import java.util.concurrent.TimeUnit;
|
|||||||
|
|
||||||
import at.bitfire.dav4android.Constants;
|
import at.bitfire.dav4android.Constants;
|
||||||
import at.bitfire.dav4android.DavOCResource;
|
import at.bitfire.dav4android.DavOCResource;
|
||||||
import at.bitfire.dav4android.DavResource;
|
|
||||||
import at.bitfire.dav4android.exception.RedirectException;
|
import at.bitfire.dav4android.exception.RedirectException;
|
||||||
import okhttp3.HttpUrl;
|
import okhttp3.HttpUrl;
|
||||||
|
|
||||||
|
@ -28,6 +28,7 @@ import java.io.IOException;
|
|||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import at.bitfire.dav4android.Property;
|
import at.bitfire.dav4android.Property;
|
||||||
import at.bitfire.dav4android.Response;
|
import at.bitfire.dav4android.Response;
|
||||||
import at.bitfire.dav4android.exception.DavException;
|
import at.bitfire.dav4android.exception.DavException;
|
||||||
@ -71,7 +72,6 @@ public class PropfindMethod extends DavMethod {
|
|||||||
case OTHER:
|
case OTHER:
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
|
|
||||||
return Unit.INSTANCE;
|
return Unit.INSTANCE;
|
||||||
}, response -> {
|
}, response -> {
|
||||||
mResponse = response;
|
mResponse = response;
|
||||||
@ -82,7 +82,7 @@ public class PropfindMethod extends DavMethod {
|
|||||||
return davException.getCode();
|
return davException.getCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.getStatusCode();
|
return getStatusCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getDepth() {
|
public int getDepth() {
|
||||||
|
@ -77,7 +77,6 @@ public class ExistenceCheckRemoteOperation extends RemoteOperation {
|
|||||||
@Override
|
@Override
|
||||||
protected RemoteOperationResult run(OwnCloudClient client) {
|
protected RemoteOperationResult run(OwnCloudClient client) {
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
client.setFollowRedirects(true);
|
client.setFollowRedirects(true);
|
||||||
PropfindMethod propfindMethod = new PropfindMethod(
|
PropfindMethod propfindMethod = new PropfindMethod(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user