diff --git a/app/src/main/java/io/legado/app/lib/webdav/WebDav.kt b/app/src/main/java/io/legado/app/lib/webdav/WebDav.kt index d7419aebf..225850113 100644 --- a/app/src/main/java/io/legado/app/lib/webdav/WebDav.kt +++ b/app/src/main/java/io/legado/app/lib/webdav/WebDav.kt @@ -21,7 +21,7 @@ import java.util.* class WebDav @Throws(MalformedURLException::class) constructor(url: String) { - private val url: URL = URL(null, url, Handler.HANDLER) + private val url: URL = URL(null, url, Handler) private var httpUrl: String? = null var displayName: String? = null diff --git a/app/src/main/java/io/legado/app/lib/webdav/http/Handler.kt b/app/src/main/java/io/legado/app/lib/webdav/http/Handler.kt index 2bafb9780..c3deec2e2 100644 --- a/app/src/main/java/io/legado/app/lib/webdav/http/Handler.kt +++ b/app/src/main/java/io/legado/app/lib/webdav/http/Handler.kt @@ -4,7 +4,7 @@ import java.net.URL import java.net.URLConnection import java.net.URLStreamHandler -class Handler : URLStreamHandler() { +object Handler : URLStreamHandler() { override fun getDefaultPort(): Int { return 80 @@ -13,13 +13,4 @@ class Handler : URLStreamHandler() { public override fun openConnection(u: URL): URLConnection? { return null } - - override fun parseURL(url: URL, spec: String, start: Int, end: Int) { - super.parseURL(url, spec, start, end) - } - - companion object { - - val HANDLER: URLStreamHandler = Handler() - } }