+ public static boolean openFile(final File file) {
+
+ final String fileExtension = Utils.getFileExtension(file);
+
+ System.out.println("About to open file with extension: " + fileExtension);
+
+ if (extensionToApplication.containsKey(fileExtension)) {
+
+ System.out.println("Commands found");
+
+ final String[] commands = extensionToApplication.get(fileExtension);
+
+ for (int i = 0; i < commands.length; i++)
+ if (commands[i].equals(FILE_INDICATOR))
+ commands[i] = file.getAbsolutePath();
+
+ try {
+ Runtime.getRuntime().exec(commands);
+ InstantLauncher.exitProgram();
+
+ } catch (final IOException e) {
+ new ExceptionDialog(e);
+ }
+
+ return true;
+ } else
+ return false;
+
+ }
+