diff options
| author | Tobias Spitzer | 2014-06-06 12:33:50 +0200 |
|---|---|---|
| committer | Tobias Spitzer | 2014-06-06 12:33:50 +0200 |
| commit | 9abf78265f1bbd8a94904553d779af96ccd61770 (patch) | |
| tree | 583e6fcd2f39f163f631699935dbfab29968d66d /Dozentenmodul/src/models/Links.java | |
| parent | Erste Maintenance Funktion (diff) | |
| parent | fehler!! (diff) | |
| download | tutor-module-9abf78265f1bbd8a94904553d779af96ccd61770.tar.gz tutor-module-9abf78265f1bbd8a94904553d779af96ccd61770.tar.xz tutor-module-9abf78265f1bbd8a94904553d779af96ccd61770.zip | |
Merge branch 'master' of git.openslx.org:openslx-ng/tutor-module
Diffstat (limited to 'Dozentenmodul/src/models/Links.java')
| -rw-r--r-- | Dozentenmodul/src/models/Links.java | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/Dozentenmodul/src/models/Links.java b/Dozentenmodul/src/models/Links.java index 07db94a5..3e3dfb0e 100644 --- a/Dozentenmodul/src/models/Links.java +++ b/Dozentenmodul/src/models/Links.java @@ -28,6 +28,29 @@ public class Links { try { + + if (os.indexOf( "Win" ) >= 0) { + + rt.exec( "rundll32 url.dll,FileProtocolHandler " + faq); + + } else if (os.indexOf( "Mac" ) >= 0) { + + rt.exec( "open " + faq); + + } else if (os.indexOf( "nix") >=0 || os.indexOf( "nux") >=0) { + + // Do a best guess on unix until we get a platform independent way + // Build a list of browsers to try, in this order. + String[] browsers = {"epiphany", "firefox", "mozilla", "konqueror", + "netscape","opera","links","lynx"}; + + StringBuffer cmd = new StringBuffer(); + for (int i=0; i<browsers.length; i++) + cmd.append( (i==0 ? "" : " || " ) + browsers[i] +" \"" + faq + "\" "); + + rt.exec(new String[] { "sh", "-c", cmd.toString() }); + } + if (os.indexOf("Win") >= 0) { // this doesn't support showing urls in the form of @@ -56,6 +79,7 @@ public class Links { rt.exec(new String[] { "sh", "-c", cmd.toString() }); } + } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); @@ -71,6 +95,26 @@ public class Links { try { + if (os.indexOf( "Win" ) >= 0) { + + rt.exec( "rundll32 url.dll,FileProtocolHandler " + otrs); + + } else if (os.indexOf( "Mac" ) >= 0) { + + rt.exec( "open " + otrs); + + } else if (os.indexOf( "nix") >=0 || os.indexOf( "nux") >=0) { + + String[] browsers = {"epiphany", "firefox", "mozilla", "konqueror", + "netscape","opera","links","lynx"}; + + StringBuffer cmd = new StringBuffer(); + for (int i=0; i<browsers.length; i++) + cmd.append( (i==0 ? "" : " || " ) + browsers[i] +" \"" + otrs + "\" "); + + rt.exec(new String[] { "sh", "-c", cmd.toString() }); + } + if (os.indexOf("Win") >= 0) { // this doesn't support showing urls in the form of |
