public PluginLoader(String directory, Class<? extends IPlugin> type) throws MalformedURLException {
	  // check whether the URL is a directory
	  File dirFile = new File(directory);
	  if (dirFile == null || ! dirFile.isDirectory()) {
		  String errmsg = directory + " is not a directory";
		  logger.warning(errmsg);
		  throw new IllegalArgumentException(errmsg);
	  }
	  // add an ending "/" if needed (classloader seems to need this)
	  if (!directory.endsWith("/")) {
		  directory += "/";
	  }
	  this.pluginDirectory = directory;
	  ptype=type;
	  createNewClassLoader();
  }