Class FileSystemContentStore
Downloads and stores update content as files on the local file system.
Inheritance
Implements
Namespace: Microsoft.PackageGraph.Storage.Local
Assembly: package-graph-microsoft-update.dll
Syntax
public class FileSystemContentStore : IContentStore
Constructors
| Improve this Doc View SourceFileSystemContentStore(String)
Opens or creates a new file system based content store. If the specified directory does not exist, it will be created.
Declaration
public FileSystemContentStore(string path)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | Path where to create the store |
Properties
| Improve this Doc View SourceDownloadedSize
The size in bytes of content downloaded during the current download operation
Declaration
public long DownloadedSize { get; }
Property Value
Type | Description |
---|---|
System.Int64 |
QueuedCount
The count of content files left to be downloaded in the current download operation
Declaration
public int QueuedCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
QueuedSize
The size in bytes of content left to be downloaded in the current download operation
Declaration
public long QueuedSize { get; }
Property Value
Type | Description |
---|---|
System.Int64 |
Methods
| Improve this Doc View SourceContains(IContentFile)
Checks if a content file has been downloaded
Declaration
public bool Contains(IContentFile file)
Parameters
Type | Name | Description |
---|---|---|
IContentFile | file | File to check if it was downloaded |
Returns
Type | Description |
---|---|
System.Boolean | True if the file was downloaded, false otherwise |
Contains(IContentFileDigest, out String)
Checks if an update file (by hash) has been downloaded
Declaration
public bool Contains(IContentFileDigest fileDigest, out string fileName)
Parameters
Type | Name | Description |
---|---|---|
IContentFileDigest | fileDigest | File hash to check if it was downloaded |
System.String | fileName | If the store contains the file by hash, this parameter receives the original file name |
Returns
Type | Description |
---|---|
System.Boolean | True if the file was downloaded, false otherwise |
Download(IEnumerable<IContentFile>, CancellationToken)
Downloads the specified update content files.
Declaration
public void Download(IEnumerable<IContentFile> files, CancellationToken cancelToken)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<IContentFile> | files | List of update content files to download |
System.Threading.CancellationToken | cancelToken | Cancellation token for aborting the operation |
DownloadAsync(IContentFile, CancellationToken)
Downloads the specified update content file
Declaration
public Task DownloadAsync(IContentFile file, CancellationToken cancelToken)
Parameters
Type | Name | Description |
---|---|---|
IContentFile | file | |
System.Threading.CancellationToken | cancelToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
Get(IContentFile)
Gets a read only stream for an update content file
Declaration
public Stream Get(IContentFile updateFile)
Parameters
Type | Name | Description |
---|---|---|
IContentFile | updateFile | The update file to open |
Returns
Type | Description |
---|---|
System.IO.Stream | Read only stream for the requested update content file |
Get(IContentFileDigest)
Gets a read only stream for an update content file (by hash)
Declaration
public Stream Get(IContentFileDigest fileDigest)
Parameters
Type | Name | Description |
---|---|---|
IContentFileDigest | fileDigest | The update file (by hash) to open |
Returns
Type | Description |
---|---|
System.IO.Stream | Read only stream for the requested update content file |
GetContentDirectoryName(IContentFileDigest)
Returns the directory name under which an update file would be stored on disk.
Declaration
public static string GetContentDirectoryName(IContentFileDigest fileDigest)
Parameters
Type | Name | Description |
---|---|---|
IContentFileDigest | fileDigest | The update content digest. |
Returns
Type | Description |
---|---|
System.String | Content parent directory name |
GetUri(IContentFile)
Gets the source URI for the update content file
Declaration
public string GetUri(IContentFile updateFile)
Parameters
Type | Name | Description |
---|---|---|
IContentFile | updateFile | The update file |
Returns
Type | Description |
---|---|
System.String | Source Uri for the content file |
GetUri(IContentFileDigest)
Gets an URI for the content file (by hash)
Declaration
public string GetUri(IContentFileDigest fileDigest)
Parameters
Type | Name | Description |
---|---|---|
IContentFileDigest | fileDigest | The update file hash |
Returns
Type | Description |
---|---|
System.String | Uri to content file |
Events
| Improve this Doc View SourceProgress
Raised on progress for long running content store operations
Declaration
public event EventHandler<ContentOperationProgress> Progress
Event Type
Type | Description |
---|---|
System.EventHandler<ContentOperationProgress> | Progress data. |