1
0
mirror of https://github.com/owncloud/android-library.git synced 2025-07-09 15:38:41 +00:00

Compare commits

..

No commits in common. "c2f7426a3e7f92abf570442b685958fd7fe7ee88" and "376d52ac5bb8bb8c31a2502493771aa691ecf4d2" have entirely different histories.

4 changed files with 2 additions and 21 deletions

View File

@ -184,7 +184,6 @@ public class HttpConstants {
public static final int HTTP_LOCKED = 423;
// 424 Failed Dependency (WebDAV - RFC 2518)
public static final int HTTP_FAILED_DEPENDENCY = 424;
public static final int HTTP_TOO_EARLY = 425;
/**
* 5xx Client Error

View File

@ -237,10 +237,6 @@ public class RemoteOperationResult<T>
httpMethod.getResponseBodyAsString(),
ResultCode.SPECIFIC_METHOD_NOT_ALLOWED
);
break;
case HttpConstants.HTTP_TOO_EARLY:
mCode = ResultCode.TOO_EARLY;
break;
default:
break;
}
@ -587,7 +583,6 @@ public class RemoteOperationResult<T>
SPECIFIC_SERVICE_UNAVAILABLE,
SPECIFIC_UNSUPPORTED_MEDIA_TYPE,
SPECIFIC_METHOD_NOT_ALLOWED,
SPECIFIC_BAD_REQUEST,
TOO_EARLY,
SPECIFIC_BAD_REQUEST
}
}

View File

@ -120,7 +120,7 @@ public class RemoteFile implements Parcelable, Serializable {
public RemoteFile(final Response davResource, String userId) {
this(RemoteFileUtil.Companion.getRemotePathFromUrl(davResource.getHref(), userId));
final List<Property> properties = RemoteFileUtil.Companion.getProperties(davResource);
final List<Property> properties = davResource.getProperties();
for (Property property : properties) {
if (property instanceof CreationDate) {

View File

@ -24,11 +24,7 @@
package com.owncloud.android.lib.resources.files
import android.net.Uri
import at.bitfire.dav4jvm.PropStat
import at.bitfire.dav4jvm.Property
import at.bitfire.dav4jvm.Response
import com.owncloud.android.lib.common.OwnCloudClient
import com.owncloud.android.lib.common.http.HttpConstants
import okhttp3.HttpUrl
class RemoteFileUtil {
@ -49,14 +45,5 @@ class RemoteFileUtil {
val pathToOc = absoluteDavPath.split(davFilesPath)[0]
return absoluteDavPath.replace(pathToOc + davFilesPath, "")
}
fun getProperties(response: Response): List<Property> {
return if (response.isSuccess())
response.propstat.filter { propStat -> propStat.isSuccessOrPostProcessing() }.map { it.properties }.flatten()
else
emptyList()
}
private fun PropStat.isSuccessOrPostProcessing() = (status.code / 100 == 2 || status.code == HttpConstants.HTTP_TOO_EARLY)
}
}