Skip to content

Commit

Permalink
Merge pull request #31 from nextcloud/change-userinfo-calls
Browse files Browse the repository at this point in the history
Change userinfo calls
  • Loading branch information
mario authored Jan 31, 2017
2 parents b2f7b7d + afb5b2c commit dbd3421
Show file tree
Hide file tree
Showing 8 changed files with 346 additions and 208 deletions.
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
87 changes: 87 additions & 0 deletions src/com/owncloud/android/lib/common/Quota.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
/**
* 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 <http://www.gnu.org/licenses/>.
*/
package com.owncloud.android.lib.common;

import org.parceler.Parcel;

/**
* Quota data model
*/

@Parcel
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;
}
}
127 changes: 127 additions & 0 deletions src/com/owncloud/android/lib/common/UserInfo.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
/**
* 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 <http://www.gnu.org/licenses/>.
*/
package com.owncloud.android.lib.common;

import org.parceler.Parcel;

/**
* User information data model
*/

@Parcel
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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ public class OwnCloudVersion implements Comparable<OwnCloudVersion> {
public static final int VERSION_8 = 0x08000000; // 8.0

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;

Expand Down Expand Up @@ -156,4 +158,9 @@ public boolean isSearchUsersSupported() {
public boolean isVersionWithCapabilitiesAPI(){
return (mVersion>= MINIMUM_VERSION_CAPABILITIES_API);
}

public boolean isSelfSupported() {
return (mVersion >= MINIMUM_SELF_API);
}

}
Loading

0 comments on commit dbd3421

Please sign in to comment.