// Path: src/main/java/net/datenwerke/sandbox/securitypermissions/SandboxRuntimePermission.java
// public class SandboxRuntimePermission extends BasicPermission {
// 
// 	/**
// 	 * 
// 	 */
// 	private static final long serialVersionUID = 6914720697570769005L;
// 
// 	public SandboxRuntimePermission(String name) {
// 		super(name);
// 	}
// 
// }


import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.security.CodeSource;
import java.security.Permissions;
import java.security.ProtectionDomain;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.IdentityHashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.logging.Level;
import java.util.logging.Logger;
import javassist.CannotCompileException;
import javassist.ClassPool;
import javassist.CtClass;
import javassist.CtMethod;
import javassist.NotFoundException;
import net.datenwerke.sandbox.securitypermissions.SandboxRuntimePermission;
import org.apache.commons.io.IOUtils;
import sun.misc.Resource;
import sun.misc.URLClassPath;
	 */
	public SandboxLoader() {
		this(SandboxService.class.getClassLoader());
	}

	/**
	 * Instantiates a new SandboxLoader with the given ClassLoader as parent.
	 * @param parent
	 */
	public SandboxLoader(ClassLoader parent) {
		this(parent, System.getSecurityManager());
	}
	
	/**
	 * Instantiates a new SandboxLoader with the given ClassLoader as parent and using the given security manager.
	 * @param parent
	 * @param securityManager
	 */
	public SandboxLoader(ClassLoader parent, SecurityManager securityManager) {
		super(parent);
		this.parent = parent;
		this.securityManager = (SandboxSecurityManager) securityManager;
	}
	
	/**
	 * Initializes this classloader with the config provided by the SandboxContext
	 * 
	 * @param context
	 */
	public void init(SandboxContext context) {
// Path: src/main/java/net/datenwerke/sandbox/securitypermissions/SandboxRuntimePermission.java
// public class SandboxRuntimePermission extends BasicPermission {
// 
// 	/**
// 	 * 
// 	 */
// 	private static final long serialVersionUID = 6914720697570769005L;
// 
// 	public SandboxRuntimePermission(String name) {
// 		super(name);
// 	}
// 
// }


// Path: src/main/java/net/datenwerke/sandbox/SandboxLoader.java
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.security.CodeSource;
import java.security.Permissions;
import java.security.ProtectionDomain;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.IdentityHashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.logging.Level;
import java.util.logging.Logger;
import javassist.CannotCompileException;
import javassist.ClassPool;
import javassist.CtClass;
import javassist.CtMethod;
import javassist.NotFoundException;
import net.datenwerke.sandbox.securitypermissions.SandboxRuntimePermission;
import org.apache.commons.io.IOUtils;
import sun.misc.Resource;
import sun.misc.URLClassPath;

	 */
	public SandboxLoader() {
		this(SandboxService.class.getClassLoader());
	}

	/**
	 * Instantiates a new SandboxLoader with the given ClassLoader as parent.
	 * @param parent
	 */
	public SandboxLoader(ClassLoader parent) {
		this(parent, System.getSecurityManager());
	}
	
	/**
	 * Instantiates a new SandboxLoader with the given ClassLoader as parent and using the given security manager.
	 * @param parent
	 * @param securityManager
	 */
	public SandboxLoader(ClassLoader parent, SecurityManager securityManager) {
		super(parent);
		this.parent = parent;
		this.securityManager = (SandboxSecurityManager) securityManager;
	}
	
	/**
	 * Initializes this classloader with the config provided by the SandboxContext
	 * 
	 * @param context
	 */
	public void init(SandboxContext context) {
		securityManager.checkPermission(new SandboxRuntimePermission("initSandboxLoader"));