public static function fromArrayAndSettings($cfg, $settings) {
        $directorySpecification = new self($cfg, $settings->getDirectory());
        $directorySpecification->set("source", $settings->getPath($directorySpecification->getSource()));
        $directorySpecification->set("baseTarget", $settings->getOptional("target", null));

        if (!is_dir($directorySpecification->getSource()))
            throw new DirectorySpecificationException("directory \"{$directorySpecification->getSource()}\" does not exist");

        return $directorySpecification;
    }