explicitly grab all permissions for application execution (need feedback on the effec...
authorjprocter <Jim Procter>
Fri, 24 Jul 2009 15:27:37 +0000 (15:27 +0000)
committerjprocter <Jim Procter>
Fri, 24 Jul 2009 15:27:37 +0000 (15:27 +0000)
src/jalview/bin/Jalview.java

index ed51cee..805d098 100755 (executable)
@@ -26,6 +26,11 @@ import java.io.OutputStreamWriter;
 import java.io.PrintWriter;
 import java.lang.reflect.Constructor;
 import java.net.URL;
+import java.security.AllPermission;
+import java.security.CodeSource;
+import java.security.PermissionCollection;
+import java.security.Permissions;
+import java.security.Policy;
 import java.util.*;
 
 import javax.swing.*;
@@ -43,7 +48,19 @@ import jalview.io.AppletFormatAdapter;
  */
 public class Jalview
 {
-
+  static {
+  // grab all the rights we can the JVM
+    Policy.setPolicy( new Policy() {
+    public PermissionCollection
+    getPermissions(CodeSource codesource) {
+    Permissions perms = new Permissions();
+    perms.add(new AllPermission());
+    return(perms);
+    }
+    public void refresh(){
+    }
+    });
+  }
   /**
    * main class for Jalview application
    * 
@@ -285,7 +302,6 @@ public class Jalview
 
       AlignFrame af = fileLoader.LoadFileWaitTillLoaded(file, protocol,
               format);
-
       if (af == null)
       {
         System.out.println("error");