Exemplo n.º 1
0
        public IEnumerable <FsFileStatusPage> ListFilesPaged(FsPath path, FileListingParameters parameters)
        {
            int    count = 0;
            string after = null;

            while (true)
            {
                var result = RestClients.FileSystemClient.FileSystem.ListFileStatus(this.Account.Name, path.ToString(), parameters.PageSize, after);

                if (result.FileStatuses.FileStatus.Count > 0)
                {
                    var page = new FsFileStatusPage();
                    page.Path = path;

                    page.FileItems = result.FileStatuses.FileStatus.Select(i => new FsFileStatus(i)).ToList();
                    yield return(page);

                    count += page.FileItems.Count;

                    if (parameters.Top > 0 && count >= parameters.Top)
                    {
                        break;
                    }
                    after = result.FileStatuses.FileStatus[result.FileStatuses.FileStatus.Count - 1].PathSuffix;
                }
                else
                {
                    break;
                }
            }
        }
Exemplo n.º 2
0
 public void Append(FsFileStatusPage file, byte[] bytes)
 {
     using (var stream = new System.IO.MemoryStream(bytes))
     {
         this.RestClients.FileSystemRest.Append(this.Account, file, stream);
     }
 }
Exemplo n.º 3
0
        public void Appen(FsFileStatusPage file, string content)
        {
            var bytes = System.Text.Encoding.UTF8.GetBytes(content);

            using (var stream = new System.IO.MemoryStream(bytes))
            {
                this.RestClients.FileSystemRest.Append(this.Account, file, stream);
            }
        }
Exemplo n.º 4
0
        public IEnumerable <FsFileStatusPage> ListFilesPaged(StoreAccount store, FsPath path, ListFilesOptions options)
        {
            string after = null;

            while (true)
            {
                var result = RestClient.FileSystem.ListFileStatus(store.Name, path.ToString(), options.PageSize, after);

                if (result.FileStatuses.FileStatus.Count > 0)
                {
                    var page = new FsFileStatusPage();
                    page.Path = path;

                    page.FileItems = result.FileStatuses.FileStatus.Select(i => new FsFileStatus(i)).ToList();
                    yield return(page);

                    after = result.FileStatuses.FileStatus[result.FileStatuses.FileStatus.Count - 1].PathSuffix;
                }
                else
                {
                    break;
                }
            }
        }
        public IEnumerable <FsFileStatusPage> ListFilesPaged(AdlClient.Models.StoreAccountRef account, FsPath path, FileListingParameters parameters)
        {
            string after = null;

            while (true)
            {
                var result = RestClient.FileSystem.ListFileStatus(account.Name, path.ToString(), parameters.PageSize, after);

                if (result.FileStatuses.FileStatus.Count > 0)
                {
                    var page = new FsFileStatusPage();
                    page.Path = path;

                    page.FileItems = result.FileStatuses.FileStatus.Select(i => new FsFileStatus(i)).ToList();
                    yield return(page);

                    after = result.FileStatuses.FileStatus[result.FileStatuses.FileStatus.Count - 1].PathSuffix;
                }
                else
                {
                    break;
                }
            }
        }
Exemplo n.º 6
0
        public IEnumerable <FsFileStatusPage> ListFilesPaged(FsUri uri, FileListingParameters parameters)
        {
            string after = null;

            while (true)
            {
                var result = RestClient.FileSystem.ListFileStatus(uri.Account, uri.Path, parameters.PageSize, after);

                if (result.FileStatuses.FileStatus.Count > 0)
                {
                    var page = new FsFileStatusPage();
                    page.Path = new FsPath(uri.Path);

                    page.FileItems = result.FileStatuses.FileStatus.Select(i => new FsFileStatus(i)).ToList();
                    yield return(page);

                    after = result.FileStatuses.FileStatus[result.FileStatuses.FileStatus.Count - 1].PathSuffix;
                }
                else
                {
                    break;
                }
            }
        }
Exemplo n.º 7
0
 public void Append(StoreAccount store, FsFileStatusPage file, System.IO.Stream steamContents)
 {
     this.RestClient.FileSystem.Append(store.Name, file.ToString(), steamContents);
 }
 public void Append(AdlClient.Models.StoreAccountRef account, FsFileStatusPage file, System.IO.Stream steamContents)
 {
     this.RestClient.FileSystem.Append(account.Name, file.ToString(), steamContents);
 }