diff --git a/app/build.gradle b/app/build.gradle index 92983badb..197ed8db8 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -104,7 +104,7 @@ repositories { } } dependencies { - implementation 'com.github.zhanghai:dav4jvm:59aa867' + implementation 'com.github.zhanghai:dav4jvm:3f4822d' implementation 'com.github.chrisbanes:PhotoView:2.3.0' implementation 'com.github.topjohnwu.libsu:service:5.2.2' } diff --git a/app/src/main/java/me/zhanghai/android/files/provider/webdav/client/Client.kt b/app/src/main/java/me/zhanghai/android/files/provider/webdav/client/Client.kt index 2b4493b11..a37f48997 100644 --- a/app/src/main/java/me/zhanghai/android/files/provider/webdav/client/Client.kt +++ b/app/src/main/java/me/zhanghai/android/files/provider/webdav/client/Client.kt @@ -24,7 +24,6 @@ import at.bitfire.dav4jvm.property.webdav.GetLastModified import at.bitfire.dav4jvm.property.webdav.ResourceType import java8.nio.channels.SeekableByteChannel import me.zhanghai.android.files.app.okHttpClient -import me.zhanghai.android.files.compat.toDateCompat import me.zhanghai.android.files.provider.common.LocalWatchService import me.zhanghai.android.files.provider.common.NotifyEntryModifiedOutputStream import me.zhanghai.android.files.provider.common.NotifyEntryModifiedSeekableByteChannel @@ -220,9 +219,7 @@ object Client { // https://github.com/sabre-io/dav/issues/1277 try { DavResource(getClient(path.authority), path.url).proppatch( - mapOf( - GetLastModified.NAME to HttpUtils.formatDate(lastModifiedTime.toDateCompat()) - ), emptyList() + mapOf(GetLastModified.NAME to HttpUtils.formatDate(lastModifiedTime)), emptyList() ) { response, _ -> response.checkSuccess() } } catch (e: IOException) { throw e.toDavException() diff --git a/app/src/main/java/me/zhanghai/android/files/provider/webdav/client/ResponseExtensions.kt b/app/src/main/java/me/zhanghai/android/files/provider/webdav/client/ResponseExtensions.kt index c0f416c0e..37ea98a3c 100644 --- a/app/src/main/java/me/zhanghai/android/files/provider/webdav/client/ResponseExtensions.kt +++ b/app/src/main/java/me/zhanghai/android/files/provider/webdav/client/ResponseExtensions.kt @@ -11,13 +11,11 @@ import at.bitfire.dav4jvm.property.webdav.CreationDate import at.bitfire.dav4jvm.property.webdav.GetContentLength import at.bitfire.dav4jvm.property.webdav.GetLastModified import at.bitfire.dav4jvm.property.webdav.ResourceType -import me.zhanghai.android.files.compat.toInstantCompat import org.threeten.bp.Instant val Response.creationTime: Instant? get() = - this[CreationDate::class.java]?.creationDate?.let { HttpUtils.parseDate(it) } - ?.toInstantCompat() + this[CreationDate::class.java]?.creationDate?.let { HttpUtils.parseDate(it) }?.toInstant() val Response.isDirectory: Boolean get() = this[ResourceType::class.java]?.types?.contains(ResourceType.COLLECTION) == true @@ -27,7 +25,7 @@ val Response.isSymbolicLink: Boolean val Response.lastModifiedTime: Instant? get() = - this[GetLastModified::class.java]?.lastModified?.let { Instant.ofEpochMilli(it) } + this[GetLastModified::class.java]?.lastModified?.toInstant() val Response.size: Long get() = this[GetContentLength::class.java]?.contentLength ?: 0