diff --git a/app/src/main/java/me/zhanghai/android/files/provider/ftp/client/Protocol.kt b/app/src/main/java/me/zhanghai/android/files/provider/ftp/client/Protocol.kt index b4026b380..48942a0a2 100644 --- a/app/src/main/java/me/zhanghai/android/files/provider/ftp/client/Protocol.kt +++ b/app/src/main/java/me/zhanghai/android/files/provider/ftp/client/Protocol.kt @@ -14,9 +14,9 @@ enum class Protocol(val scheme: String, val defaultPort: Int, val createClient: FTPES("ftpes", FTPClient.DEFAULT_PORT, { FTPSClient(false) }); companion object { - val SCHEMES = values().map { it.scheme } + val SCHEMES = entries.map { it.scheme } fun fromScheme(scheme: String): Protocol = - values().firstOrNull() { it.scheme == scheme } ?: throw IllegalArgumentException(scheme) + entries.firstOrNull { it.scheme == scheme } ?: throw IllegalArgumentException(scheme) } }