This commit is contained in:
andrew
2023-08-06 22:22:39 +09:30
parent a27f81db30
commit bcf925c132
31 changed files with 176 additions and 204 deletions

View File

@@ -15,7 +15,7 @@ object ExternalStorageUtil {
@Throws(NoExternalStorageException::class)
fun getDir(context: Context, type: String?): File {
return context.getExternalFilesDir(type)
?: throw NoExternalStorageException("External storage dir is currently unavailable: $type")
?: throw NoExternalStorageException("External storage dir is currently unavailable: $type")
}
@Throws(NoExternalStorageException::class)
@@ -73,10 +73,7 @@ object ExternalStorageUtil {
}
@JvmStatic
fun getCleanFileName(fileName: String?): String? {
var fileName = fileName ?: return null
fileName = fileName.replace('\u202D', '\uFFFD')
fileName = fileName.replace('\u202E', '\uFFFD')
return fileName
}
}
fun getCleanFileName(fileName: String?): String? =
fileName?.replace('\u202D', '\uFFFD')
?.replace('\u202E', '\uFFFD')
}