/// <summary>Returns a stream so you can download a file</summary> /// <param name="fileName">The file name (the path will be extracted from the file name)</param> public async Task <Stream> DownloadAsync(string fileName) { var parsedName = FileNameParser.Parse(fileName); return(await DownloadAsync(parsedName.DirectoryName, parsedName.FileName)); }
/// <summary>Creates a wrapper around the file so that you can perform actions on it (doesn't do anything to the server).</summary> /// <param name="fileName">The file name (the path will be extracted from the file name)</param> public ShareFileClient CreateClient(string fileName) { var parsedName = FileNameParser.Parse(fileName); return(CreateClient(parsedName.DirectoryName, parsedName.FileName)); }
/// <summary>Delete a file</summary> /// <param name="fileName">The file name (the path will be extracted from the file name)</param> public async Task DeleteAsync(string fileName) { var parsedName = FileNameParser.Parse(fileName); await DeleteAsync(parsedName.DirectoryName, parsedName.FileName); }
/// <summary>Uploads a file</summary> /// <param name="fileStream">The file stream to upload.</param> /// <param name="fileName">The file name (the path will be extracted from the file name)</param> public async Task UploadAsync(Stream fileStream, string fileName) { var parsedName = FileNameParser.Parse(fileName); await UploadAsync(fileStream, parsedName.DirectoryName, parsedName.FileName); }