mirror of
https://github.com/nextcloud/android.git
synced 2024-11-21 20:55:31 +03:00
Fix code analytics
Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
parent
f547e50e4e
commit
d48b043e02
2 changed files with 5 additions and 2 deletions
|
@ -16,7 +16,7 @@ import org.junit.Assert.assertNull
|
|||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
|
||||
class FileNameValidatorTests: AbstractIT() {
|
||||
class FileNameValidatorTests : AbstractIT() {
|
||||
|
||||
@Test
|
||||
fun testInvalidCharacter() {
|
||||
|
|
|
@ -22,8 +22,11 @@ object FileNameValidator {
|
|||
"LPT¹", "LPT²", "LPT³"
|
||||
)
|
||||
|
||||
@Suppress("ReturnCount")
|
||||
fun isValid(name: String, context: Context, fileNames: MutableSet<String>? = null): String? {
|
||||
val invalidCharacter = name.find { it.toString().matches(reservedWindowsChars) || it.toString().matches(reservedUnixChars) }
|
||||
val invalidCharacter = name.find {
|
||||
it.toString().matches(reservedWindowsChars) || it.toString().matches(reservedUnixChars)
|
||||
}
|
||||
if (invalidCharacter != null) {
|
||||
return context.getString(R.string.file_name_validator_error_invalid_character, invalidCharacter)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue