File chooser dialogs don't append file extension if folder path has a

dot character in it
This commit is contained in:
Branislav Stojkovic
2018-12-16 10:44:41 +01:00
parent 53b58ef35a
commit 745901131e
2 changed files with 5 additions and 1 deletions
@@ -158,7 +158,7 @@ public class DialogFactory {
if (result == JFileChooser.APPROVE_OPTION) {
lastDirectory = fileChooser.getCurrentDirectory();
ConfigurationManager.getInstance().writeValue(PATH_KEY, lastDirectory.getAbsolutePath());
if (fileChooser.getSelectedFile().getAbsolutePath().contains(".")) {
if (fileChooser.getSelectedFile().getName().contains(".")) {
return fileChooser.getSelectedFile();
} else {
return new File(fileChooser.getSelectedFile().getAbsoluteFile() + "." + defaultExtension);