clean up code
This commit is contained in:
3 files changed
+2
-6
No files matched your search
+1
-2
@@ -7,7 +7,6 @@ import com.github.kr328.clash.service.R
|
||||
import com.github.kr328.clash.service.util.resolveBase
|
||||
import com.github.kr328.clash.service.util.resolveProfile
|
||||
import java.io.FileNotFoundException
|
||||
import java.lang.UnsupportedOperationException
|
||||
|
||||
class ProfileDirectoryResolver(private val context: Context) {
|
||||
companion object {
|
||||
@@ -15,7 +14,7 @@ class ProfileDirectoryResolver(private val context: Context) {
|
||||
const val FILE_NAME_PROVIDER = "providers"
|
||||
}
|
||||
|
||||
private val nextResolver = ProviderResolver(context)
|
||||
private val nextResolver = ProviderResolver()
|
||||
|
||||
fun resolve(id: Long, paths: List<String>): VirtualFile {
|
||||
if (paths.size == 1) {
|
||||
|
||||
@@ -7,7 +7,6 @@ import com.github.kr328.clash.service.R
|
||||
import com.github.kr328.clash.service.data.ClashDatabase
|
||||
import com.github.kr328.clash.service.data.ClashProfileEntity
|
||||
import java.io.FileNotFoundException
|
||||
import java.lang.UnsupportedOperationException
|
||||
|
||||
class ProfilesResolver(private val context: Context, private val database: ClashDatabase) {
|
||||
private val nextResolver = ProfileDirectoryResolver(context)
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
package com.github.kr328.clash.service.files
|
||||
|
||||
import android.content.Context
|
||||
import android.os.ParcelFileDescriptor
|
||||
import com.github.kr328.clash.service.util.resolveBase
|
||||
import java.io.FileNotFoundException
|
||||
import java.lang.UnsupportedOperationException
|
||||
import java.net.URLDecoder
|
||||
|
||||
class ProviderResolver(private val context: Context) {
|
||||
class ProviderResolver {
|
||||
fun resolve(id: Long, fileName: String): VirtualFile {
|
||||
val file = resolveBase(id).resolve(fileName)
|
||||
if (!file.exists())
|
||||
|
||||
Reference in new issue
Block a user