if (chosenFile.canExecute()) {
executeCommand(chosenFile.getAbsolutePath());
} else {
- final boolean fileOpened = FileAssociationManager.openFile(chosenFile);
- if (fileOpened) {
- InstantLauncher.exitProgram();
+ boolean fileOpened;
+ try {
+ fileOpened = FileAssociationManager.openFile(chosenFile.getCanonicalFile());
+ if (fileOpened) {
+ InstantLauncher.exitProgram();
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
}
}
}
if (chosenFile.isDirectory()) {
- executeCommand("nautilus", "-w", chosenFile.getAbsolutePath());
+ try {
+ executeCommand("nautilus", "-w", chosenFile.getCanonicalFile().getAbsolutePath());
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
}
}
if (chosenFile.isFile()) {
chosenFile.setExecutable(!chosenFile.canExecute());
} else {
- executeCommand("gnome-terminal", "--working-directory=" + chosenFile.getAbsolutePath());
+ try {
+ executeCommand("gnome-terminal", "--working-directory="
+ + chosenFile.getCanonicalFile().getAbsolutePath());
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
}
}
@Override
public void menuItemSelectedAlternative2(Menu menu, File chosenFile) {
if (chosenFile.isFile()) {
- executeCommand("emacs", chosenFile.getAbsolutePath());
+ try {
+ executeCommand("emacs", chosenFile.getCanonicalFile().getAbsolutePath());
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
}
}