From 2d35b00273486f134f3fc95fb59b9b932794c956 Mon Sep 17 00:00:00 2001 From: "David A. Velasco" Date: Mon, 28 Aug 2017 08:58:30 +0200 Subject: [PATCH] Move constants for main endpoints from AccountUtils to OwnCloudClient --- .../owncloud/android/lib/common/OwnCloudClient.java | 10 ++++++---- .../android/lib/common/accounts/AccountUtils.java | 5 +---- .../lib/resources/status/GetRemoteStatusOperation.java | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/com/owncloud/android/lib/common/OwnCloudClient.java b/src/com/owncloud/android/lib/common/OwnCloudClient.java index 60c84851..8ef9cd6e 100644 --- a/src/com/owncloud/android/lib/common/OwnCloudClient.java +++ b/src/com/owncloud/android/lib/common/OwnCloudClient.java @@ -58,6 +58,10 @@ import com.owncloud.android.lib.resources.status.OwnCloudVersion; public class OwnCloudClient extends HttpClient { + public static final String WEBDAV_PATH_4_0 = "/remote.php/webdav"; + public static final String STATUS_PATH = "/status.php"; + public static final String FILES_WEB_PATH = "/index.php/apps/files"; + private static final String TAG = OwnCloudClient.class.getSimpleName(); private static final int MAX_REDIRECTIONS_COUNT = 3; private static final int MAX_REPEAT_COUNT_WITH_FRESH_CREDENTIALS = 1; @@ -322,9 +326,7 @@ public class OwnCloudClient extends HttpClient { destination = method.getRequestHeader("destination"); } if (destination != null) { - int suffixIndex = locationStr.lastIndexOf( - AccountUtils.WEBDAV_PATH_4_0 - ); + int suffixIndex = locationStr.lastIndexOf(WEBDAV_PATH_4_0); String redirectionBase = locationStr.substring(0, suffixIndex); String destinationStr = destination.getValue(); @@ -378,7 +380,7 @@ public class OwnCloudClient extends HttpClient { } public Uri getWebdavUri() { - return Uri.parse(mBaseUri + AccountUtils.WEBDAV_PATH_4_0); + return Uri.parse(mBaseUri + WEBDAV_PATH_4_0); } /** diff --git a/src/com/owncloud/android/lib/common/accounts/AccountUtils.java b/src/com/owncloud/android/lib/common/accounts/AccountUtils.java index 46b29994..a93ad141 100644 --- a/src/com/owncloud/android/lib/common/accounts/AccountUtils.java +++ b/src/com/owncloud/android/lib/common/accounts/AccountUtils.java @@ -51,9 +51,6 @@ public class AccountUtils { private static final String TAG = AccountUtils.class.getSimpleName(); - public static final String WEBDAV_PATH_4_0 = "/remote.php/webdav"; - public static final String STATUS_PATH = "/status.php"; - /** * Constructs full url to host and webdav resource basing on host version * @@ -65,7 +62,7 @@ public class AccountUtils { public static String getWebDavUrlForAccount(Context context, Account account) throws AccountNotFoundException { - return getBaseUrlForAccount(context, account) + WEBDAV_PATH_4_0; + return getBaseUrlForAccount(context, account) + OwnCloudClient.WEBDAV_PATH_4_0; } diff --git a/src/com/owncloud/android/lib/resources/status/GetRemoteStatusOperation.java b/src/com/owncloud/android/lib/resources/status/GetRemoteStatusOperation.java index 10e1f1b7..a4f32168 100644 --- a/src/com/owncloud/android/lib/resources/status/GetRemoteStatusOperation.java +++ b/src/com/owncloud/android/lib/resources/status/GetRemoteStatusOperation.java @@ -78,7 +78,7 @@ public class GetRemoteStatusOperation extends RemoteOperation { GetMethod get = null; String baseUrlSt = client.getBaseUri().toString(); try { - get = new GetMethod(baseUrlSt + AccountUtils.STATUS_PATH); + get = new GetMethod(baseUrlSt + OwnCloudClient.STATUS_PATH); HttpParams params = get.getParams().getDefaultParams(); params.setParameter(HttpMethodParams.USER_AGENT,