Exemplo n.º 1
0
        public static Types.Repository GetRepository(this IGetRepositoryResponse response, string name)
        {
            var repo = response.Repositories[name];

            return(new Types.Repository
            {
                Name = name,
                Type = repo.Type,
                Settings = response.GetSettings(name)
            });
        }
Exemplo n.º 2
0
        public static object GetSettings(this IGetRepositoryResponse response, string name)
        {
            switch (response.Repositories[name].Type.ToLowerInvariant())
            {
            case "fs":
                return(response.FileSystem(name).Settings);

            case "s3":
                return(response.S3(name).Settings);

            case "azure":
                return(response.Azure(name).Settings);

            case "hdfs":
                return(response.Hdfs(name).Settings);

            case "url":
                return(response.ReadOnlyUrl(name).Settings);

            default:
                return(null);
            }
        }