Refactor the namespace to com.sukisu.ultra, add IKsuInterface and LatestVersionInfo data classes, and remove obsolete classes and methods.
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
package com.sukisu.ultra.utils
|
||||
|
||||
import android.content.Context
|
||||
import java.io.File
|
||||
import java.io.FileOutputStream
|
||||
import java.io.IOException
|
||||
|
||||
object AssetsUtil {
|
||||
@Throws(IOException::class)
|
||||
fun exportFiles(context: Context, src: String, out: String) {
|
||||
val fileNames = context.assets.list(src)
|
||||
if (fileNames?.isNotEmpty() == true) {
|
||||
val file = File(out)
|
||||
file.mkdirs()
|
||||
fileNames.forEach { fileName ->
|
||||
exportFiles(context, "$src/$fileName", "$out/$fileName")
|
||||
}
|
||||
} else {
|
||||
context.assets.open(src).use { inputStream ->
|
||||
FileOutputStream(File(out)).use { outputStream ->
|
||||
inputStream.copyTo(outputStream)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user