Skip to content

Commit

Permalink
Clean up unused code in WebdavRepo
Browse files Browse the repository at this point in the history
  • Loading branch information
amberin committed Jul 27, 2024
1 parent 6e420e7 commit a13648f
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions app/src/main/java/com/orgzly/android/repos/WebdavRepo.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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("/")) {
Expand Down Expand Up @@ -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")
}
Expand Down

0 comments on commit a13648f

Please sign in to comment.