/** * Constructor * * @param io.Folder $folder * @throws lang.IllegalArgumentException if the given folder does not exist or isn't in class path */ public function __construct(Folder $folder) { $path = $folder->getURI(); foreach (ClassLoader::getLoaders() as $cl) { if ($cl instanceof FileSystemClassLoader && 0 === strncmp($cl->path, $path, strlen($cl->path))) { $this->loader = $cl; return; } } throw new IllegalArgumentException($folder->toString() . ($folder->exists() ? ' is not in class path' : ' does not exist')); }