From a13648f8482ff9b411e4db42ef1bba176560251f Mon Sep 17 00:00:00 2001 From: Victor Andreasson Date: Sat, 27 Jul 2024 22:43:28 +0200 Subject: [PATCH] Clean up unused code in WebdavRepo --- app/src/main/java/com/orgzly/android/repos/WebdavRepo.kt | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/app/src/main/java/com/orgzly/android/repos/WebdavRepo.kt b/app/src/main/java/com/orgzly/android/repos/WebdavRepo.kt index b7cac4636..633cc47f4 100644 --- a/app/src/main/java/com/orgzly/android/repos/WebdavRepo.kt +++ b/app/src/main/java/com/orgzly/android/repos/WebdavRepo.kt @@ -169,7 +169,6 @@ class WebdavRepo( .list(url, -1) .mapNotNull { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { - val relativePath = it.getRelativePath() if (!BookName.isSupportedFormatFileName(it.name) || ignores.isPathIgnored(it.getRelativePath(), it.isDirectory)) { null } else { @@ -217,7 +216,7 @@ class WebdavRepo( } } - override fun storeBook(file: File?, fileName: String?): VersionedRook { + override fun storeBook(file: File, fileName: String): VersionedRook { val encodedFileName = Uri.encode(fileName, "/") if (encodedFileName != null) { if (encodedFileName.contains("/")) { @@ -275,10 +274,6 @@ class WebdavRepo( return fullUrlString.replace(Regex("^$uri/"), "") } - private fun extractRelativePathFromFullUrl(fullUrl: Uri): String { - return fullUrl.toString().replace(Regex("^$uri/"), "") - } - private fun Uri.toUrl(): String { return this.toString().replace("^(?:web)?dav(s?://)".toRegex(), "http$1") }