mirror of
https://github.com/owncloud/android-library.git
synced 2025-06-07 16:06:08 +00:00
Changes from comments in PR#63
This commit is contained in:
parent
0e7319e4ed
commit
0449645fca
@ -53,7 +53,7 @@ public class WebdavEntry {
|
|||||||
|
|
||||||
private String mName, mPath, mUri, mContentType, mEtag, mPermissions, mRemoteId;
|
private String mName, mPath, mUri, mContentType, mEtag, mPermissions, mRemoteId;
|
||||||
private long mContentLength, mCreateTimestamp, mModifiedTimestamp, mSize;
|
private long mContentLength, mCreateTimestamp, mModifiedTimestamp, mSize;
|
||||||
private long mQuotaUsedBytes, mQuotaAvailableBytes;
|
private BigDecimal mQuotaUsedBytes, mQuotaAvailableBytes;
|
||||||
|
|
||||||
public WebdavEntry(MultiStatusResponse ms, String splitElement) {
|
public WebdavEntry(MultiStatusResponse ms, String splitElement) {
|
||||||
resetData();
|
resetData();
|
||||||
@ -137,10 +137,9 @@ public class WebdavEntry {
|
|||||||
if (prop != null) {
|
if (prop != null) {
|
||||||
String quotaUsedBytesSt = (String) prop.getValue();
|
String quotaUsedBytesSt = (String) prop.getValue();
|
||||||
try {
|
try {
|
||||||
mQuotaUsedBytes = Long.parseLong(quotaUsedBytesSt);
|
mQuotaUsedBytes = new BigDecimal(quotaUsedBytesSt);
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
BigDecimal bd = new BigDecimal(quotaUsedBytesSt);
|
Log_OC.w(TAG, "No value for QuotaUsedBytes");
|
||||||
mQuotaUsedBytes = bd.longValue();
|
|
||||||
}
|
}
|
||||||
Log_OC.d(TAG , "QUOTA_USED_BYTES " + quotaUsedBytesSt );
|
Log_OC.d(TAG , "QUOTA_USED_BYTES " + quotaUsedBytesSt );
|
||||||
}
|
}
|
||||||
@ -150,10 +149,9 @@ public class WebdavEntry {
|
|||||||
if (prop != null) {
|
if (prop != null) {
|
||||||
String quotaAvailableBytesSt = (String) prop.getValue();
|
String quotaAvailableBytesSt = (String) prop.getValue();
|
||||||
try {
|
try {
|
||||||
mQuotaAvailableBytes = Long.parseLong(quotaAvailableBytesSt);
|
mQuotaAvailableBytes = new BigDecimal(quotaAvailableBytesSt);
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
BigDecimal bd = new BigDecimal(quotaAvailableBytesSt);
|
Log_OC.w(TAG, "No value for QuotaAvailableBytes");
|
||||||
mQuotaAvailableBytes = bd.longValue();
|
|
||||||
}
|
}
|
||||||
Log_OC.d(TAG , "QUOTA_AVAILABLE_BYTES " + quotaAvailableBytesSt );
|
Log_OC.d(TAG , "QUOTA_AVAILABLE_BYTES " + quotaAvailableBytesSt );
|
||||||
}
|
}
|
||||||
@ -241,11 +239,11 @@ public class WebdavEntry {
|
|||||||
return mSize;
|
return mSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long quotaUsedBytes() {
|
public BigDecimal quotaUsedBytes() {
|
||||||
return mQuotaUsedBytes;
|
return mQuotaUsedBytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long quotaAvailableBytes() {
|
public BigDecimal quotaAvailableBytes() {
|
||||||
return mQuotaAvailableBytes;
|
return mQuotaAvailableBytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -253,7 +251,7 @@ public class WebdavEntry {
|
|||||||
mName = mUri = mContentType = mPermissions = null; mRemoteId = null;
|
mName = mUri = mContentType = mPermissions = null; mRemoteId = null;
|
||||||
mContentLength = mCreateTimestamp = mModifiedTimestamp = 0;
|
mContentLength = mCreateTimestamp = mModifiedTimestamp = 0;
|
||||||
mSize = 0;
|
mSize = 0;
|
||||||
mQuotaUsedBytes = 0;
|
mQuotaUsedBytes = null;
|
||||||
mQuotaAvailableBytes = 0;
|
mQuotaAvailableBytes = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
package com.owncloud.android.lib.resources.files;
|
package com.owncloud.android.lib.resources.files;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
@ -51,8 +52,8 @@ public class RemoteFile implements Parcelable, Serializable {
|
|||||||
private String mPermissions;
|
private String mPermissions;
|
||||||
private String mRemoteId;
|
private String mRemoteId;
|
||||||
private long mSize;
|
private long mSize;
|
||||||
private long mQuotaUsedBytes;
|
private BigDecimal mQuotaUsedBytes;
|
||||||
private long mQuotaAvailableBytes;
|
private BigDecimal mQuotaAvailableBytes;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Getters and Setters
|
* Getters and Setters
|
||||||
@ -130,11 +131,11 @@ public class RemoteFile implements Parcelable, Serializable {
|
|||||||
mSize = size;
|
mSize = size;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setQuotaUsedBytes (long quotaUsedBytes) {
|
public void setQuotaUsedBytes (BigDecimal quotaUsedBytes) {
|
||||||
mQuotaUsedBytes = quotaUsedBytes;
|
mQuotaUsedBytes = quotaUsedBytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setQuotaAvailableBytes (long quotaAvailableBytes) {
|
public void setQuotaAvailableBytes (BigDecimal quotaAvailableBytes) {
|
||||||
mQuotaAvailableBytes = quotaAvailableBytes;
|
mQuotaAvailableBytes = quotaAvailableBytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -184,8 +185,8 @@ public class RemoteFile implements Parcelable, Serializable {
|
|||||||
mPermissions = null;
|
mPermissions = null;
|
||||||
mRemoteId = null;
|
mRemoteId = null;
|
||||||
mSize = 0;
|
mSize = 0;
|
||||||
mQuotaUsedBytes = 0;
|
mQuotaUsedBytes = null;
|
||||||
mQuotaAvailableBytes = 0;
|
mQuotaAvailableBytes = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -223,8 +224,8 @@ public class RemoteFile implements Parcelable, Serializable {
|
|||||||
mPermissions= source.readString();
|
mPermissions= source.readString();
|
||||||
mRemoteId = source.readString();
|
mRemoteId = source.readString();
|
||||||
mSize = source.readLong();
|
mSize = source.readLong();
|
||||||
mQuotaUsedBytes = source.readLong();
|
mQuotaUsedBytes = (BigDecimal) source.readSerializable();
|
||||||
mQuotaAvailableBytes = source.readLong();
|
mQuotaAvailableBytes = (BigDecimal) source.readSerializable();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -243,8 +244,8 @@ public class RemoteFile implements Parcelable, Serializable {
|
|||||||
dest.writeString(mPermissions);
|
dest.writeString(mPermissions);
|
||||||
dest.writeString(mRemoteId);
|
dest.writeString(mRemoteId);
|
||||||
dest.writeLong(mSize);
|
dest.writeLong(mSize);
|
||||||
dest.writeLong(mQuotaUsedBytes);
|
dest.writeSerializable(mQuotaUsedBytes);
|
||||||
dest.writeLong(mQuotaAvailableBytes);
|
dest.writeSerializable(mQuotaAvailableBytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user