1 19 20 package org.netbeans.modules.apisupport.jnlplauncher; 22 23 import java.io.File ; 24 import java.security.Policy ; 25 26 31 public class Main extends Object { 32 33 37 public static void main (String args[]) throws Exception { 38 fixPolicy(); 39 fixNetBeansUser(); 40 org.netbeans.Main.main(args); 41 } 42 43 45 final static void fixNetBeansUser() { 46 String userDir = System.getProperty("netbeans.user"); if (userDir == null) { 48 return; 49 } 50 final String PREFIX = "${user.home}/"; int uh = userDir.indexOf(PREFIX); 52 if (uh == -1) { 53 return; 54 } 55 String newDir = 56 userDir.substring(0, uh) + 57 System.getProperty("user.home") + File.separator + 59 userDir.substring(uh + PREFIX.length()); 60 System.setProperty("netbeans.user", newDir); } 62 63 68 final static void fixPolicy() { 69 if (Boolean.getBoolean("netbeans.jnlp.fixPolicy")) { Policy.setPolicy(new RuntimePolicy()); 72 System.setSecurityManager(new SecurityManager ()); 77 } 78 } 79 } 80 | Popular Tags |