1
0
mirror of https://github.com/owncloud/android-library.git synced 2025-06-07 16:06:08 +00:00

Fix problem when showing size

This commit is contained in:
davigonz 2018-06-06 19:02:44 +02:00
parent 944a1186d9
commit 3b7950ae59

View File

@ -24,21 +24,20 @@
package com.owncloud.android.lib.resources.files; package com.owncloud.android.lib.resources.files;
import java.io.Serializable;
import java.math.BigDecimal;
import android.net.Uri; import android.net.Uri;
import android.os.Parcel; import android.os.Parcel;
import android.os.Parcelable; import android.os.Parcelable;
import com.owncloud.android.lib.common.OwnCloudClient;
import com.owncloud.android.lib.common.network.WebdavEntry; import com.owncloud.android.lib.common.network.WebdavEntry;
import com.owncloud.android.lib.refactor.OCContext;
import com.owncloud.android.lib.refactor.operations.RemoteOperation; import com.owncloud.android.lib.refactor.operations.RemoteOperation;
import java.io.Serializable;
import java.math.BigDecimal;
import at.bitfire.dav4android.DavResource; import at.bitfire.dav4android.DavResource;
import at.bitfire.dav4android.PropertyCollection; import at.bitfire.dav4android.PropertyCollection;
import at.bitfire.dav4android.property.CreationDate; import at.bitfire.dav4android.property.CreationDate;
import at.bitfire.dav4android.property.GetContentLength;
import at.bitfire.dav4android.property.GetContentType; import at.bitfire.dav4android.property.GetContentType;
import at.bitfire.dav4android.property.GetETag; import at.bitfire.dav4android.property.GetETag;
import at.bitfire.dav4android.property.GetLastModified; import at.bitfire.dav4android.property.GetLastModified;
@ -208,6 +207,9 @@ public class RemoteFile implements Parcelable, Serializable {
this.setCreationTimestamp(properties.get(CreationDate.class) != null this.setCreationTimestamp(properties.get(CreationDate.class) != null
? Long.parseLong(properties.get(CreationDate.class).getCreationDate()) ? Long.parseLong(properties.get(CreationDate.class).getCreationDate())
: 0); : 0);
this.setLength(properties.get(GetContentLength.class) != null
? properties.get(GetContentLength.class).getContentLength()
: 0);
this.setMimeType(properties.get(GetContentType.class) != null this.setMimeType(properties.get(GetContentType.class) != null
? properties.get(GetContentType.class).getType() ? properties.get(GetContentType.class).getType()
: "DIR"); : "DIR");