La comprobacion del path estaba hecha al reves :c
This commit is contained in:
@@ -125,8 +125,8 @@ public class InformesController {
|
||||
chooser.setFileFilter(new FileNameExtensionFilter("Excel 2007", "xls"));
|
||||
|
||||
if (chooser.showSaveDialog(this.view.getContentPanel()) == JFileChooser.APPROVE_OPTION) {
|
||||
String filename = chooser.getSelectedFile().toString();
|
||||
if (FileUtils.isValidPath(filename)) {
|
||||
String filename = chooser.getSelectedFile().getPath();
|
||||
if (!FileUtils.isValidPath(filename)) {
|
||||
JOptionPane.showMessageDialog(this.view.getContentPanel(),"El archivo seleccionado no es valido","Archivo no valido", JOptionPane.ERROR_MESSAGE);
|
||||
return null;
|
||||
} else if (!filename.endsWith(".xls")) {
|
||||
|
||||
@@ -32,6 +32,7 @@ public class FileUtils {
|
||||
try {
|
||||
Paths.get(path);
|
||||
} catch (InvalidPathException | NullPointerException ex) {
|
||||
ex.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user