diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/operations/RemoteOperationResult.java b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/operations/RemoteOperationResult.java index 0673fc0a..881aa0d2 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/operations/RemoteOperationResult.java +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/operations/RemoteOperationResult.java @@ -66,7 +66,7 @@ public class RemoteOperationResult private Exception mException = null; private ResultCode mCode = ResultCode.UNKNOWN_ERROR; private String mRedirectedLocation; - private ArrayList mAuthenticate = new ArrayList<>(); + private String mAuthenticate; private String mLastPermanentLocation = null; private T mData = null; @@ -253,7 +253,7 @@ public class RemoteOperationResult continue; } if ("www-authenticate".equals(header.getKey().toLowerCase())) { - mAuthenticate.add(header.getValue().get(0).toLowerCase()); + mAuthenticate = header.getValue().get(0).toLowerCase(); } } } @@ -494,7 +494,7 @@ public class RemoteOperationResult return (mRedirectedLocation != null && !(mRedirectedLocation.toLowerCase().startsWith("https://"))); } - public ArrayList getAuthenticateHeaders() { + public String getAuthenticateHeaders() { return mAuthenticate; } diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/server/CheckPathExistenceOperation.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/server/CheckPathExistenceOperation.kt index 051d7691..9f5636c0 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/server/CheckPathExistenceOperation.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/server/CheckPathExistenceOperation.kt @@ -56,7 +56,7 @@ class CheckPathExistenceOperation( * * @return Sequence of redirections followed, if any, or NULL if the operation was not executed. */ - lateinit var redirectionPath: RedirectionPath + var redirectionPath: RedirectionPath? = null private set override fun run(client: OwnCloudClient): RemoteOperationResult { @@ -75,7 +75,7 @@ class CheckPathExistenceOperation( var status = client.executeHttpMethod(propFindMethod) if (previousFollowRedirects) { redirectionPath = client.followRedirection(propFindMethod) - status = redirectionPath.lastStatus + status = redirectionPath?.lastStatus!! } /* PROPFIND method * 404 NOT FOUND: path doesn't exist, @@ -103,7 +103,7 @@ class CheckPathExistenceOperation( /** * @return 'True' if the operation was executed and at least one redirection was followed. */ - fun wasRedirected() = redirectionPath.redirectionsCount > 0 + fun wasRedirected() = (redirectionPath!=null && redirectionPath!!.redirectionsCount > 0) private fun isSuccess(status: Int) = status == HttpConstants.HTTP_OK || status == HttpConstants.HTTP_MULTI_STATUS