Author: snjeza
Date: 2009-01-06 19:52:58 -0500 (Tue, 06 Jan 2009)
New Revision: 12912
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/ExploreUtils.java
Log:
JBIDE-3493 nautilus command in "explore" action fails
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/ExploreUtils.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/ExploreUtils.java 2009-01-06
22:03:00 UTC (rev 12911)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/ExploreUtils.java 2009-01-07
00:52:58 UTC (rev 12912)
@@ -35,6 +35,7 @@
public final static String EXPLORE = "Explore";
public final static String EXPLORE_DESCRIPTION = "Explore deploy directory";
private static String exploreFolderCommand;
+ private static String[] exploreFolderCommandArray;
private static String exploreFileCommand;
public static String getExploreCommand() {
@@ -62,11 +63,16 @@
exploreFileCommand = "cmd /C start explorer /select,/e,\""
+ PATH + "\"";
} else if (Platform.OS_LINUX.equals(Platform.getOS())) {
+
if (new File("/usr/bin/nautilus").exists()) {
- exploreFolderCommand = "/usr/bin/nautilus --no-desktop \"" + PATH +
"\"";
+ exploreFolderCommandArray = new String[3];
+ exploreFolderCommandArray[0]="/usr/bin/nautilus";
+ exploreFolderCommandArray[1]="--no-desktop";
+ exploreFolderCommand = "";
} else if (new File("/usr/bin/konqueror").exists()) {
- exploreFolderCommand = "/usr/bin/konqueror \"" + PATH
- + "\"";
+ exploreFolderCommandArray = new String[2];
+ exploreFolderCommandArray[0]="/usr/bin/konqueror";
+ exploreFolderCommand = "";
}
exploreFileCommand = exploreFolderCommand;
}
@@ -108,9 +114,16 @@
if (Platform.getOS().equals(Platform.OS_WIN32)) {
name = name.replace('/', '\\');
}
- command = command.replace(ExploreUtils.PATH, name);
+
try {
- Runtime.getRuntime().exec(command);
+ if (Platform.OS_LINUX.equals(Platform.getOS())) {
+ int len = exploreFolderCommandArray.length;
+ exploreFolderCommandArray[len-1] = name;
+ Runtime.getRuntime().exec(exploreFolderCommandArray);
+ } else {
+ command = command.replace(ExploreUtils.PATH, name);
+ Runtime.getRuntime().exec(command);
+ }
} catch (IOException e) {
JBossServerUIPlugin.log(e.getMessage(),e);
}
Show replies by date