public override async Task UpdateSecurityAsync(IStorageSecurity security, IProgress progress = null, CancellationToken cancellationToken = default(CancellationToken))
        {
            try
            {
                if (null != progress)
                {
                    progress.Total = 1;
                    progress.Value = 0;
                }
                GoogleObject = await StorageRoot.UpdateObjectAclAsync(GoogleObject, StorageRoot.CreateObjectAccessControlList(security).ToList(), cancellationToken);

                _security = security;
            }
            finally
            {
                if (null != progress)
                {
                    progress.Value = 1;
                }
            }
        }
Esempio n. 2
0
 public StoragePath(StorageRoot storageRoot, string localPath)
 {
     StorageRoot = storageRoot ?? throw new ArgumentNullException(nameof(storageRoot));
     LocalPath   = localPath ?? throw new ArgumentNullException(nameof(localPath));
 }
 public Task UpdateContentAsync(Stream contents, string contentType, IProgress progress, CancellationToken cancellationToken)
 {
     return(StorageRoot.UpdateContentAsync(this, contents, contentType, progress, cancellationToken));
 }
 public Task <Stream> CreateReadableStreamAsync(CancellationToken cancellationToken)
 {
     return(StorageRoot.CreateReadableStreamAsync(this, cancellationToken));
 }
 public Task <StorageRecord> RenameAsync(string name, IProgress progress, CancellationToken cancellationToken)
 {
     return(StorageRoot.RenameAsync(this, name, progress, cancellationToken));
 }
Esempio n. 6
0
 public virtual Task DeleteAsync(IProgress progress, CancellationToken cancellationToken)
 {
     return(StorageRoot.DeleteRecursiveAsync(this, progress, cancellationToken));
 }
 public StorageRecord(StorageRoot storageRoot, string localPath, GoogleObject googleObject) : base(storageRoot, localPath)
 {
     GoogleObject = googleObject ?? throw new System.ArgumentNullException(nameof(googleObject));
     _security    = storageRoot.GetPermissions(GoogleObject);
 }
Esempio n. 8
0
 public StorageItem(StorageRoot storageRoot, string localPath) : base(storageRoot, localPath)
 {
 }
Esempio n. 9
0
 public IAsyncEnumerable <StorageItem> GetContentsAsync()
 => DelayedAsyncEnumerable.Delay(cancellationToken => StorageRoot.GetContentsAsync(LocalPath, cancellationToken));
Esempio n. 10
0
 public Task <StorageRecord> CreateRecordAsync(string name, Stream contents, string contentType = null, IProgress progress = null, CancellationToken cancellationToken = default(CancellationToken))
 => StorageRoot.CreateRecordAsync($"{LocalPath}/{name}", contents, contentType, progress, cancellationToken);
Esempio n. 11
0
 public Task <StorageFolder> CreateFolderAsync(string name, IProgress progress = null, CancellationToken cancellationToken = default(CancellationToken))
 => StorageRoot.CreateFolderAsync($"{LocalPath}/{name}", progress, cancellationToken);
Esempio n. 12
0
 public StorageFolder(StorageRoot storageRoot, string localPath) : base(storageRoot, localPath)
 {
 }