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;
                }
            }
        }
Beispiel #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));
 }
Beispiel #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);
 }
Beispiel #8
0
 public StorageItem(StorageRoot storageRoot, string localPath) : base(storageRoot, localPath)
 {
 }
Beispiel #9
0
 public IAsyncEnumerable <StorageItem> GetContentsAsync()
 => DelayedAsyncEnumerable.Delay(cancellationToken => StorageRoot.GetContentsAsync(LocalPath, cancellationToken));
Beispiel #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);
Beispiel #11
0
 public Task <StorageFolder> CreateFolderAsync(string name, IProgress progress = null, CancellationToken cancellationToken = default(CancellationToken))
 => StorageRoot.CreateFolderAsync($"{LocalPath}/{name}", progress, cancellationToken);
Beispiel #12
0
 public StorageFolder(StorageRoot storageRoot, string localPath) : base(storageRoot, localPath)
 {
 }