throw new IllegalArgumentException("Illegal number of args: " + args.length); String location = args[0]; FilePermission locationPat = new FilePermission(location, "read"); FilePermission sourcePat = new FilePermission(bundle.getLocation().toString(), "read"); return locationPat.implies(sourcePat) ? Condition.TRUE : Condition.FALSE;
throw new IllegalArgumentException("Illegal number of args: " + args.length); String bundleLocation = (String) AccessController.doPrivileged(new PrivilegedAction() { public Object run() { return bundle.getLocation(); } }); Filter filter = null; try { filter = FrameworkUtil.createFilter("(location=" + encodeLocation(args[0]) + ")"); } catch (InvalidSyntaxException e) {  throw new RuntimeException("Invalid filter: " + e.getFilter()); } Hashtable matchProps = new Hashtable(2); matchProps.put("location", bundleLocation); return filter.match(matchProps) ? Condition.TRUE : Condition.FALSE;
	static public Condition getCondition(Bundle bundle, ConditionInfo info) {		if (!CONDITION_TYPE.equals(info.getType()))			throw new IllegalArgumentException("ConditionInfo must be of type \"" + CONDITION_TYPE + "\"");		String[] args = info.getArgs();		if (args.length != 1)			throw new IllegalArgumentException("Illegal number of args: " + args.length);		String location = args[0];		FilePermission locationPat = new FilePermission(location, "read");		FilePermission sourcePat = new FilePermission(bundle.getLocation().toString(), "read");		return locationPat.implies(sourcePat) ? Condition.TRUE : Condition.FALSE;	}