Skip to content

Commit 751731a

Browse files
technclMancunianSam
andcommitted
Fix file selector not opening on path sub dialog
Co-authored-by: Sam Palmer <[email protected]> Co-authored-by: Nigel Lutale <[email protected]>
1 parent 7d37e15 commit 751731a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

csv-validator-ui/src/main/scala/uk/gov/nationalarchives/csv/validator/ui/CsvValidatorUi.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import uk.gov.nationalarchives.csv.validator.{EOL, FailMessage, ProgressCallback
2020
import java.awt.Cursor
2121
import java.awt.datatransfer.DataFlavor
2222
import java.io.{File, IOException}
23-
import java.net.URL
23+
import java.net.{URI, URL}
2424
import java.nio.charset.Charset
2525
import java.nio.charset.StandardCharsets.UTF_8
2626
import java.nio.file.{Files, Path, Paths, StandardOpenOption}
@@ -542,7 +542,7 @@ object CsvValidatorUi extends SimpleSwingApplication {
542542
fileButton.reactions += {
543543
case ev: ButtonClicked =>
544544
val startingDir = if(toPathField.text.isEmpty) userDir.toFile else Path.of(toPathField.text).toFile
545-
val fromFolderName = Path.of(fromPathField.text).getFileName
545+
val fromFolderName = Path.of(URI.create(fromPathField.text)).getFileName
546546
val helpText = s"Select the $fromFolderName folder"
547547
val fileChooser = new FileChooser(startingDir)
548548
fileChooser.multiSelectionEnabled = false

0 commit comments

Comments
 (0)