Class InMemoryFile
An in-memory implementation of a WebDAV document
Inherited Members
Namespace:FubarDev.WebDavServer.FileSystem.InMemory
Assembly:FubarDev.WebDavServer.FileSystem.InMemory.dll
Syntax
public class InMemoryFile : InMemoryEntry, IEntityTagEntry, IDocument, IEntry
Constructors
| Improve this Doc View SourceInMemoryFile(InMemoryFileSystem, ICollection, Uri, String)
Initializes a new instance of the InMemoryFile class.
Declaration
public InMemoryFile(InMemoryFileSystem fileSystem, ICollection parent, Uri path, string name)
Parameters
Type | Name | Description |
---|---|---|
InMemoryFileSystem | fileSystem | The file system this document belongs to |
ICollection | parent | The parent collection |
Uri | path | The root-relative path of this document |
String | name | The name of this document |
InMemoryFile(InMemoryFileSystem, ICollection, Uri, String, Byte[])
Initializes a new instance of the InMemoryFile class.
Declaration
public InMemoryFile(InMemoryFileSystem fileSystem, ICollection parent, Uri path, string name, byte[] data)
Parameters
Type | Name | Description |
---|---|---|
InMemoryFileSystem | fileSystem | The file system this document belongs to |
ICollection | parent | The parent collection |
Uri | path | The root-relative path of this document |
String | name | The name of this document |
System.Byte[] | data | The initial data of this document |
Properties
| Improve this Doc View SourceData
Gets or sets the underlying data
Declaration
public MemoryStream Data { get; set; }
Property Value
Type | Description |
---|---|
MemoryStream |
Length
Gets the length of the document
Declaration
public long Length { get; }
Property Value
Type | Description |
---|---|
Int64 |
Implements
Methods
| Improve this Doc View SourceCopyToAsync(ICollection, String, CancellationToken)
Copies the document to a new location within the same file system
Declaration
public Task<IDocument> CopyToAsync(ICollection collection, string name, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
ICollection | collection | The destination collection |
String | name | The new name of the document |
CancellationToken | cancellationToken | The cancellation token |
Returns
Type | Description |
---|---|
Task<IDocument> | The created document |
Implements
| Improve this Doc View SourceCreateAsync(CancellationToken)
Overwrites the document
Declaration
public Task<Stream> CreateAsync(CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | The cancellation token |
Returns
Type | Description |
---|---|
Task<Stream> | The stream used to write to the document |
Implements
| Improve this Doc View SourceDeleteAsync(CancellationToken)
Deletes this entry
Declaration
public override Task<DeleteResult> DeleteAsync(CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | The cancellation token |
Returns
Type | Description |
---|---|
Task<DeleteResult> | The result of the delete operation |
Overrides
Implements
| Improve this Doc View SourceMoveToAsync(ICollection, String, CancellationToken)
Moves the document to a new location within the same file system
Declaration
public Task<IDocument> MoveToAsync(ICollection collection, string name, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
ICollection | collection | The destination collection |
String | name | The new name of the document |
CancellationToken | cancellationToken | The cancellation token |
Returns
Type | Description |
---|---|
Task<IDocument> | The created document |
Implements
| Improve this Doc View SourceOpenReadAsync(CancellationToken)
Opens the document for reading
Declaration
public Task<Stream> OpenReadAsync(CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | The cancellation token |
Returns
Type | Description |
---|---|
Task<Stream> | The stream used to read the document |