summaryrefslogtreecommitdiffstats
path: root/Dozentenmodul/src/models/Links.java
diff options
context:
space:
mode:
Diffstat (limited to 'Dozentenmodul/src/models/Links.java')
-rw-r--r--Dozentenmodul/src/models/Links.java44
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