Commit 9d9eaab8 authored by leichao.gao's avatar leichao.gao

update

parent 2996d0bb
......@@ -30,7 +30,15 @@ object BackUpUtils {
try {
val recycleBinFile = File(getRecycleBinDir(), ".$path")
src.copyTo(recycleBinFile, true)
val binBean = RecycleBinBean(path,src.path, recycleBinFile.absolutePath,0, src.length(), getFileExtension(src), false)
val binBean = RecycleBinBean(
path,
src.path,
recycleBinFile.absolutePath,
0,
src.length(),
getFileExtension(src),
false
)
saveData(binBean, path)
} catch (e: Exception) {
......@@ -129,4 +137,13 @@ object BackUpUtils {
return readPermission == PackageManager.PERMISSION_GRANTED && writePermission == PackageManager.PERMISSION_GRANTED
}
}
fun recoveryFile(name: String) {
val isExists = queryFileExists(name)
if (isExists) {
val hashMap = queryBackUpSp()
hashMap.remove(name)
saveBackUpSp(hashMap)
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment