|
|
@ -19,6 +19,7 @@ import java.util.* |
|
|
|
import kotlin.math.min |
|
|
|
import kotlin.math.min |
|
|
|
|
|
|
|
|
|
|
|
object WebDavHelp { |
|
|
|
object WebDavHelp { |
|
|
|
|
|
|
|
private const val defaultWebDavUrl = "https://dav.jianguoyun.com/dav/" |
|
|
|
private val zipFilePath = FileUtils.getCachePath() + "/backup" + ".zip" |
|
|
|
private val zipFilePath = FileUtils.getCachePath() + "/backup" + ".zip" |
|
|
|
private val unzipFilesPath by lazy { |
|
|
|
private val unzipFilesPath by lazy { |
|
|
|
FileUtils.getCachePath() |
|
|
|
FileUtils.getCachePath() |
|
|
@ -26,7 +27,9 @@ object WebDavHelp { |
|
|
|
|
|
|
|
|
|
|
|
private fun getWebDavUrl(): String? { |
|
|
|
private fun getWebDavUrl(): String? { |
|
|
|
var url = App.INSTANCE.getPrefString(PreferKey.webDavUrl) |
|
|
|
var url = App.INSTANCE.getPrefString(PreferKey.webDavUrl) |
|
|
|
if (url.isNullOrBlank()) return null |
|
|
|
if (url.isNullOrEmpty()) { |
|
|
|
|
|
|
|
url = defaultWebDavUrl |
|
|
|
|
|
|
|
} |
|
|
|
if (!url.endsWith("/")) url += "/" |
|
|
|
if (!url.endsWith("/")) url += "/" |
|
|
|
return url |
|
|
|
return url |
|
|
|
} |
|
|
|
} |
|
|
|