diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 00d4389..ed3a287 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -10,8 +10,11 @@
-
+
+
+
+
@@ -74,39 +77,27 @@
-
-
+
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
@@ -120,7 +111,6 @@
- caj
remove
error
arqueo
@@ -150,6 +140,7 @@
System.out.println(.+)
System.out
this.comparator
+ Button
2018 Daniel Cortes
@@ -172,12 +163,10 @@
@@ -292,21 +283,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -326,7 +302,7 @@
-
+
@@ -560,21 +536,7 @@
-
-
-
- 1545280618093
-
-
-
- 1545280618093
-
-
- 1545283447719
-
-
-
- 1545283447719
+
1545321626516
@@ -905,11 +867,25 @@
1547620625508
-
+
+ 1547786974928
+
+
+
+ 1547786974933
+
+
+ 1547787022196
+
+
+
+ 1547787022196
+
+
-
+
@@ -924,7 +900,7 @@
-
+
@@ -1050,8 +1026,6 @@
-
-
@@ -1075,21 +1049,15 @@
-
+
+
+
-
-
-
-
-
-
-
-
@@ -1229,53 +1197,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1544,13 +1465,6 @@
-
-
-
-
-
-
-
@@ -1581,37 +1495,96 @@
+
+
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dist/caja.jar b/dist/caja.jar
index 10c44a8..ef76070 100644
Binary files a/dist/caja.jar and b/dist/caja.jar differ
diff --git a/src/danielcortes/xyz/controllers/InformesController.java b/src/danielcortes/xyz/controllers/InformesController.java
index bd7ed12..89676be 100644
--- a/src/danielcortes/xyz/controllers/InformesController.java
+++ b/src/danielcortes/xyz/controllers/InformesController.java
@@ -27,6 +27,7 @@ package danielcortes.xyz.controllers;
import danielcortes.xyz.informes.InformeEgresos;
import danielcortes.xyz.informes.InformeLibroDeVentas;
import danielcortes.xyz.models.tipo_egreso.TipoEgreso;
+import danielcortes.xyz.utils.FileUtils;
import danielcortes.xyz.utils.StringUtils;
import danielcortes.xyz.views.MonthSelectDialog;
import danielcortes.xyz.views.InformesView;
@@ -125,8 +126,12 @@ public class InformesController {
if (chooser.showSaveDialog(this.view.getContentPanel()) == JFileChooser.APPROVE_OPTION) {
String filename = chooser.getSelectedFile().toString();
- if (!filename.endsWith(".xls"))
+ 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")) {
filename += ".xls";
+ }
return new File(filename);
} else {
diff --git a/src/danielcortes/xyz/utils/FileUtils.java b/src/danielcortes/xyz/utils/FileUtils.java
new file mode 100644
index 0000000..de26c94
--- /dev/null
+++ b/src/danielcortes/xyz/utils/FileUtils.java
@@ -0,0 +1,39 @@
+/*
+ * MIT License
+ *
+ * Copyright (c) 2018-2019 Daniel Cortes
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+package danielcortes.xyz.utils;
+
+import java.nio.file.InvalidPathException;
+import java.nio.file.Paths;
+
+public class FileUtils {
+ public static boolean isValidPath(String path) {
+ try {
+ Paths.get(path);
+ } catch (InvalidPathException | NullPointerException ex) {
+ return false;
+ }
+ return true;
+ }
+}