#6449 Remove test logging for file name

This commit is contained in:
Christian Rowlands 2024-10-16 10:17:49 -04:00
parent 686ca0512f
commit 11f6987a98
1 changed files with 0 additions and 2 deletions

View File

@ -27,12 +27,10 @@ import timber.log.Timber
fun safeFileName(fileName: String?, mimeType: String?): String { fun safeFileName(fileName: String?, mimeType: String?): String {
return buildString { return buildString {
// filename has to be safe for the Android System // filename has to be safe for the Android System
Timber.i("ISSUE: FileService: original fileName $fileName")
val result = fileName val result = fileName
?.replace("[\\\\?%*:|\"<>\\s]".toRegex(), "_") ?.replace("[\\\\?%*:|\"<>\\s]".toRegex(), "_")
?.takeIf { it.isNotEmpty() } ?.takeIf { it.isNotEmpty() }
?: DEFAULT_FILENAME ?: DEFAULT_FILENAME
Timber.i("ISSUE: FileService: safeFileName $result")
append(result) append(result)
// Check that the extension is correct regarding the mimeType // Check that the extension is correct regarding the mimeType
val extensionFromMime = mimeType?.let { MimeTypeMap.getSingleton().getExtensionFromMimeType(mimeType) } val extensionFromMime = mimeType?.let { MimeTypeMap.getSingleton().getExtensionFromMimeType(mimeType) }