public static function fromString($json, $directory = ".") {
        $json = json_decode($json, true);
        if (is_null($json))
            throw new SettingsException("invalid json");
        return new static($json, $directory);
    }