diff --git a/src/com/owncloud/android/lib/common/OwnCloudClient.java b/src/com/owncloud/android/lib/common/OwnCloudClient.java index d67fee6efa..3aba71d9d1 100644 --- a/src/com/owncloud/android/lib/common/OwnCloudClient.java +++ b/src/com/owncloud/android/lib/common/OwnCloudClient.java @@ -175,8 +175,6 @@ private int executeRedirectedHttpMethod (HttpBaseMethod method) throws Exception return status; } - - public RedirectionPath followRedirection(HttpBaseMethod method) throws Exception { int redirectionsCount = 0; int status = method.getStatusCode(); diff --git a/src/com/owncloud/android/lib/common/http/methods/webdav/DavMethod.java b/src/com/owncloud/android/lib/common/http/methods/webdav/DavMethod.java index 1c827b8868..bf926d6383 100644 --- a/src/com/owncloud/android/lib/common/http/methods/webdav/DavMethod.java +++ b/src/com/owncloud/android/lib/common/http/methods/webdav/DavMethod.java @@ -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 at.bitfire.dav4android.Constants; import at.bitfire.dav4android.DavOCResource; -import at.bitfire.dav4android.DavResource; import at.bitfire.dav4android.exception.RedirectException; import okhttp3.HttpUrl; @@ -61,8 +59,8 @@ public void abort() { @Override public int execute() throws Exception { try { - return onExecute(); - } catch(RedirectException e) { + return onExecute(); + } catch (RedirectException e) { return getStatusCode(); } } diff --git a/src/com/owncloud/android/lib/common/http/methods/webdav/PropfindMethod.java b/src/com/owncloud/android/lib/common/http/methods/webdav/PropfindMethod.java index 7962427b95..376470ad90 100644 --- a/src/com/owncloud/android/lib/common/http/methods/webdav/PropfindMethod.java +++ b/src/com/owncloud/android/lib/common/http/methods/webdav/PropfindMethod.java @@ -28,6 +28,7 @@ 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; @@ -73,16 +74,14 @@ public int onExecute() throws IOException, DavException { } return Unit.INSTANCE; - }, response -> { - mResponse = response; - return Unit.INSTANCE; - }); + }, response -> Unit.INSTANCE); } catch (UnauthorizedException davException) { // Do nothing, we will use the 401 code to handle the situation - return davException.getCode(); } - return super.getStatusCode(); + mResponse = mDavResource.getResponse(); + + return getStatusCode(); } public int getDepth() { diff --git a/src/com/owncloud/android/lib/resources/files/ExistenceCheckRemoteOperation.java b/src/com/owncloud/android/lib/resources/files/ExistenceCheckRemoteOperation.java index 8e733995f1..4c6ad18f5c 100644 --- a/src/com/owncloud/android/lib/resources/files/ExistenceCheckRemoteOperation.java +++ b/src/com/owncloud/android/lib/resources/files/ExistenceCheckRemoteOperation.java @@ -77,7 +77,6 @@ public ExistenceCheckRemoteOperation(String remotePath, boolean successIfAbsent) @Override protected RemoteOperationResult run(OwnCloudClient client) { - try { client.setFollowRedirects(true); PropfindMethod propfindMethod = new PropfindMethod(