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

Apply requested changes

This commit is contained in:
davigonz 2019-05-09 12:53:55 +02:00
parent daf49d289b
commit 1087f0fd46
3 changed files with 4 additions and 12 deletions

View File

@ -55,8 +55,7 @@ class RemoteShare : Parcelable, Serializable {
var isFolder: Boolean = false
var userId: Long = 0
val isPasswordProtected: Boolean
get() = ShareType.PUBLIC_LINK == shareType && shareWith.isNotEmpty()
val isValid: Boolean = id > -1
constructor() : super() {
resetData()

View File

@ -117,7 +117,6 @@ class ShareXMLParser {
} else {
skip(parser)
}
}
return shares
}
@ -150,7 +149,6 @@ class ShareXMLParser {
} else {
skip(parser)
}
}
}
@ -194,7 +192,6 @@ class ShareXMLParser {
} else {
skip(parser)
}
}
@ -269,7 +266,7 @@ class ShareXMLParser {
} else if (name.equals(NODE_EXPIRATION, ignoreCase = true)) {
val value = readNode(parser, NODE_EXPIRATION)
if (value.length != 0) {
if (value.isNotEmpty()) {
remoteShare.expirationDate = WebdavUtils.parseResponseDate(value)!!.time
}
@ -296,15 +293,11 @@ class ShareXMLParser {
}
}
if (isValidShare(remoteShare)) {
if (remoteShare.isValid) {
shares.add(remoteShare)
}
}
private fun isValidShare(share: RemoteShare): Boolean {
return share.id > -1
}
private fun fixPathForFolder(share: RemoteShare) {
if (share.isFolder && share.path.isNotEmpty() &&
!share.path.endsWith(FileUtils.PATH_SEPARATOR)

View File

@ -172,7 +172,7 @@ class UpdateRemoteShareOperation
if (result.isSuccess && retrieveShareDetails) {
// retrieve more info - PUT only returns the index of the new share
val emptyShare = result.data.shares[0]
val emptyShare = result.data.shares.first()
val getInfo = GetRemoteShareOperation(
emptyShare.id
)