1 19 20 package org.netbeans.modules.websvc.registry.netbeans; 21 22 import java.security.PermissionCollection ; 23 import java.security.CodeSource ; 24 import java.security.Permissions ; 25 import java.security.AllPermission ; 26 import java.io.File ; 27 import java.net.URL ; 28 import java.net.URLClassLoader ; 29 import java.net.MalformedURLException ; 30 31 32 public class ExtensionClassLoader extends URLClassLoader { 33 34 35 public ExtensionClassLoader() throws MalformedURLException , RuntimeException { 36 super(new URL [0]); 37 } 38 39 public ExtensionClassLoader( ClassLoader _loader) throws MalformedURLException , RuntimeException { 40 super(new URL [0], _loader); 41 } 42 43 44 45 public void addURL(File f) throws MalformedURLException , RuntimeException { 46 if (f.isFile()){ 47 addURL(f.toURI().toURL()); 48 } 51 else{ 52 } 54 } 55 56 protected PermissionCollection getPermissions(CodeSource _cs) { 57 Permissions p = new Permissions (); 58 p.add(new AllPermission ()); 59 return p; 60 } 61 62 } 63 | Popular Tags |