Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public EncryptionApp(String args[]) {
- if (args.length != 4) {
- JOptionPane.showMessageDialog(null, "Arguments error");
- System.exit(0);
- }
- if (args[0].equalsIgnoreCase("") || args[1].equalsIgnoreCase("") || args[2].equalsIgnoreCase("") || args[3].equalsIgnoreCase("")) {
- JOptionPane.showMessageDialog(null, "Arguments cannot be empty");
- System.exit(0);
- }
- if (args[2].length() != 16) {
- JOptionPane.showMessageDialog(null, "Encryption key not valid");
- System.exit(0);
- }
- inputPath = args[0];
- databasePath = args[1];
- encryptionKey = args[2];
- outputPath = args[3];
- if (!inputPath.endsWith("/")) {
- inputPath += "/";
- }
- if (!outputPath.endsWith("/")) {
- outputPath += "/";
- }
- initComponents();
- this.setLocationRelativeTo(null);
- ctrl = new Controller(databasePath);
- try {
- ctrl.populateStorage(inputPath);
- } catch (Exception e) {
- System.out.println(e.getMessage());
- JOptionPane.showMessageDialog(null, e.getMessage());
- System.exit(0);
- }
- storage = ctrl.decryptStorage();
- fileHelpers = new FileHelpers();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement