Loading library/src/main/java/com/owncloud/android/lib/common/network/WebdavEntry.kt +18 −15 Original line number Diff line number Diff line Loading @@ -393,23 +393,20 @@ class WebdavEntry constructor( } prop = propSet[EXTENDED_PROPERTY_SYSTEM_TAGS, ncNamespace] if (prop != null && prop.value != null) { if (prop.value is ArrayList<*>) { val list = prop.value as ArrayList<*> val tempList: MutableList<String> = ArrayList(list.size) for (i in list.indices) { val element = list[i] as Element tempList.add(element.firstChild.textContent) } tags = tempList.toTypedArray() } else { // single item or empty val element = prop.value as Element val value = element.firstChild.textContent if (prop?.value != null) { tags = when (prop.value) { is ArrayList<*> -> (prop.value as ArrayList<*>) .filterIsInstance<Element>() .map { parseTag(it) } .toTypedArray() if (value != null) { tags = arrayOf(value) is Element -> { val element = (prop.value as Element) val tag = parseTag(element) arrayOf(tag) } else -> emptyArray() } } Loading Loading @@ -485,6 +482,12 @@ class WebdavEntry constructor( } } private fun parseTag(element: Element): Tag { val name = element.firstChild.textContent val color = element.getAttribute("nc:color") return Tag(name, color) } private fun parseLockProperties( ncNamespace: Namespace, propSet: DavPropertySet Loading library/src/main/java/com/owncloud/android/lib/resources/files/model/RemoteFile.kt +2 −1 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ package com.owncloud.android.lib.resources.files.model import android.os.Parcel import android.os.Parcelable import com.owncloud.android.lib.common.network.Tag import com.nextcloud.android.lib.resources.files.FileDownloadLimit import com.owncloud.android.lib.common.network.WebdavEntry import com.owncloud.android.lib.common.network.WebdavEntry.MountType Loading Loading @@ -53,7 +54,7 @@ class RemoteFile : var lockOwnerEditor: String? = null var lockTimeout: Long = 0 var lockToken: String? = null var tags: Array<String?>? = null var tags: Array<Tag?>? = null var imageDimension: ImageDimension? = null var geoLocation: GeoLocation? = null var hidden = false Loading Loading
library/src/main/java/com/owncloud/android/lib/common/network/WebdavEntry.kt +18 −15 Original line number Diff line number Diff line Loading @@ -393,23 +393,20 @@ class WebdavEntry constructor( } prop = propSet[EXTENDED_PROPERTY_SYSTEM_TAGS, ncNamespace] if (prop != null && prop.value != null) { if (prop.value is ArrayList<*>) { val list = prop.value as ArrayList<*> val tempList: MutableList<String> = ArrayList(list.size) for (i in list.indices) { val element = list[i] as Element tempList.add(element.firstChild.textContent) } tags = tempList.toTypedArray() } else { // single item or empty val element = prop.value as Element val value = element.firstChild.textContent if (prop?.value != null) { tags = when (prop.value) { is ArrayList<*> -> (prop.value as ArrayList<*>) .filterIsInstance<Element>() .map { parseTag(it) } .toTypedArray() if (value != null) { tags = arrayOf(value) is Element -> { val element = (prop.value as Element) val tag = parseTag(element) arrayOf(tag) } else -> emptyArray() } } Loading Loading @@ -485,6 +482,12 @@ class WebdavEntry constructor( } } private fun parseTag(element: Element): Tag { val name = element.firstChild.textContent val color = element.getAttribute("nc:color") return Tag(name, color) } private fun parseLockProperties( ncNamespace: Namespace, propSet: DavPropertySet Loading
library/src/main/java/com/owncloud/android/lib/resources/files/model/RemoteFile.kt +2 −1 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ package com.owncloud.android.lib.resources.files.model import android.os.Parcel import android.os.Parcelable import com.owncloud.android.lib.common.network.Tag import com.nextcloud.android.lib.resources.files.FileDownloadLimit import com.owncloud.android.lib.common.network.WebdavEntry import com.owncloud.android.lib.common.network.WebdavEntry.MountType Loading Loading @@ -53,7 +54,7 @@ class RemoteFile : var lockOwnerEditor: String? = null var lockTimeout: Long = 0 var lockToken: String? = null var tags: Array<String?>? = null var tags: Array<Tag?>? = null var imageDimension: ImageDimension? = null var geoLocation: GeoLocation? = null var hidden = false Loading