mirror of
https://github.com/owncloud/android-library.git
synced 2025-06-08 00:16:09 +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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public RedirectionPath followRedirection(HttpBaseMethod method) throws Exception {
|
||||
int redirectionsCount = 0;
|
||||
int status = method.getStatusCode();
|
||||
|
@ -24,7 +24,6 @@
|
||||
|
||||
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 java.net.URL;
|
||||
@ -32,7 +31,6 @@ import java.util.concurrent.TimeUnit;
|
||||
|
||||
import at.bitfire.dav4android.Constants;
|
||||
import at.bitfire.dav4android.DavOCResource;
|
||||
import at.bitfire.dav4android.DavResource;
|
||||
import at.bitfire.dav4android.exception.RedirectException;
|
||||
import okhttp3.HttpUrl;
|
||||
|
||||
@ -62,7 +60,7 @@ public abstract class DavMethod extends HttpBaseMethod {
|
||||
public int execute() throws Exception {
|
||||
try {
|
||||
return onExecute();
|
||||
} catch(RedirectException e) {
|
||||
} catch (RedirectException e) {
|
||||
return getStatusCode();
|
||||
}
|
||||
}
|
||||
|
@ -28,6 +28,7 @@ import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import at.bitfire.dav4android.Property;
|
||||
import at.bitfire.dav4android.Response;
|
||||
import at.bitfire.dav4android.exception.DavException;
|
||||
@ -71,7 +72,6 @@ public class PropfindMethod extends DavMethod {
|
||||
case OTHER:
|
||||
default:
|
||||
}
|
||||
|
||||
return Unit.INSTANCE;
|
||||
}, response -> {
|
||||
mResponse = response;
|
||||
@ -82,7 +82,7 @@ public class PropfindMethod extends DavMethod {
|
||||
return davException.getCode();
|
||||
}
|
||||
|
||||
return super.getStatusCode();
|
||||
return getStatusCode();
|
||||
}
|
||||
|
||||
public int getDepth() {
|
||||
|
@ -77,7 +77,6 @@ public class ExistenceCheckRemoteOperation extends RemoteOperation {
|
||||
@Override
|
||||
protected RemoteOperationResult run(OwnCloudClient client) {
|
||||
|
||||
|
||||
try {
|
||||
client.setFollowRedirects(true);
|
||||
PropfindMethod propfindMethod = new PropfindMethod(
|
||||
|
Loading…
x
Reference in New Issue
Block a user