X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Futil%2FPlatform.java;h=573e2d584db09e7deac6c36abee5ec239a3cf53f;hb=ac3fe94f6d237a0a2032474844217d542040776c;hp=a65ee95e83e121b486f1ead9bb48758dc22b630c;hpb=fbd878d0ad686c65f9c9e42db37494535e63aa29;p=jalview.git diff --git a/src/jalview/util/Platform.java b/src/jalview/util/Platform.java index a65ee95..573e2d5 100644 --- a/src/jalview/util/Platform.java +++ b/src/jalview/util/Platform.java @@ -88,7 +88,8 @@ public class Platform public static boolean isLinux() { return (isLinux == null - ? (isLinux = (System.getProperty("os.name").indexOf("Linux") >= 0)) + ? (isLinux = (System.getProperty("os.name") + .indexOf("Linux") >= 0)) : isLinux); } @@ -522,8 +523,7 @@ public class Platform public static Object parseJSON(String json) throws ParseException { - return (isJS() ? JSON.parse(json) - : new JSONParser().parse(json)); + return (isJS() ? JSON.parse(json) : new JSONParser().parse(json)); } public static Object parseJSON(Reader r) @@ -555,8 +555,8 @@ public class Platform * @param is * @param outFile * @throws IOException - * if the file cannot be created or there is a problem - * reading the input stream. + * if the file cannot be created or there is a problem reading the + * input stream. */ public static void streamToFile(InputStream is, File outFile) throws IOException @@ -600,8 +600,8 @@ public class Platform if (isJS()) { System.out.println( - "Platform adding known access-control-allow-origin * for domain " - + domain); + "Platform adding known access-control-allow-origin * for domain " + + domain); /** * @j2sNative * @@ -613,23 +613,31 @@ public class Platform public static void getURLCommandArguments() { - - /** - * Retrieve the first query field as command arguments to Jalview. Include - * only if prior to "?j2s" or "&j2s" or "#". Assign the applet's __Info.args - * element to this value. - * - * @j2sNative var a = - * decodeURI((document.location.href.replace("&","?").split("?j2s")[0] - * + "?").split("?")[1].split("#")[0]); a && - * (J2S.thisApplet.__Info.args = a.split(" ")); - */ - + try + { + /** + * Retrieve the first query field as command arguments to Jalview. Include + * only if prior to "?j2s" or "&j2s" or "#". Assign the applet's + * __Info.args element to this value. + * + * @j2sNative var a = + * decodeURI((document.location.href.replace("&","?").split("?j2s")[0] + * + "?").split("?")[1].split("#")[0]); a && + * (System.out.println("URL arguments detected were "+a)) && + * (J2S.thisApplet.__Info.urlargs = a.split(" ")); + * (!J2S.thisApplet.__Info.args || J2S.thisApplet.__Info.args + * == "" || J2S.thisApplet.__Info.args == "??") && + * (J2S.thisApplet.__Info.args = a) && (System.out.println("URL + * arguments were passed to J2S main.")); + */ + } catch (Throwable t) + { + } } /** - * A (case sensitive) file path comparator that ignores the difference between / - * and \ + * A (case sensitive) file path comparator that ignores the difference between + * / and \ * * @param path1 * @param path2