public Task <bool> SaveFileAsync(string path, Stream stream, CancellationToken cancellationToken = new CancellationToken()) { if (String.IsNullOrWhiteSpace(path)) { throw new ArgumentNullException(nameof(path)); } return(UnscopedStorage.SaveFileAsync(String.Concat(_pathPrefix, path), stream, cancellationToken)); }
public Task <bool> ExistsAsync(string path) { if (String.IsNullOrEmpty(path)) { throw new ArgumentNullException(nameof(path)); } return(UnscopedStorage.ExistsAsync(String.Concat(_pathPrefix, path))); }
public Task <Stream> GetFileStreamAsync(string path, CancellationToken cancellationToken = default) { if (String.IsNullOrEmpty(path)) { throw new ArgumentNullException(nameof(path)); } return(UnscopedStorage.GetFileStreamAsync(String.Concat(_pathPrefix, path), cancellationToken)); }
public async Task <FileSpec> GetFileInfoAsync(string path) { var file = await UnscopedStorage.GetFileInfoAsync(String.Concat(_pathPrefix, path)).AnyContext(); if (file != null) { file.Path = file.Path.Substring(_pathPrefix.Length); } return(file); }
public Task <bool> CopyFileAsync(string path, string targetPath, CancellationToken cancellationToken = default) { if (String.IsNullOrEmpty(path)) { throw new ArgumentNullException(nameof(path)); } if (String.IsNullOrEmpty(targetPath)) { throw new ArgumentNullException(nameof(targetPath)); } return(UnscopedStorage.CopyFileAsync(String.Concat(_pathPrefix, path), String.Concat(_pathPrefix, targetPath), cancellationToken)); }
public Task <bool> SaveFileAsync(string path, Stream stream, CancellationToken cancellationToken = default) { if (String.IsNullOrEmpty(path)) { throw new ArgumentNullException(nameof(path)); } if (stream == null) { throw new ArgumentNullException(nameof(stream)); } return(UnscopedStorage.SaveFileAsync(String.Concat(_pathPrefix, path), stream, cancellationToken)); }
public async Task <FileSpec> GetFileInfoAsync(string path) { if (String.IsNullOrEmpty(path)) { throw new ArgumentNullException(nameof(path)); } var file = await UnscopedStorage.GetFileInfoAsync(String.Concat(_pathPrefix, path)).AnyContext(); if (file != null) { file.Path = file.Path.Substring(_pathPrefix.Length); } return(file); }
public async Task <PagedFileListResult> GetPagedFileListAsync(int pageSize = 100, string searchPattern = null, CancellationToken cancellationToken = default) { if (pageSize <= 0) { return(PagedFileListResult.Empty); } var unscopedResult = await UnscopedStorage.GetPagedFileListAsync(pageSize, String.Concat(_pathPrefix, searchPattern), cancellationToken).AnyContext(); foreach (var file in unscopedResult.Files) { file.Path = file.Path.Substring(_pathPrefix.Length); } return(new PagedFileListResult(unscopedResult.Files, unscopedResult.HasMore, () => NextPage(unscopedResult))); }
public async Task <IEnumerable <FileSpec> > GetFileListAsync(string searchPattern = null, int?limit = null, int?skip = null, CancellationToken cancellationToken = new CancellationToken()) { if (String.IsNullOrEmpty(searchPattern)) { searchPattern = "*"; } var files = (await UnscopedStorage.GetFileListAsync(String.Concat(_pathPrefix, searchPattern), limit, skip, cancellationToken).AnyContext()).ToList(); foreach (var file in files) { file.Path = file.Path.Substring(_pathPrefix.Length); } return(files); }
public Task <int> DeleteFilesAsync(string searchPattern = null, CancellationToken cancellation = default) { return(UnscopedStorage.DeleteFilesAsync(String.Concat(_pathPrefix, searchPattern), cancellation)); }
public Task <bool> CopyFileAsync(string path, string targetpath, CancellationToken cancellationToken = new CancellationToken()) { return(UnscopedStorage.CopyFileAsync(String.Concat(_pathPrefix, path), String.Concat(_pathPrefix, targetpath), cancellationToken)); }
public Task <bool> SaveFileAsync(string path, Stream stream, CancellationToken cancellationToken = new CancellationToken()) { return(UnscopedStorage.SaveFileAsync(String.Concat(_pathPrefix, path), stream, cancellationToken)); }
public Task <bool> ExistsAsync(string path) { return(UnscopedStorage.ExistsAsync(String.Concat(_pathPrefix, path))); }
public Task <Stream> GetFileStreamAsync(string path, CancellationToken cancellationToken = new CancellationToken()) { return(UnscopedStorage.GetFileStreamAsync(String.Concat(_pathPrefix, path), cancellationToken)); }
public Task <int> DeleteFilesAsync(string searchPattern = null, CancellationToken cancellation = default) { searchPattern = !String.IsNullOrEmpty(searchPattern) ? String.Concat(_pathPrefix, searchPattern) : String.Concat(_pathPrefix, "*"); return(UnscopedStorage.DeleteFilesAsync(searchPattern, cancellation)); }
public Task <bool> DeleteFileAsync(string path, CancellationToken cancellationToken = new CancellationToken()) { return(UnscopedStorage.DeleteFileAsync(String.Concat(_pathPrefix, path), cancellationToken)); }
public void Dispose() { UnscopedStorage?.Dispose(); }