From ff0483146f5458293305d0d97d6e826d07c1c5da Mon Sep 17 00:00:00 2001 From: Mario Danic Date: Tue, 24 Jan 2017 16:50:02 +0100 Subject: [PATCH 01/13] Update user info calls --- .../owncloud/android/lib/common/Quota.java | 65 ++++++ .../owncloud/android/lib/common/UserInfo.java | 105 ++++++++++ .../users/GetRemoteUserInfoOperation.java | 111 +++++++++-- .../users/RemoteGetUserQuotaOperation.java | 187 ------------------ .../lib/test_project/TestActivity.java | 7 - .../test_project/test/GetUserQuotaTest.java | 1 - 6 files changed, 268 insertions(+), 208 deletions(-) create mode 100644 src/com/owncloud/android/lib/common/Quota.java create mode 100644 src/com/owncloud/android/lib/common/UserInfo.java delete mode 100644 src/com/owncloud/android/lib/resources/users/RemoteGetUserQuotaOperation.java diff --git a/src/com/owncloud/android/lib/common/Quota.java b/src/com/owncloud/android/lib/common/Quota.java new file mode 100644 index 000000000..1a87b8056 --- /dev/null +++ b/src/com/owncloud/android/lib/common/Quota.java @@ -0,0 +1,65 @@ +package com.owncloud.android.lib.common; + +/** + * Created by mdjanic on 24/01/2017. + */ + +public class Quota { + public long free; + public long used; + public long total; + public long quota; + public double relative; + + public Quota() { + } + + public Quota(long free, long used, long total, double relative, long quota) { + + this.free = free; + this.used = used; + this.total = total; + this.quota = quota; + this.relative = relative; + } + + public long getFree() { + return free; + } + + public void setFree(long free) { + this.free = free; + } + + public long getUsed() { + return used; + } + + public void setUsed(long used) { + this.used = used; + } + + public long getTotal() { + return total; + } + + public void setTotal(long total) { + this.total = total; + } + + public long getQuota() { + return quota; + } + + public void setQuota(long quota) { + this.quota = quota; + } + + public double getRelative() { + return relative; + } + + public void setRelative(double relative) { + this.relative = relative; + } +} diff --git a/src/com/owncloud/android/lib/common/UserInfo.java b/src/com/owncloud/android/lib/common/UserInfo.java new file mode 100644 index 000000000..f64547660 --- /dev/null +++ b/src/com/owncloud/android/lib/common/UserInfo.java @@ -0,0 +1,105 @@ +package com.owncloud.android.lib.common; + +/** + * Created by mdjanic on 24/01/2017. + */ + +public class UserInfo { + public String id; + public Boolean enabled; + public String displayName; + public String email; + public String phone; + public String address; + public String webpage; + public String twitter; + public Quota quota; + + public UserInfo() { + } + + public UserInfo(String id, Boolean enabled, String displayName, String email, String phone, String address, + String webpage, String twitter, Quota quota) { + this.id = id; + this.enabled = enabled; + this.displayName = displayName; + this.email = email; + this.phone = phone; + this.address = address; + this.webpage = webpage; + this.twitter = twitter; + this.quota = quota; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public String getDisplayName() { + return displayName; + } + + public void setDisplayName(String displayName) { + this.displayName = displayName; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public String getWebpage() { + return webpage; + } + + public void setWebpage(String webpage) { + this.webpage = webpage; + } + + public String getTwitter() { + return twitter; + } + + public void setTwitter(String twitter) { + this.twitter = twitter; + } + + public Quota getQuota() { + return quota; + } + + public void setQuota(Quota quota) { + this.quota = quota; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } +} diff --git a/src/com/owncloud/android/lib/resources/users/GetRemoteUserInfoOperation.java b/src/com/owncloud/android/lib/resources/users/GetRemoteUserInfoOperation.java index bce20ba56..28ef32765 100644 --- a/src/com/owncloud/android/lib/resources/users/GetRemoteUserInfoOperation.java +++ b/src/com/owncloud/android/lib/resources/users/GetRemoteUserInfoOperation.java @@ -1,6 +1,7 @@ /* ownCloud Android Library is available under MIT license * Copyright (C) 2015 ownCloud Inc. - * + * Copyright (C) 2017 Nextcloud GmbH + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights @@ -25,12 +26,16 @@ package com.owncloud.android.lib.resources.users; import com.owncloud.android.lib.common.OwnCloudClient; +import com.owncloud.android.lib.common.Quota; +import com.owncloud.android.lib.common.UserInfo; import com.owncloud.android.lib.common.operations.RemoteOperation; import com.owncloud.android.lib.common.operations.RemoteOperationResult; import com.owncloud.android.lib.common.utils.Log_OC; import org.apache.commons.httpclient.HttpStatus; +import org.apache.commons.httpclient.NameValuePair; import org.apache.commons.httpclient.methods.GetMethod; +import org.json.JSONException; import org.json.JSONObject; import java.util.ArrayList; @@ -40,35 +45,83 @@ * * @author masensio * @author David A. Velasco + * @author Mario Danic */ public class GetRemoteUserInfoOperation extends RemoteOperation { private static final String TAG = GetRemoteUserInfoOperation.class.getSimpleName(); // OCS Route - private static final String OCS_ROUTE = "/ocs/v1.php/cloud/user?format=json"; + private static final String OCS_ROUTE_SELF = "/ocs/v1.php/cloud/user"; + private static final String OCS_ROUTE_SEARCH = "/ocs/v1.php/cloud/users/"; // JSON Node names private static final String NODE_OCS = "ocs"; private static final String NODE_DATA = "data"; private static final String NODE_ID = "id"; - private static final String NODE_DISPLAY_NAME = "display-name"; + private static final String NODE_DISPLAY_NAME = "displayname"; private static final String NODE_EMAIL = "email"; + private static final String NODE_ENABLED = "enabled"; + private static final String NODE_PHONE = "phone"; + private static final String NODE_ADDRESS = "address"; + private static final String NODE_WEBPAGE = "webpage"; + private static final String NODE_TWITTER = "twitter"; + + private static final String NODE_QUOTA = "quota"; + private static final String NODE_QUOTA_FREE = "free"; + private static final String NODE_QUOTA_USED = "used"; + private static final String NODE_QUOTA_TOTAL = "total"; + private static final String NODE_QUOTA_RELATIVE = "relative"; + + /** + * Quota return value for a not computed space value. + */ + public static final long SPACE_NOT_COMPUTED = -1; + + /** + * Quota return value for unknown space value. + */ + public static final long SPACE_UNKNOWN = -2; + + /** + * Quota return value for unlimited space. + */ + public static final long SPACE_UNLIMITED = -3; + + /** + * Quota return value for quota information not available. + */ + public static final long QUOTA_LIMIT_INFO_NOT_AVAILABLE = Long.MIN_VALUE; + + private static String userId = null; public GetRemoteUserInfoOperation() { } + public GetRemoteUserInfoOperation(String lookupUserId) { + userId = lookupUserId; + } + @Override protected RemoteOperationResult run(OwnCloudClient client) { RemoteOperationResult result = null; int status = -1; GetMethod get = null; + String url; //Get the user try { - get = new GetMethod(client.getBaseUri() + OCS_ROUTE); + if (userId != null) { + url = client.getBaseUri() + OCS_ROUTE_SEARCH + userId; + } else { + url = OCS_ROUTE_SELF; + } + + get = new GetMethod(url); get.addRequestHeader(OCS_API_HEADER, OCS_API_HEADER_VALUE); + get.setQueryString(new NameValuePair[]{new NameValuePair("format", "json")}); status = client.executeMethod(get); + if (isSuccess(status)) { String response = get.getResponseBodyAsString(); Log_OC.d(TAG, "Successful response: " + response); @@ -79,9 +132,47 @@ protected RemoteOperationResult run(OwnCloudClient client) { JSONObject respData = respOCS.getJSONObject(NODE_DATA); UserInfo userInfo = new UserInfo(); - userInfo.mId = respData.getString(NODE_ID); - userInfo.mDisplayName = respData.getString(NODE_DISPLAY_NAME); - userInfo.mEmail = respData.getString(NODE_EMAIL); + + userInfo.setId(respData.getString(NODE_ID)); + userInfo.setDisplayName(respData.getString(NODE_DISPLAY_NAME)); + userInfo.setEmail(respData.getString(NODE_EMAIL)); + + JSONObject quota = respData.getJSONObject(NODE_QUOTA); + final Long quotaFree = quota.getLong(NODE_QUOTA_FREE); + final Long quotaUsed = quota.getLong(NODE_QUOTA_USED); + final Long quotaTotal = quota.getLong(NODE_QUOTA_TOTAL); + final Double quotaRelative = quota.getDouble(NODE_QUOTA_RELATIVE); + + Long quotaValue; + try { + quotaValue = quota.getLong(NODE_QUOTA); + } catch (JSONException e) { + Log_OC.i(TAG, "Legacy server in use < Nextcloud 9.0.54"); + quotaValue = QUOTA_LIMIT_INFO_NOT_AVAILABLE; + } + + userInfo.setQuota(new Quota(quotaFree, quotaUsed, quotaTotal, quotaRelative, quotaValue)); + + // This information will be available in 11 and 12 only + if (respData.has(NODE_PHONE)) { + userInfo.setPhone(respData.getString(NODE_PHONE)); + } + + if (respData.has(NODE_ADDRESS)) { + userInfo.setAddress(respData.getString(NODE_ADDRESS)); + } + + if (respData.has(NODE_WEBPAGE)) { + userInfo.setWebpage(respData.getString(NODE_WEBPAGE)); + } + + if (respData.has(NODE_TWITTER)) { + userInfo.setTwitter(respData.getString(NODE_TWITTER)); + } + + if (respData.has(NODE_ENABLED)) { + userInfo.setEnabled(respData.getBoolean(NODE_ENABLED)); + } // Result result = new RemoteOperationResult(true, status, get.getResponseHeaders()); @@ -113,10 +204,4 @@ protected RemoteOperationResult run(OwnCloudClient client) { private boolean isSuccess(int status) { return (status == HttpStatus.SC_OK); } - - public static class UserInfo { - public String mId = ""; - public String mDisplayName = ""; - public String mEmail = ""; - } } diff --git a/src/com/owncloud/android/lib/resources/users/RemoteGetUserQuotaOperation.java b/src/com/owncloud/android/lib/resources/users/RemoteGetUserQuotaOperation.java deleted file mode 100644 index 9f6d69e02..000000000 --- a/src/com/owncloud/android/lib/resources/users/RemoteGetUserQuotaOperation.java +++ /dev/null @@ -1,187 +0,0 @@ -/* Nextcloud Android Library is available under MIT license - * - * Copyright (C) 2016 Nextcloud - * Copyright (C) 2016 Andy Scherzinger - * Copyright (C) 2015 ownCloud Inc. - * Copyright (C) 2015 Bartosz Przybylski - * Copyright (C) 2014 Marcello Steiner - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - */ - -package com.owncloud.android.lib.resources.users; - -import com.owncloud.android.lib.common.OwnCloudBasicCredentials; -import com.owncloud.android.lib.common.OwnCloudClient; -import com.owncloud.android.lib.common.operations.RemoteOperation; -import com.owncloud.android.lib.common.operations.RemoteOperationResult; -import com.owncloud.android.lib.common.utils.Log_OC; - -import org.apache.commons.httpclient.HttpStatus; -import org.apache.commons.httpclient.NameValuePair; -import org.apache.commons.httpclient.methods.GetMethod; -import org.json.JSONException; -import org.json.JSONObject; - -import java.util.ArrayList; - -/** - * Gets a logged in user's quota information (free, used, total and quota). - * - * @author marcello - * @author Andy Scherzinger - */ -public class RemoteGetUserQuotaOperation extends RemoteOperation { - - static public class Quota { - private long mFree, mUsed, mTotal, mQuota; - private double mRelative; - - public Quota(long free, long used, long total, double relative, long quota) { - mFree = free; - mUsed = used; - mTotal = total; - mRelative = relative; - mQuota = quota; - } - - public long getFree() { - return mFree; - } - - public long getUsed() { - return mUsed; - } - - public long getTotal() { - return mTotal; - } - - public long getQuota() { - return mQuota; - } - - public double getRelative() { - return mRelative; - } - } - - private static final String TAG = RemoteGetUserQuotaOperation.class.getSimpleName(); - - private static final String NODE_OCS = "ocs"; - private static final String NODE_DATA = "data"; - private static final String NODE_QUOTA = "quota"; - private static final String NODE_QUOTA_FREE = "free"; - private static final String NODE_QUOTA_USED = "used"; - private static final String NODE_QUOTA_TOTAL = "total"; - private static final String NODE_QUOTA_RELATIVE = "relative"; - - /** - * Quota return value for a not computed space value. - */ - public static final long SPACE_NOT_COMPUTED = -1; - - /** - * Quota return value for unknown space value. - */ - public static final long SPACE_UNKNOWN = -2; - - /** - * Quota return value for unlimited space. - */ - public static final long SPACE_UNLIMITED = -3; - - /** - * Quota return value for quota information not available. - */ - public static final long QUOTA_LIMIT_INFO_NOT_AVAILABLE = Long.MIN_VALUE; - - // OCS Route - private static final String OCS_ROUTE = "/ocs/v1.php/cloud/users/"; - - @Override - protected RemoteOperationResult run(OwnCloudClient client) { - RemoteOperationResult result = null; - int status; - GetMethod get = null; - - //Get the user - try { - OwnCloudBasicCredentials credentials = (OwnCloudBasicCredentials) client.getCredentials(); - String url = client.getBaseUri() + OCS_ROUTE + credentials.getUsername(); - - get = new GetMethod(url); - get.addRequestHeader(OCS_API_HEADER, OCS_API_HEADER_VALUE); - get.setQueryString(new NameValuePair[]{new NameValuePair("format", "json")}); - status = client.executeMethod(get); - - if (isSuccess(status)) { - String response = get.getResponseBodyAsString(); - - // Parse the response - JSONObject respJSON = new JSONObject(response); - JSONObject respOCS = respJSON.getJSONObject(NODE_OCS); - JSONObject respData = respOCS.getJSONObject(NODE_DATA); - JSONObject quota = respData.getJSONObject(NODE_QUOTA); - final Long quotaFree = quota.getLong(NODE_QUOTA_FREE); - final Long quotaUsed = quota.getLong(NODE_QUOTA_USED); - final Long quotaTotal = quota.getLong(NODE_QUOTA_TOTAL); - final Double quotaRelative = quota.getDouble(NODE_QUOTA_RELATIVE); - Long quotaValue; - try { - quotaValue = quota.getLong(NODE_QUOTA); - } catch (JSONException e) { - Log_OC.i(TAG, "Legacy server in use < Nextcloud 9.0.54"); - quotaValue = QUOTA_LIMIT_INFO_NOT_AVAILABLE; - } - - // Result - result = new RemoteOperationResult(true, status, get.getResponseHeaders()); - - // Quota data in data collection - ArrayList data = new ArrayList<>(); - data.add(new Quota(quotaFree, quotaUsed, quotaTotal, quotaRelative, quotaValue)); - result.setData(data); - } else { - result = new RemoteOperationResult(false, status, get.getResponseHeaders()); - String response = get.getResponseBodyAsString(); - Log_OC.e(TAG, "Failed response while getting user quota information "); - if (response != null) { - Log_OC.e(TAG, "*** status code: " + status + " ; response message: " + response); - } else { - Log_OC.e(TAG, "*** status code: " + status); - } - } - } catch (Exception e) { - result = new RemoteOperationResult(e); - Log_OC.e(TAG, "Exception while getting OC user information", e); - } finally { - if (get != null) { - get.releaseConnection(); - } - } - return result; - } - - private boolean isSuccess(int status) { - return (status == HttpStatus.SC_OK); - } -} diff --git a/test_client/src/com/owncloud/android/lib/test_project/TestActivity.java b/test_client/src/com/owncloud/android/lib/test_project/TestActivity.java index 8eec85a26..a8626fd49 100644 --- a/test_client/src/com/owncloud/android/lib/test_project/TestActivity.java +++ b/test_client/src/com/owncloud/android/lib/test_project/TestActivity.java @@ -35,7 +35,6 @@ import com.owncloud.android.lib.common.OwnCloudClientFactory; import com.owncloud.android.lib.common.OwnCloudCredentialsFactory; import com.owncloud.android.lib.common.network.NetworkUtils; -import com.owncloud.android.lib.common.operations.RemoteOperation; import com.owncloud.android.lib.common.operations.RemoteOperationResult; import com.owncloud.android.lib.resources.files.ChunkedUploadRemoteFileOperation; import com.owncloud.android.lib.resources.files.CreateRemoteFolderOperation; @@ -49,7 +48,6 @@ import com.owncloud.android.lib.resources.shares.GetRemoteSharesOperation; import com.owncloud.android.lib.resources.shares.RemoveRemoteShareOperation; import com.owncloud.android.lib.resources.shares.ShareType; -import com.owncloud.android.lib.resources.users.RemoteGetUserQuotaOperation; import org.apache.commons.httpclient.protocol.Protocol; import org.apache.commons.httpclient.protocol.ProtocolSocketFactory; @@ -338,11 +336,6 @@ public RemoteOperationResult removeShare(int idShare) { } - public RemoteOperationResult getQuota() { - RemoteGetUserQuotaOperation getUserQuotaOperation = new RemoteGetUserQuotaOperation(); - return getUserQuotaOperation.execute(mClient); - } - /** * Extracts file from AssetManager to cache folder. diff --git a/test_client/tests/src/com/owncloud/android/lib/test_project/test/GetUserQuotaTest.java b/test_client/tests/src/com/owncloud/android/lib/test_project/test/GetUserQuotaTest.java index 897af33bb..daa2a3cff 100644 --- a/test_client/tests/src/com/owncloud/android/lib/test_project/test/GetUserQuotaTest.java +++ b/test_client/tests/src/com/owncloud/android/lib/test_project/test/GetUserQuotaTest.java @@ -32,7 +32,6 @@ import com.owncloud.android.lib.common.operations.RemoteOperationResult; import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode; -import com.owncloud.android.lib.resources.users.RemoteGetUserQuotaOperation.Quota; import com.owncloud.android.lib.test_project.TestActivity; import com.owncloud.android.lib.resources.files.*; From c6f7522090b2fd344fc2b09e513219aae137a239 Mon Sep 17 00:00:00 2001 From: Mario Danic Date: Tue, 24 Jan 2017 16:56:32 +0100 Subject: [PATCH 02/13] Update display name --- .../android/lib/resources/users/GetRemoteUserInfoOperation.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/owncloud/android/lib/resources/users/GetRemoteUserInfoOperation.java b/src/com/owncloud/android/lib/resources/users/GetRemoteUserInfoOperation.java index 28ef32765..815da47da 100644 --- a/src/com/owncloud/android/lib/resources/users/GetRemoteUserInfoOperation.java +++ b/src/com/owncloud/android/lib/resources/users/GetRemoteUserInfoOperation.java @@ -59,7 +59,7 @@ public class GetRemoteUserInfoOperation extends RemoteOperation { private static final String NODE_OCS = "ocs"; private static final String NODE_DATA = "data"; private static final String NODE_ID = "id"; - private static final String NODE_DISPLAY_NAME = "displayname"; + private static final String NODE_DISPLAY_NAME = "display-name"; private static final String NODE_EMAIL = "email"; private static final String NODE_ENABLED = "enabled"; private static final String NODE_PHONE = "phone"; From 1aed66fb17c9522ab91de6c02d31513d9d79a4a7 Mon Sep 17 00:00:00 2001 From: Mario Danic Date: Wed, 25 Jan 2017 10:37:12 +0100 Subject: [PATCH 03/13] Fix a nasty nasty bug --- .../android/lib/resources/users/GetRemoteUserInfoOperation.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/owncloud/android/lib/resources/users/GetRemoteUserInfoOperation.java b/src/com/owncloud/android/lib/resources/users/GetRemoteUserInfoOperation.java index 815da47da..94c953d9d 100644 --- a/src/com/owncloud/android/lib/resources/users/GetRemoteUserInfoOperation.java +++ b/src/com/owncloud/android/lib/resources/users/GetRemoteUserInfoOperation.java @@ -114,7 +114,7 @@ protected RemoteOperationResult run(OwnCloudClient client) { if (userId != null) { url = client.getBaseUri() + OCS_ROUTE_SEARCH + userId; } else { - url = OCS_ROUTE_SELF; + url = client.getBaseUri() + OCS_ROUTE_SELF; } get = new GetMethod(url); From a6b147c470fa671d37241a99d54470b7ba07ab09 Mon Sep 17 00:00:00 2001 From: Mario Danic Date: Wed, 25 Jan 2017 11:52:24 +0100 Subject: [PATCH 04/13] Add support for two endpoints --- .../lib/resources/status/OwnCloudVersion.java | 7 +++++ .../users/GetRemoteUserInfoOperation.java | 28 +++++++++++++------ 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/src/com/owncloud/android/lib/resources/status/OwnCloudVersion.java b/src/com/owncloud/android/lib/resources/status/OwnCloudVersion.java index 1b9f85461..c5abb1b0c 100644 --- a/src/com/owncloud/android/lib/resources/status/OwnCloudVersion.java +++ b/src/com/owncloud/android/lib/resources/status/OwnCloudVersion.java @@ -49,6 +49,8 @@ public class OwnCloudVersion implements Comparable { public static final int VERSION_8 = 0x08000000; // 8.0 + public static final int VERSION_12 = 0x12000000; //12 + public static final int MINIMUM_VERSION_CAPABILITIES_API = 0x08010000; // 8.1 private static final int MAX_DOTS = 3; @@ -156,4 +158,9 @@ public boolean isSearchUsersSupported() { public boolean isVersionWithCapabilitiesAPI(){ return (mVersion>= MINIMUM_VERSION_CAPABILITIES_API); } + + public boolean isSelfSupported() { + return (mVersion >= VERSION_12); + } + } diff --git a/src/com/owncloud/android/lib/resources/users/GetRemoteUserInfoOperation.java b/src/com/owncloud/android/lib/resources/users/GetRemoteUserInfoOperation.java index 94c953d9d..3dac019df 100644 --- a/src/com/owncloud/android/lib/resources/users/GetRemoteUserInfoOperation.java +++ b/src/com/owncloud/android/lib/resources/users/GetRemoteUserInfoOperation.java @@ -25,12 +25,14 @@ package com.owncloud.android.lib.resources.users; +import com.owncloud.android.lib.common.OwnCloudBasicCredentials; import com.owncloud.android.lib.common.OwnCloudClient; import com.owncloud.android.lib.common.Quota; import com.owncloud.android.lib.common.UserInfo; import com.owncloud.android.lib.common.operations.RemoteOperation; import com.owncloud.android.lib.common.operations.RemoteOperationResult; import com.owncloud.android.lib.common.utils.Log_OC; +import com.owncloud.android.lib.resources.status.OwnCloudVersion; import org.apache.commons.httpclient.HttpStatus; import org.apache.commons.httpclient.NameValuePair; @@ -60,6 +62,7 @@ public class GetRemoteUserInfoOperation extends RemoteOperation { private static final String NODE_DATA = "data"; private static final String NODE_ID = "id"; private static final String NODE_DISPLAY_NAME = "display-name"; + private static final String NODE_DISPLAY_NAME_ALT = "displayname"; private static final String NODE_EMAIL = "email"; private static final String NODE_ENABLED = "enabled"; private static final String NODE_PHONE = "phone"; @@ -93,15 +96,10 @@ public class GetRemoteUserInfoOperation extends RemoteOperation { */ public static final long QUOTA_LIMIT_INFO_NOT_AVAILABLE = Long.MIN_VALUE; - private static String userId = null; public GetRemoteUserInfoOperation() { } - public GetRemoteUserInfoOperation(String lookupUserId) { - userId = lookupUserId; - } - @Override protected RemoteOperationResult run(OwnCloudClient client) { RemoteOperationResult result = null; @@ -109,10 +107,16 @@ protected RemoteOperationResult run(OwnCloudClient client) { GetMethod get = null; String url; + OwnCloudBasicCredentials credentials = (OwnCloudBasicCredentials) client.getCredentials(); + + OwnCloudVersion version = client.getOwnCloudVersion(); + boolean versionWithSelfAPI = + (version != null && version.isSelfSupported()); + //Get the user try { - if (userId != null) { - url = client.getBaseUri() + OCS_ROUTE_SEARCH + userId; + if (!versionWithSelfAPI) { + url = client.getBaseUri() + OCS_ROUTE_SEARCH + credentials.getUsername(); } else { url = client.getBaseUri() + OCS_ROUTE_SELF; } @@ -134,7 +138,13 @@ protected RemoteOperationResult run(OwnCloudClient client) { UserInfo userInfo = new UserInfo(); userInfo.setId(respData.getString(NODE_ID)); - userInfo.setDisplayName(respData.getString(NODE_DISPLAY_NAME)); + + // Two endpoints, two different responses + if (respData.has(NODE_DISPLAY_NAME)) { + userInfo.setDisplayName(respData.getString(NODE_DISPLAY_NAME)); + } else { + userInfo.setDisplayName(respData.getString(NODE_DISPLAY_NAME_ALT)); + } userInfo.setEmail(respData.getString(NODE_EMAIL)); JSONObject quota = respData.getJSONObject(NODE_QUOTA); @@ -153,7 +163,7 @@ protected RemoteOperationResult run(OwnCloudClient client) { userInfo.setQuota(new Quota(quotaFree, quotaUsed, quotaTotal, quotaRelative, quotaValue)); - // This information will be available in 11 and 12 only + // This information will be available in 11 and 12 only, but no point in hardcoding the version if (respData.has(NODE_PHONE)) { userInfo.setPhone(respData.getString(NODE_PHONE)); } From cf54152a5d4213c094f9e02c4ee89fb23480cc51 Mon Sep 17 00:00:00 2001 From: Mario Danic Date: Wed, 25 Jan 2017 12:03:38 +0100 Subject: [PATCH 05/13] Fix a bug with an ID missing --- .../lib/resources/users/GetRemoteUserInfoOperation.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/com/owncloud/android/lib/resources/users/GetRemoteUserInfoOperation.java b/src/com/owncloud/android/lib/resources/users/GetRemoteUserInfoOperation.java index 3dac019df..70ca7a2b3 100644 --- a/src/com/owncloud/android/lib/resources/users/GetRemoteUserInfoOperation.java +++ b/src/com/owncloud/android/lib/resources/users/GetRemoteUserInfoOperation.java @@ -137,7 +137,12 @@ protected RemoteOperationResult run(OwnCloudClient client) { UserInfo userInfo = new UserInfo(); - userInfo.setId(respData.getString(NODE_ID)); + // we don't really always have the ID + if (!respData.has(NODE_ID)) { + userInfo.setId(respData.getString(NODE_ID)); + } else { + userInfo.setId(credentials.getUsername()); + } // Two endpoints, two different responses if (respData.has(NODE_DISPLAY_NAME)) { From 9be8aa2fab57594f1250698ae45e0b4b2725897c Mon Sep 17 00:00:00 2001 From: Mario Danic Date: Wed, 25 Jan 2017 12:09:52 +0100 Subject: [PATCH 06/13] Refine the self calls --- .../lib/resources/status/OwnCloudVersion.java | 4 ++- .../users/GetRemoteUserInfoOperation.java | 27 ++++++++++--------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/com/owncloud/android/lib/resources/status/OwnCloudVersion.java b/src/com/owncloud/android/lib/resources/status/OwnCloudVersion.java index c5abb1b0c..b600d9335 100644 --- a/src/com/owncloud/android/lib/resources/status/OwnCloudVersion.java +++ b/src/com/owncloud/android/lib/resources/status/OwnCloudVersion.java @@ -52,6 +52,8 @@ public class OwnCloudVersion implements Comparable { public static final int VERSION_12 = 0x12000000; //12 public static final int MINIMUM_VERSION_CAPABILITIES_API = 0x08010000; // 8.1 + + public static final int MINIMUM_SELF_API = 0x11000200; private static final int MAX_DOTS = 3; @@ -160,7 +162,7 @@ public boolean isVersionWithCapabilitiesAPI(){ } public boolean isSelfSupported() { - return (mVersion >= VERSION_12); + return (mVersion >= MINIMUM_SELF_API); } } diff --git a/src/com/owncloud/android/lib/resources/users/GetRemoteUserInfoOperation.java b/src/com/owncloud/android/lib/resources/users/GetRemoteUserInfoOperation.java index 70ca7a2b3..6657deea5 100644 --- a/src/com/owncloud/android/lib/resources/users/GetRemoteUserInfoOperation.java +++ b/src/com/owncloud/android/lib/resources/users/GetRemoteUserInfoOperation.java @@ -138,7 +138,7 @@ protected RemoteOperationResult run(OwnCloudClient client) { UserInfo userInfo = new UserInfo(); // we don't really always have the ID - if (!respData.has(NODE_ID)) { + if (respData.has(NODE_ID)) { userInfo.setId(respData.getString(NODE_ID)); } else { userInfo.setId(credentials.getUsername()); @@ -168,21 +168,22 @@ protected RemoteOperationResult run(OwnCloudClient client) { userInfo.setQuota(new Quota(quotaFree, quotaUsed, quotaTotal, quotaRelative, quotaValue)); - // This information will be available in 11 and 12 only, but no point in hardcoding the version - if (respData.has(NODE_PHONE)) { - userInfo.setPhone(respData.getString(NODE_PHONE)); - } + if (versionWithSelfAPI) { + if (respData.has(NODE_PHONE)) { + userInfo.setPhone(respData.getString(NODE_PHONE)); + } - if (respData.has(NODE_ADDRESS)) { - userInfo.setAddress(respData.getString(NODE_ADDRESS)); - } + if (respData.has(NODE_ADDRESS)) { + userInfo.setAddress(respData.getString(NODE_ADDRESS)); + } - if (respData.has(NODE_WEBPAGE)) { - userInfo.setWebpage(respData.getString(NODE_WEBPAGE)); - } + if (respData.has(NODE_WEBPAGE)) { + userInfo.setWebpage(respData.getString(NODE_WEBPAGE)); + } - if (respData.has(NODE_TWITTER)) { - userInfo.setTwitter(respData.getString(NODE_TWITTER)); + if (respData.has(NODE_TWITTER)) { + userInfo.setTwitter(respData.getString(NODE_TWITTER)); + } } if (respData.has(NODE_ENABLED)) { From c085af663116c1fd0c36ab5e17b3e79591fb27db Mon Sep 17 00:00:00 2001 From: Mario Danic Date: Wed, 25 Jan 2017 14:30:14 +0100 Subject: [PATCH 07/13] Add copyright headers --- .../owncloud/android/lib/common/Quota.java | 19 +++++++++++++++++++ .../owncloud/android/lib/common/UserInfo.java | 19 +++++++++++++++++++ .../users/GetRemoteUserInfoOperation.java | 2 +- 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/src/com/owncloud/android/lib/common/Quota.java b/src/com/owncloud/android/lib/common/Quota.java index 1a87b8056..49f3bc56b 100644 --- a/src/com/owncloud/android/lib/common/Quota.java +++ b/src/com/owncloud/android/lib/common/Quota.java @@ -1,3 +1,22 @@ +/** + * Nextcloud Android client application + * + * @author Mario Danic + * Copyright (C) 2017 Nextcloud GmbH. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ package com.owncloud.android.lib.common; /** diff --git a/src/com/owncloud/android/lib/common/UserInfo.java b/src/com/owncloud/android/lib/common/UserInfo.java index f64547660..0de831662 100644 --- a/src/com/owncloud/android/lib/common/UserInfo.java +++ b/src/com/owncloud/android/lib/common/UserInfo.java @@ -1,3 +1,22 @@ +/** + * Nextcloud Android client application + * + * @author Mario Danic + * Copyright (C) 2017 Nextcloud GmbH. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ package com.owncloud.android.lib.common; /** diff --git a/src/com/owncloud/android/lib/resources/users/GetRemoteUserInfoOperation.java b/src/com/owncloud/android/lib/resources/users/GetRemoteUserInfoOperation.java index 6657deea5..a3a882413 100644 --- a/src/com/owncloud/android/lib/resources/users/GetRemoteUserInfoOperation.java +++ b/src/com/owncloud/android/lib/resources/users/GetRemoteUserInfoOperation.java @@ -43,7 +43,7 @@ import java.util.ArrayList; /** - * Gets information (id, display name, and e-mail address) about the user logged in. + * Gets information (id, display name, and e-mail address and many other things) about the user logged in. * * @author masensio * @author David A. Velasco From 7fe966a1ee54686b043481a37f3660ecb70d3539 Mon Sep 17 00:00:00 2001 From: Mario Danic Date: Wed, 25 Jan 2017 16:10:07 +0100 Subject: [PATCH 08/13] Add Parcel magic --- build.gradle | 2 ++ src/com/owncloud/android/lib/common/Quota.java | 3 +++ src/com/owncloud/android/lib/common/UserInfo.java | 3 +++ 3 files changed, 8 insertions(+) diff --git a/build.gradle b/build.gradle index 33a0fd753..71bce4b26 100644 --- a/build.gradle +++ b/build.gradle @@ -19,6 +19,8 @@ repositories { dependencies { compile 'org.apache.jackrabbit:jackrabbit-webdav:2.12.4' + compile 'org.parceler:parceler-api:1.1.6' + annotationProcessor 'org.parceler:parceler:1.1.6' } android { diff --git a/src/com/owncloud/android/lib/common/Quota.java b/src/com/owncloud/android/lib/common/Quota.java index 49f3bc56b..ab2768295 100644 --- a/src/com/owncloud/android/lib/common/Quota.java +++ b/src/com/owncloud/android/lib/common/Quota.java @@ -19,10 +19,13 @@ */ package com.owncloud.android.lib.common; +import org.parceler.Parcel; + /** * Created by mdjanic on 24/01/2017. */ +@Parcel public class Quota { public long free; public long used; diff --git a/src/com/owncloud/android/lib/common/UserInfo.java b/src/com/owncloud/android/lib/common/UserInfo.java index 0de831662..141954098 100644 --- a/src/com/owncloud/android/lib/common/UserInfo.java +++ b/src/com/owncloud/android/lib/common/UserInfo.java @@ -19,10 +19,13 @@ */ package com.owncloud.android.lib.common; +import org.parceler.Parcel; + /** * Created by mdjanic on 24/01/2017. */ +@Parcel public class UserInfo { public String id; public Boolean enabled; From 2781df80cb774fe47df7a6f7078075078d8386f5 Mon Sep 17 00:00:00 2001 From: Mario Danic Date: Wed, 25 Jan 2017 17:26:51 +0100 Subject: [PATCH 09/13] Fix a bug with a few fields on null --- .../users/GetRemoteUserInfoOperation.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/com/owncloud/android/lib/resources/users/GetRemoteUserInfoOperation.java b/src/com/owncloud/android/lib/resources/users/GetRemoteUserInfoOperation.java index a3a882413..8c62461ea 100644 --- a/src/com/owncloud/android/lib/resources/users/GetRemoteUserInfoOperation.java +++ b/src/com/owncloud/android/lib/resources/users/GetRemoteUserInfoOperation.java @@ -25,6 +25,8 @@ package com.owncloud.android.lib.resources.users; +import android.text.TextUtils; + import com.owncloud.android.lib.common.OwnCloudBasicCredentials; import com.owncloud.android.lib.common.OwnCloudClient; import com.owncloud.android.lib.common.Quota; @@ -150,7 +152,10 @@ protected RemoteOperationResult run(OwnCloudClient client) { } else { userInfo.setDisplayName(respData.getString(NODE_DISPLAY_NAME_ALT)); } - userInfo.setEmail(respData.getString(NODE_EMAIL)); + + if (respData.getString(NODE_EMAIL) != null) { + userInfo.setEmail(respData.getString(NODE_EMAIL)); + } JSONObject quota = respData.getJSONObject(NODE_QUOTA); final Long quotaFree = quota.getLong(NODE_QUOTA_FREE); @@ -169,19 +174,19 @@ protected RemoteOperationResult run(OwnCloudClient client) { userInfo.setQuota(new Quota(quotaFree, quotaUsed, quotaTotal, quotaRelative, quotaValue)); if (versionWithSelfAPI) { - if (respData.has(NODE_PHONE)) { + if (respData.has(NODE_PHONE) && TextUtils.isEmpty(respData.getString(NODE_PHONE))) { userInfo.setPhone(respData.getString(NODE_PHONE)); } - if (respData.has(NODE_ADDRESS)) { + if (respData.has(NODE_ADDRESS) && TextUtils.isEmpty(respData.getString(NODE_ADDRESS))) { userInfo.setAddress(respData.getString(NODE_ADDRESS)); } - if (respData.has(NODE_WEBPAGE)) { + if (respData.has(NODE_WEBPAGE) && TextUtils.isEmpty(respData.getString(NODE_WEBPAGE))) { userInfo.setWebpage(respData.getString(NODE_WEBPAGE)); } - if (respData.has(NODE_TWITTER)) { + if (respData.has(NODE_TWITTER) && TextUtils.isEmpty(respData.getString(NODE_TWITTER))) { userInfo.setTwitter(respData.getString(NODE_TWITTER)); } } From 2af5e4fde8a3808a669a92779d6d7aab4eb8a43a Mon Sep 17 00:00:00 2001 From: Mario Danic Date: Wed, 25 Jan 2017 17:30:43 +0100 Subject: [PATCH 10/13] Fix an ugly typo --- .../resources/users/GetRemoteUserInfoOperation.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/com/owncloud/android/lib/resources/users/GetRemoteUserInfoOperation.java b/src/com/owncloud/android/lib/resources/users/GetRemoteUserInfoOperation.java index 8c62461ea..15ed6959b 100644 --- a/src/com/owncloud/android/lib/resources/users/GetRemoteUserInfoOperation.java +++ b/src/com/owncloud/android/lib/resources/users/GetRemoteUserInfoOperation.java @@ -153,7 +153,7 @@ protected RemoteOperationResult run(OwnCloudClient client) { userInfo.setDisplayName(respData.getString(NODE_DISPLAY_NAME_ALT)); } - if (respData.getString(NODE_EMAIL) != null) { + if (respData.getString(NODE_EMAIL) != null && !TextUtils.isEmpty(respData.getString(NODE_EMAIL))) { userInfo.setEmail(respData.getString(NODE_EMAIL)); } @@ -174,19 +174,19 @@ protected RemoteOperationResult run(OwnCloudClient client) { userInfo.setQuota(new Quota(quotaFree, quotaUsed, quotaTotal, quotaRelative, quotaValue)); if (versionWithSelfAPI) { - if (respData.has(NODE_PHONE) && TextUtils.isEmpty(respData.getString(NODE_PHONE))) { + if (respData.has(NODE_PHONE) && !TextUtils.isEmpty(respData.getString(NODE_PHONE))) { userInfo.setPhone(respData.getString(NODE_PHONE)); } - if (respData.has(NODE_ADDRESS) && TextUtils.isEmpty(respData.getString(NODE_ADDRESS))) { + if (respData.has(NODE_ADDRESS) && !TextUtils.isEmpty(respData.getString(NODE_ADDRESS))) { userInfo.setAddress(respData.getString(NODE_ADDRESS)); } - if (respData.has(NODE_WEBPAGE) && TextUtils.isEmpty(respData.getString(NODE_WEBPAGE))) { + if (respData.has(NODE_WEBPAGE) && !TextUtils.isEmpty(respData.getString(NODE_WEBPAGE))) { userInfo.setWebpage(respData.getString(NODE_WEBPAGE)); } - if (respData.has(NODE_TWITTER) && TextUtils.isEmpty(respData.getString(NODE_TWITTER))) { + if (respData.has(NODE_TWITTER) && !TextUtils.isEmpty(respData.getString(NODE_TWITTER))) { userInfo.setTwitter(respData.getString(NODE_TWITTER)); } } From 3de86577c47c49e8a06a90d273bb72ae06859b4f Mon Sep 17 00:00:00 2001 From: Mario Danic Date: Wed, 25 Jan 2017 17:36:14 +0100 Subject: [PATCH 11/13] Fix the damn thing --- .../users/GetRemoteUserInfoOperation.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/com/owncloud/android/lib/resources/users/GetRemoteUserInfoOperation.java b/src/com/owncloud/android/lib/resources/users/GetRemoteUserInfoOperation.java index 15ed6959b..0b0128754 100644 --- a/src/com/owncloud/android/lib/resources/users/GetRemoteUserInfoOperation.java +++ b/src/com/owncloud/android/lib/resources/users/GetRemoteUserInfoOperation.java @@ -153,7 +153,8 @@ protected RemoteOperationResult run(OwnCloudClient client) { userInfo.setDisplayName(respData.getString(NODE_DISPLAY_NAME_ALT)); } - if (respData.getString(NODE_EMAIL) != null && !TextUtils.isEmpty(respData.getString(NODE_EMAIL))) { + if (respData.has(NODE_EMAIL) && !respData.isNull(NODE_EMAIL) && + !TextUtils.isEmpty(respData.getString(NODE_EMAIL))) { userInfo.setEmail(respData.getString(NODE_EMAIL)); } @@ -174,19 +175,23 @@ protected RemoteOperationResult run(OwnCloudClient client) { userInfo.setQuota(new Quota(quotaFree, quotaUsed, quotaTotal, quotaRelative, quotaValue)); if (versionWithSelfAPI) { - if (respData.has(NODE_PHONE) && !TextUtils.isEmpty(respData.getString(NODE_PHONE))) { + if (respData.has(NODE_PHONE) && !respData.isNull(NODE_PHONE) && + !TextUtils.isEmpty(respData.getString(NODE_PHONE))) { userInfo.setPhone(respData.getString(NODE_PHONE)); } - if (respData.has(NODE_ADDRESS) && !TextUtils.isEmpty(respData.getString(NODE_ADDRESS))) { + if (respData.has(NODE_ADDRESS) && !respData.isNull(NODE_ADDRESS) && + !TextUtils.isEmpty(respData.getString(NODE_ADDRESS))) { userInfo.setAddress(respData.getString(NODE_ADDRESS)); } - if (respData.has(NODE_WEBPAGE) && !TextUtils.isEmpty(respData.getString(NODE_WEBPAGE))) { + if (respData.has(NODE_WEBPAGE) && !respData.isNull(NODE_WEBPAGE) && + !TextUtils.isEmpty(respData.getString(NODE_WEBPAGE))) { userInfo.setWebpage(respData.getString(NODE_WEBPAGE)); } - if (respData.has(NODE_TWITTER) && !TextUtils.isEmpty(respData.getString(NODE_TWITTER))) { + if (respData.has(NODE_TWITTER) && !respData.isNull(NODE_TWITTER) && + !TextUtils.isEmpty(respData.getString(NODE_TWITTER))) { userInfo.setTwitter(respData.getString(NODE_TWITTER)); } } From dc45d84118bcd148f6418fd29f0b233bbb12da24 Mon Sep 17 00:00:00 2001 From: Mario Danic Date: Wed, 25 Jan 2017 20:25:13 +0100 Subject: [PATCH 12/13] Fix wrapping --- .../lib/resources/users/GetRemoteUserInfoOperation.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/com/owncloud/android/lib/resources/users/GetRemoteUserInfoOperation.java b/src/com/owncloud/android/lib/resources/users/GetRemoteUserInfoOperation.java index 0b0128754..dd586ce94 100644 --- a/src/com/owncloud/android/lib/resources/users/GetRemoteUserInfoOperation.java +++ b/src/com/owncloud/android/lib/resources/users/GetRemoteUserInfoOperation.java @@ -112,8 +112,7 @@ protected RemoteOperationResult run(OwnCloudClient client) { OwnCloudBasicCredentials credentials = (OwnCloudBasicCredentials) client.getCredentials(); OwnCloudVersion version = client.getOwnCloudVersion(); - boolean versionWithSelfAPI = - (version != null && version.isSelfSupported()); + boolean versionWithSelfAPI = version != null && version.isSelfSupported(); //Get the user try { From afb5b2c13b96fefd91e99021f06a8d95389fe531 Mon Sep 17 00:00:00 2001 From: Mario Danic Date: Mon, 30 Jan 2017 10:39:43 +0100 Subject: [PATCH 13/13] Update review stuff --- src/com/owncloud/android/lib/common/Quota.java | 2 +- src/com/owncloud/android/lib/common/UserInfo.java | 2 +- .../owncloud/android/lib/resources/status/OwnCloudVersion.java | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/com/owncloud/android/lib/common/Quota.java b/src/com/owncloud/android/lib/common/Quota.java index ab2768295..6703033be 100644 --- a/src/com/owncloud/android/lib/common/Quota.java +++ b/src/com/owncloud/android/lib/common/Quota.java @@ -22,7 +22,7 @@ import org.parceler.Parcel; /** - * Created by mdjanic on 24/01/2017. + * Quota data model */ @Parcel diff --git a/src/com/owncloud/android/lib/common/UserInfo.java b/src/com/owncloud/android/lib/common/UserInfo.java index 141954098..e77399314 100644 --- a/src/com/owncloud/android/lib/common/UserInfo.java +++ b/src/com/owncloud/android/lib/common/UserInfo.java @@ -22,7 +22,7 @@ import org.parceler.Parcel; /** - * Created by mdjanic on 24/01/2017. + * User information data model */ @Parcel diff --git a/src/com/owncloud/android/lib/resources/status/OwnCloudVersion.java b/src/com/owncloud/android/lib/resources/status/OwnCloudVersion.java index b600d9335..bd69ca7ca 100644 --- a/src/com/owncloud/android/lib/resources/status/OwnCloudVersion.java +++ b/src/com/owncloud/android/lib/resources/status/OwnCloudVersion.java @@ -49,8 +49,6 @@ public class OwnCloudVersion implements Comparable { public static final int VERSION_8 = 0x08000000; // 8.0 - public static final int VERSION_12 = 0x12000000; //12 - public static final int MINIMUM_VERSION_CAPABILITIES_API = 0x08010000; // 8.1 public static final int MINIMUM_SELF_API = 0x11000200;