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:
parent
daf49d289b
commit
1087f0fd46
@ -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()
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user