Skip to content

Instantly share code, notes, and snippets.

@asv
Created July 4, 2011 08:35
Show Gist options
  • Save asv/1063073 to your computer and use it in GitHub Desktop.
Save asv/1063073 to your computer and use it in GitHub Desktop.
Vuze open url bug
Index: Utils.java
===================================================================
--- Utils.java (revision 26653)
+++ Utils.java (working copy)
@@ -22,6 +22,7 @@
package org.gudy.azureus2.ui.swt;
import java.io.File;
+import java.io.IOException;
import java.util.*;
import java.util.List;
@@ -956,11 +957,14 @@
if (!launched && Constants.isUnix) {
sFile = sFile.replaceAll( " ", "\\ " );
-
- if (!Program.launch("xdg-open " + sFile)) {
- if ( !Program.launch("htmlview " + sFile)){
-
- Debug.out( "Failed to launch '" + sFile + "'" );
+
+ try {
+ Runtime.getRuntime().exec(new String[] {"xdg-open", sFile});
+ } catch (IOException exc) {
+ try {
+ Runtime.getRuntime().exec(new String[] {"htmlview", sFile});
+ } catch (IOException exc2) {
+ Debug.out( "Failed to launch '" + sFile + "'");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment