public static function fromArrayAndSettings($cfg, $settings, $artifact = null) {
        $fileSpecification = new static($cfg, $settings->getDirectory(), $artifact);
        $fileSpecification->set("relativeSource", $fileSpecification->getSource());
        $fileSpecification->set("source", $settings->getPath($fileSpecification->getSource()));
        $fileSpecification->set("target", fphp\Helper\Path::join(
            $settings->getOptional("target", null), $fileSpecification->getTarget()));

        if (!file_exists($fileSpecification->getSource()))
            throw new FileSpecificationException("file \"{$fileSpecification->getSource()}\" does not exist");

        return $fileSpecification;
    }