Skip to content
This repository was archived by the owner on Mar 19, 2024. It is now read-only.

Commit c53475d

Browse files
committed
Removing quotas from webdav properties in regular propfinds
1 parent c2f32b2 commit c53475d

File tree

6 files changed

+31
-19
lines changed

6 files changed

+31
-19
lines changed

owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/methods/webdav/DavUtils.kt

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,36 @@
2424
package com.owncloud.android.lib.common.http.methods.webdav
2525

2626
import at.bitfire.dav4jvm.Property
27-
import at.bitfire.dav4jvm.PropertyUtils.getAllPropSet
2827
import at.bitfire.dav4jvm.PropertyUtils.getQuotaPropset
28+
import at.bitfire.dav4jvm.property.CreationDate
29+
import at.bitfire.dav4jvm.property.DisplayName
30+
import at.bitfire.dav4jvm.property.GetContentLength
31+
import at.bitfire.dav4jvm.property.GetContentType
32+
import at.bitfire.dav4jvm.property.GetETag
33+
import at.bitfire.dav4jvm.property.GetLastModified
34+
import at.bitfire.dav4jvm.property.OCId
35+
import at.bitfire.dav4jvm.property.OCPermissions
36+
import at.bitfire.dav4jvm.property.OCPrivatelink
37+
import at.bitfire.dav4jvm.property.OCSize
38+
import at.bitfire.dav4jvm.property.ResourceType
2939
import com.owncloud.android.lib.common.http.methods.webdav.properties.OCShareTypes
3040

3141
object DavUtils {
32-
@JvmStatic val allPropset: Array<Property.Name>
33-
get() = getAllPropSet().plus(OCShareTypes.NAME)
42+
@JvmStatic val allPropSet: Array<Property.Name>
43+
get() = arrayOf(
44+
DisplayName.NAME,
45+
GetContentType.NAME,
46+
ResourceType.NAME,
47+
GetContentLength.NAME,
48+
GetLastModified.NAME,
49+
CreationDate.NAME,
50+
GetETag.NAME,
51+
OCPermissions.NAME,
52+
OCId.NAME,
53+
OCSize.NAME,
54+
OCPrivatelink.NAME,
55+
OCShareTypes.NAME,
56+
)
3457

3558
val quotaPropSet: Array<Property.Name>
3659
get() = getQuotaPropset()

owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/files/CheckPathExistenceRemoteOperation.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ package com.owncloud.android.lib.resources.files
2525

2626
import com.owncloud.android.lib.common.OwnCloudClient
2727
import com.owncloud.android.lib.common.http.HttpConstants
28-
import com.owncloud.android.lib.common.http.methods.webdav.DavUtils.allPropset
28+
import com.owncloud.android.lib.common.http.methods.webdav.DavUtils.allPropSet
2929
import com.owncloud.android.lib.common.http.methods.webdav.PropfindMethod
3030
import com.owncloud.android.lib.common.network.WebdavUtils
3131
import com.owncloud.android.lib.common.operations.RemoteOperation
@@ -59,7 +59,7 @@ class CheckPathExistenceRemoteOperation(
5959
val stringUrl = baseStringUrl + WebdavUtils.encodePath(remotePath)
6060

6161
return try {
62-
val propFindMethod = PropfindMethod(URL(stringUrl), 0, allPropset).apply {
62+
val propFindMethod = PropfindMethod(URL(stringUrl), 0, allPropSet).apply {
6363
setReadTimeout(TIMEOUT.toLong(), TimeUnit.SECONDS)
6464
setConnectionTimeout(TIMEOUT.toLong(), TimeUnit.SECONDS)
6565
}

owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/files/GetBaseUrlRemoteOperation.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class GetBaseUrlRemoteOperation : RemoteOperation<String?>() {
4444
return try {
4545
val stringUrl = client.baseFilesWebDavUri.toString()
4646

47-
val propFindMethod = PropfindMethod(URL(stringUrl), 0, DavUtils.allPropset).apply {
47+
val propFindMethod = PropfindMethod(URL(stringUrl), 0, DavUtils.allPropSet).apply {
4848
setReadTimeout(TIMEOUT, TimeUnit.SECONDS)
4949
setConnectionTimeout(TIMEOUT, TimeUnit.SECONDS)
5050
}

owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/files/ReadRemoteFileOperation.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class ReadRemoteFileOperation(
6262
val propFind = PropfindMethod(
6363
url = getFinalWebDavUrl(),
6464
depth = DEPTH_0,
65-
propertiesToRequest = DavUtils.allPropset
65+
propertiesToRequest = DavUtils.allPropSet
6666
).apply {
6767
setReadTimeout(SYNC_READ_TIMEOUT, TimeUnit.SECONDS)
6868
setConnectionTimeout(SYNC_CONNECTION_TIMEOUT, TimeUnit.SECONDS)

owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/files/ReadRemoteFolderOperation.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class ReadRemoteFolderOperation(
6464
val propfindMethod = PropfindMethod(
6565
getFinalWebDavUrl(),
6666
DavConstants.DEPTH_1,
67-
DavUtils.allPropset
67+
DavUtils.allPropSet
6868
)
6969

7070
val status = client.executeHttpMethod(propfindMethod)

owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/files/RemoteFile.kt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ import at.bitfire.dav4jvm.property.OCId
3939
import at.bitfire.dav4jvm.property.OCPermissions
4040
import at.bitfire.dav4jvm.property.OCPrivatelink
4141
import at.bitfire.dav4jvm.property.OCSize
42-
import at.bitfire.dav4jvm.property.QuotaAvailableBytes
43-
import at.bitfire.dav4jvm.property.QuotaUsedBytes
4442
import com.owncloud.android.lib.common.OwnCloudClient
4543
import com.owncloud.android.lib.common.http.HttpConstants
4644
import com.owncloud.android.lib.common.http.methods.webdav.properties.OCShareTypes
@@ -51,7 +49,6 @@ import kotlinx.parcelize.Parcelize
5149
import okhttp3.HttpUrl
5250
import timber.log.Timber
5351
import java.io.File
54-
import java.math.BigDecimal
5552

5653
/**
5754
* Contains the data of a Remote File from a WebDavEntry
@@ -73,8 +70,6 @@ data class RemoteFile(
7370
var permissions: String? = null,
7471
var remoteId: String? = null,
7572
var size: Long = 0,
76-
var quotaUsedBytes: BigDecimal? = null,
77-
var quotaAvailableBytes: BigDecimal? = null,
7873
var privateLink: String? = null,
7974
var owner: String,
8075
var sharedByLink: Boolean = false,
@@ -137,12 +132,6 @@ data class RemoteFile(
137132
is OCSize -> {
138133
remoteFile.size = property.size
139134
}
140-
is QuotaUsedBytes -> {
141-
remoteFile.quotaUsedBytes = BigDecimal.valueOf(property.quotaUsedBytes)
142-
}
143-
is QuotaAvailableBytes -> {
144-
remoteFile.quotaAvailableBytes = BigDecimal.valueOf(property.quotaAvailableBytes)
145-
}
146135
is OCPrivatelink -> {
147136
remoteFile.privateLink = property.link
148137
}

0 commit comments

Comments
 (0)