File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
csv-validator-ui/src/main/scala/uk/gov/nationalarchives/csv/validator/ui Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -262,19 +262,20 @@ object CsvValidatorUi extends SimpleSwingApplication {
262262 val numOfFilesDropped = files.length
263263 lazy val filePaths = files.map(_.getAbsolutePath)
264264 lazy val (file1Ext, file2Ext) = {
265- val fileExtensions = filePaths.map(_.split('.' ).last)
265+ val fileExtensions = filePaths.map(_.split('.' ).last.toLowerCase )
266266 (fileExtensions.head, fileExtensions.last)
267267 }
268268
269269 if (numOfFilesDropped > 2 ) showErrorDialog(" Drop a maximum of 2 files." )
270270 else if (numOfFilesDropped == 2 && Set (file1Ext, file2Ext) != Set (" csv" , " csvs" ))
271271 showErrorDialog(" Drop a single '.csv' file and its corresponding '.csvs' file." )
272272 else filePaths.map { filePath =>
273- if (filePath.endsWith(" .csv" )) {
273+ val lowercasedFilePath = filePath.toLowerCase
274+ if (lowercasedFilePath.endsWith(" .csv" )) {
274275 txtCsvFile.setText(filePath)
275276 true
276277 }
277- else if (filePath .endsWith(" .csvs" )) {
278+ else if (lowercasedFilePath .endsWith(" .csvs" )) {
278279 txtCsvSchemaFile.setText(filePath)
279280 true
280281 }
You can’t perform that action at this time.
0 commit comments