Skip to content
Snippets Groups Projects
Commit c06e4ef0 authored by apvrille's avatar apvrille
Browse files

Adding ProVerif directory verification

parent 1aec88c9
No related branches found
No related tags found
No related merge requests found
......@@ -46,7 +46,7 @@
package myutil;
import java.io.*;
import java.nio.file.*;
public class FileUtils {
......@@ -78,9 +78,14 @@ public class FileUtils {
return ext;
}
public static boolean checkPath(String path) {
return new File(path).isDirectory();
}
public static boolean checkFileForSave(File file) throws FileException {
// boolean ok = true;
// String pb = "";
// boolean ok = true;
// String pb = "";
if (file == null) {
return false;
......@@ -238,8 +243,8 @@ public class FileUtils {
}
public static void saveFile(String name, String data) throws FileException {
File f = new File(name);
saveFile(f, data);
File f = new File(name);
saveFile(f, data);
}
......
......@@ -383,7 +383,14 @@ public class JDialogProverifVerification extends javax.swing.JDialog implements
if (pathCode.isEmpty()){
pathCode="pvspec";
}
} else {
if (!FileUtils.checkPath(pathCode)) {
jta.append("Error: invalid directory: " + pathCode + "\n");
mode = STOPPED;
setButtons();
return;
}
}
testFile = new File(pathCode);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment